在Tridion 2011 SP1中实现存储扩展时获取未定义的Bean [英] Getting No bean named defined while implementing storage extension in Tridion 2011 SP1

查看:90
本文介绍了在Tridion 2011 SP1中实现存储扩展时获取未定义的Bean的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下示例实现存储扩展

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

我创建了我的DAO和其他文件,其名称与上述示例中的文件相同.创建这些文件后,我使用eclipse构建代码并将其覆盖为.JAR文件名(cd_search_Indexer).

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)我将jar文件复制到演示文稿tridion_home/lib文件夹中

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

2)我创建了如下名称为search_dao_bundle.xml的包xml,并将其放置在同一位置,即cd_storage_xml所在的tridion_home/config.

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)之后,我将捆绑包条目添加到我的cd_storage_conf.xml中,如下所示:

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)我重新启动了部署程序服务,但我的核心日志中出现以下异常

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]

以下是创建DAO,实体和接口类的步骤.

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

1)打开月食日光

2)创建了一个名称为"Storage Extension"的项目

2) Created a project with name "Storage Extension"

3)创建新文件夹"lib",并添加所有tridion_home/lib

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

4)创建了新包"com.tridion.storage.extension.search"

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

5)添加了我的DAO,实体和接口Java类

5) Added my DAO, Entity and Interface java classes

6)在参考中添加了"lib"罐子

6) Added 'lib' jars in reference

7)构建转换为jar(cd_storage_indexer)的软件包

7) Build the package converted to jar (cd_storage_indexer)

8)将构建jar复制到tridion_home/lib

8) copied the build jar into tridion_home/lib

9)休息与Mihai所建议的一样.

9) Rest followed the same as Mihai has suggested.

推荐答案

Tridion论坛用户Pankaj Gaur遇到了

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

从Eclipse将其导出为JAR时,需要仔细创建类文件. 指出解决方案: 将类文件导出到JAR时,在第一个"屏幕上,确保选中添加目录项"选项

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

这篇关于在Tridion 2011 SP1中实现存储扩展时获取未定义的Bean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆