tridiontridion-2011tridion-content-deliverytridion-storage-extension

Getting No bean named defined while implementing storage extension in Tridion 2011 SP1


I am trying to implement the storage extension using below example,

http://www.sdltridionworld.com/articles/sdltridion2011/tutorials/extending-content-delivery-storage-sdltridion-2011-1.aspx

I created my DAO and other files with the same name used in above example. After creating these files I build my code using eclipse and coverted it into .JAR file name (cd_search_Indexer).

1) I copied my jar file to my presentation tridion_home/lib folder

2) I created bundle xml with name search_dao_bundle.xml as below and placed on same location i.e. tridion_home/config where my cd_storage_xml is placed.

<?xml version="1.0" encoding="UTF-8"?>
<StorageDAOBundles>
    <StorageDAOBundle type="persistence">
        <StorageDAO typeMapping="PublishAction" class="com.tridion.storage.extension.search.JPAPublishActionDAO" />
    </StorageDAOBundle>
</StorageDAOBundles>

3) After that I added my bundle entries into my cd_storage_conf.xml as below:

<StorageBindings>
    <Bundle src="search_dao_bundle.xml"/>
</StorageBindings>

and down under I created my new storage type as below:

<Storage Type="persistence" Id="searchdb" dialect="MSSQL" Class="com.tridion.storage.persistence.JPADAOFactory">
    <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
    <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
        <Property Name="serverName" Value="********" />
        <!--Property Name="portNumber" Value="1433" /-->
        <Property Name="databaseName" Value="********" />
        <Property Name="user" Value="********" />
        <Property Name="password" Value="********" />
    </DataSource>
</Storage>

After that for itemmapping I did below

<ItemTypes defaultStorageId="defaultdb" cached="false"> 
    <Item typeMapping="PublishAction" cached="false" storageId="searchdb" />
</ItemTypes>

4) I restarted my deployer service got below exception in my core logs

2013-01-03 12:44:20,713 ERROR JPADAOFactory - Unable to load JPA DAO with name: PublishAction and class: com.tridion.storage.extension.search.JPAPublishActionDAO due too exception in DAO construction
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'JPAPublishActionDAO' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527) ~[spring-beans.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083) ~[spring-beans.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274) ~[spring-beans.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) ~[spring-beans.jar:3.0.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1087) ~[spring-context.jar:3.0.5.RELEASE]
    at com.tridion.storage.persistence.JPADAOFactory.configureBundle(JPADAOFactory.java:80) ~[cd_datalayer.jar:na]
    at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.configureStorage(StorageFactoryConfigurationLoader.java:91) [cd_datalayer.jar:na]
    at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.configureStorage(StorageFactoryConfigurationLoader.java:65) [cd_datalayer.jar:na]
    at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.configure(StorageFactoryConfigurationLoader.java:51) [cd_datalayer.jar:na]
    at com.tridion.configuration.step.ConfigurationStepLoader.configure(ConfigurationStepLoader.java:47) [cd_core.jar:na]
    at com.tridion.storage.StorageManagerFactory.configure(StorageManagerFactory.java:139) [cd_datalayer.jar:na]
    at com.tridion.services.BaseService.<init>(BaseService.java:107) [cd_core.jar:na]
    at com.tridion.storage.StorageManagerFactory.<init>(StorageManagerFactory.java:106) [cd_datalayer.jar:na]
    at com.tridion.storage.StorageManagerFactory.reloadInstance(StorageManagerFactory.java:86) [cd_datalayer.jar:na]
    at com.tridion.storage.StorageManagerFactory.<clinit>(StorageManagerFactory.java:58) [cd_datalayer.jar:na]
    at com.tridion.storage.deploy.PageHandler.deploy(PageHandler.java:58) [cd_datalayer.jar:na]
    at com.tridion.deployer.DeploymentHandler.deploy(DeploymentHandler.java:90) [cd_datalayer.jar:na]
    at com.tridion.deployer.modules.PageDeploy.processPage(PageDeploy.java:145) [cd_deployer.jar:na]    
    at com.tridion.deployer.modules.PageDeploy.processItem(PageDeploy.java:118) [cd_deployer.jar:na]
    at com.tridion.deployer.SectionVisitor.processSection(SectionVisitor.java:83) [cd_deployer.jar:na]
    at com.tridion.deployer.SectionVisitor.processSection(SectionVisitor.java:87) [cd_deployer.jar:na]
    at com.tridion.deployer.SectionVisitor.processSection(SectionVisitor.java:87) [cd_deployer.jar:na]
    at com.tridion.deployer.SectionVisitor.processSection(SectionVisitor.java:87) [cd_deployer.jar:na]
    at com.tridion.deployer.SectionVisitor.process(SectionVisitor.java:60) [cd_deployer.jar:na]
    at com.tridion.deployer.Processor.process(Processor.java:109) [cd_deployer.jar:na]
    at com.tridion.deployer.workers.ProcessorWorker.doWork(ProcessorWorker.java:74) [cd_deployer.jar:na]
    at com.tridion.deployer.phases.ProcessingPhase.execute(ProcessingPhase.java:73) [cd_deployer.jar:na]
    at com.tridion.deployer.phases.DeployPipelineExecutor.runMainExecutePhase(DeployPipelineExecutor.java:186) [cd_deployer.jar:na]
    at com.tridion.deployer.phases.DeployPipelineExecutor.doExecute(DeployPipelineExecutor.java:97) [cd_deployer.jar:na]
    at com.tridion.deployer.phases.DeployPipelineExecutor.execute(DeployPipelineExecutor.java:61) [cd_deployer.jar:na]
    at com.tridion.deployer.TransactionManager.handleDeployPackage(TransactionManager.java:80) [cd_deployer.jar:na]
    at com.tridion.deployer.queue.QueueLocationHandler$1.run(QueueLocationHandler.java:176) [cd_deployer.jar:na]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.6.0_26]
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [na:1.6.0_26]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [na:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.6.0_26]
    at java.lang.Thread.run(Unknown Source) [na:1.6.0_26]

Edit: Below are the steps I followed to create my DAO, Entity and Interface classes.

1) Open the eclipse helios

2) Created a project with name "Storage Extension"

3) Created new folder "lib" and added all the tridion_home/lib

4) Created new package "com.tridion.storage.extension.search"

5) Added my DAO, Entity and Interface java classes

6) Added 'lib' jars in reference

7) Build the package converted to jar (cd_storage_indexer)

8) copied the build jar into tridion_home/lib

9) Rest followed the same as Mihai has suggested.


Solution

  • Tridion Forum user Pankaj Gaur ran into the same issue before.

    We need to create the class file carefully when we are exporting them as JAR from Eclipse. To pin point on the solution: On the First screen while exporting the class file to JAR, make sure "Add Directory Entries" option is checked