在Tridion 2011 SP1中实现存储扩展时,未定义bean名称

时间:2013-01-03 09:02:37

标签: tridion tridion-2011 tridion-content-delivery tridion-storage-extension

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

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

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

1)我将我的jar文件复制到我的演示文稿tridion_home / lib文件夹

2)我创建了一个名为search_dao_bundle.xml的bundle xml,如下所示,放在同一个位置,即我的cd_storage_xml所在的tridion_home / config。

<?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中,如下所示:

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

并在我下面创建了我的新存储类型,如下所示:

<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>

之后我在下面进行了项目图示

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

4)我在我的核心日志

中重新启动了我的部署服务
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,实体和接口类时所遵循的步骤。

1)打开日食helios

2)创建了一个名为“Storage Extension”的项目

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

4)创建了新的包“com.tridion.storage.extension.search”

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

6)在参考文献

中添加了'lib'罐子

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

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

9)休息跟Mihai建议的一样。

4 个答案:

答案 0 :(得分:3)

您的类型映射错误:

<StorageDAO typeMapping="PublishAction" ...

每种类型映射都将现有项类型映射到该类型的(内置或自定义)DAO。 PublishAction不是内置项目类型,我怀疑您打算存储这些项目。

您很可能希望替换其中一种现有项目类型,例如{@ 1}}和/或Binary,例如Vinod的示例。

答案 1 :(得分:1)

这就是我对部署者扩展配置(cd_storage_conf)的要求..

列出一个然后将用于该出版物,除非它在较低级别被覆盖。  如果storageId定义的存储不存在,则将使用ItemTypes元素定义的默认存储,除非不匹配较低级别的类型映射。

<Publication Id="000" defaultStorageId="TridionDB" cached="false">
  <Item typeMapping="BinaryVariant" storageId="defaultCdnFile" cached="false" /> 
  <Item typeMapping="Binary" storageId="defaultCdnFile" cached="false" /> 
  </Publication>


<Storage Type="filesystem" Class="com.tridion.extensions.storage.XXX.CDNFSDAOFactory" Id="defaultCdnFile" defaultFilesystem="false">
  <Root Path="X:\XXXXX\DeployerExtension" /> 
  <Mapping PublicationId="50" BaseURL="http://XXX.com" /> 
  <Akamai Username="xxxx" Password="xxxx" /> 
  <Setting Property="https.proxyHost" Value="xxxx" /> 
  <Setting Property="https.proxyPort" Value="0000" /> 
  <Setting Property="https.proxyUser" Value="xxxx" /> 
  <Setting Property="https.proxyPassword" Value="xxxx" /> 
  <Setting Property="https.proxyDomain" Value="xx" /> 
  <Setting Property="proxySet" Value="true" /> 
  </Storage>

由于 VIN

答案 2 :(得分:1)

Tridion论坛用户Pankaj Gaur之前遇到了same issue

  

当我们从Eclipse导出它们作为JAR时,我们需要仔细创建类文件。   要明确解决方案:   在将类文件导出到JAR时的第一个屏幕上,确保选中“添加目录条目”选项

答案 3 :(得分:0)

在上面的Tridion专家提供的RND和建议之后,我终于设法加载了我的BEAN。

我没有从eclipse构建JAR,而是尝试从命令提示符(CMD)构建它。

转到项目的bin directrory并在那里写下命令

jar -cvf cd_storage_extensions.jar *

感谢所有专家(Nuno,Frank和Vinod)。