我試圖實現使用例如下面的存儲擴展,入門而在外表套上實現存儲定名爲未定義豆2011 SP1
我建立了我的DAO和其他文件,在使用相同的名稱上面的例子。創建這些文件後,我使用eclipse構建我的代碼並將其轉換爲.JAR文件名(cd_search_Indexer)。
1)我複製我的jar文件我的介紹tridion_home/lib文件夾
2)I創建束XML與如下名稱search_dao_bundle.xml並放置在相同的位置,即tridion_home/config其中我的cd_storage_xml放置。
<?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>
之後對於itemmapping我做了以下
<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)打開創建新的文件夾 「LIB」 創建的項目名稱爲 「存儲擴展」 蝕的Helios
2)
3)中並加入所有的tridion_home/lib中
4)創建新包 「com.tridion.storage.extension.search」
5)增加了我的DAO,實體和接口的Java類
6)增加了 'LIB'在參考
7)罐構建轉化爲罐(cd_storage_indexer封裝)
8)中複製的構建罐子成tridion_home/lib中
9)休息遵循相同米哈伊曾建議。
我_think_我之前有同樣的問題,這是因爲Eclipse中的選項。用@Component(「JPAPublishActionDAO」)或@Scope(「prototype」)標記的@標記的裝飾器不包含在導出的JAR中(我在反編譯我自己的jar後發現了這一點),因此Spring對它進行了扼殺。不記得它是什麼,但它是Export as Jar對話框中的一個選項 –
如果您有權訪問論壇:https://forum.tridion.com/topic.asp?TOPIC_ID=7078 - 將它作爲答覆給予信用的地方 –