3

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

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 的捆绑 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、Entity 和 Interface java 类

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

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

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

9)按照米海的建议休息。

4

4 回答 4

3

您的类型映射错误:

<StorageDAO typeMapping="PublishAction" ...

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

很可能您正在寻找替换现有项目类型之一,例如Binary和/或BinaryVariant类似于 Vinod 的示例。

于 2013-01-03T13:09:56.160 回答
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>

谢谢文

于 2013-01-03T09:40:20.640 回答
1

Tridion 论坛用户 Pankaj Gaur 之前遇到过同样的问题

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

于 2013-01-03T23:45:02.610 回答
0

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

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

转到项目的 bin 目录并在那里编写以下命令

jar -cvf cd_storage_extensions.jar *

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

于 2013-01-06T09:44:21.243 回答