3

In a Web 8 upgrade I am moving a Custom Storage extension to Web 8. The error is:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storageFactoryConfigurationLoader': Invocation of init method failed; nested exception is com.tridion.configuration.ConfigurationException: Could not load DAO Factory class: com.sdl.marklogic.storage.filesystem.MarkLogicFSDAOFactory at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)

I have re-compiled the Java code against Web 8 and it compiles OK. Then I have placed both the .jar file and the depending .jar file (MarkLogic search jar) in the services folder. (C:\SDL\Web\deployer\Dev\services\deployer-service). I re-started the Deployer Service in Windows.

Code with the attributes:

@Component("BetterFSDAOFactory") 
@Scope("prototype") public class
BetterFSDAOFactory implements DAOFactory {

I'm not sure if I also need to decorate this class or that it is causing the issue:

public class BetterFSEntityManager extends FSEntityManager {

To configure I've added a Bundle.xml file and also updated the storage conf. Below are the config files. I feel like I've done everything I need and don't understand why the .jar file is not loaded and the class not found. How can I do that?

cd_storage_conf.xml

<StorageBindings>
<!--  Optional
Overriding default SDL Web dao bundles. -->

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


<Storage
Type="filesystem" Class="com.sdl.marklogic.storage.filesystem.MarkLogicFSDAOFactory"
Id="fileAndMarkLogic"
defaultFilesystem="false">
    <Root Path="_web" />

    <SearchIndex
         Class="com.sdl.deployer.search.FSPoster"
         Path="_marklogic"/>
</Storage>

<Publication Id="9" defaultStorageId="defaultdb" cached="false">
     <Item typeMapping="Binary" storageId="fileAndMarkLogic" cached="false"/>
     <Item typeMapping="Page" cached="true" storageId="fileAndMarkLogic"/>
</Publication>

MarkLogicDAOBundle.xml

<?xml version="1.0" encoding="UTF-8"?>
<StorageDAOBundles>
    <StorageDAOBundle type="filesystem">
        <StorageDAO typeMapping="Page" class="com.sdl.marklogic.storage.filesystem.MarkLogicFSDAOFactory"/>
        <StorageDAO typeMapping="Binary" class="com.sdl.marklogic.storage.filesystem.MarkLogicFSDAOFactory"/>
    </StorageDAOBundle>
</StorageDAOBundles>

Full Error Stacktrace from cd_core log:

2016-05-19 11:34:25,992 ERROR DeployPipelineExecutor - Unable to start processing deployment package with transactionId: tcm:0-2025-66560
com.tridion.deployer.ProcessingException: Phase: Deployment Processing Phase failed. Error creating bean with name 'storageFactoryConfigurationLoader': Invocation of init method failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.sdl.marklogic.storage.filesystem.MarkLogicFSDAOFactory] is defined. No qualifying bean of type [com.sdl.marklogic.storage.filesystem.MarkLogicFSDAOFactory] is defined
    at com.tridion.deployer.phases.DeployPipelineExecutor.runMainExecutePhase(DeployPipelineExecutor.java:219) [cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.phases.DeployPipelineExecutor.doExecute(DeployPipelineExecutor.java:107) [cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.phases.DeployPipelineExecutor.execute(DeployPipelineExecutor.java:71) [cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.TransactionManager.lambda$pipelineRunnable$1(TransactionManager.java:345) [cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:1.8.0_91]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:1.8.0_91]
    at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_91]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storageFactoryConfigurationLoader': Invocation of init method failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.sdl.marklogic.storage.filesystem.MarkLogicFSDAOFactory] is defined
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at com.tridion.cd.core.kernel.SpringContentDeliveryKernel.ensureInitialised(SpringContentDeliveryKernel.java:38) ~[cd_core-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.cd.core.kernel.KernelFactory.registerKernel(KernelFactory.java:40) ~[cd_core-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.cd.core.kernel.KernelFactory.getKernel(KernelFactory.java:27) ~[cd_core-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.storage.StorageManagerFactory.getComponent(StorageManagerFactory.java:70) ~[cd_datalayer-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.storage.StorageManagerFactory.getStorageManager(StorageManagerFactory.java:49) ~[cd_datalayer-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.storage.StorageManagerFactory.getDAO(StorageManagerFactory.java:176) ~[cd_datalayer-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.storage.StorageManagerFactory.getDAO(StorageManagerFactory.java:122) ~[cd_datalayer-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.storage.deploy.PageHandler.deploy(PageHandler.java:58) ~[cd_datalayer-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.deployer.DeploymentHandler.deploy(DeploymentHandler.java:91) ~[cd_datalayer-8.1.1-1005.jar:8.1.1-1008]
    at com.tridion.deployer.modules.PageDeploy.processPage(PageDeploy.java:142) ~[cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.modules.PageDeploy.processItem(PageDeploy.java:115) ~[cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.SectionVisitor.processSection(SectionVisitor.java:83) ~[cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.SectionVisitor.process(SectionVisitor.java:60) ~[cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.Processor.process(Processor.java:108) ~[cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.workers.ProcessorWorker.doWork(ProcessorWorker.java:76) ~[cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.phases.ProcessingPhase.execute(ProcessingPhase.java:74) ~[cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    at com.tridion.deployer.phases.DeployPipelineExecutor.runMainExecutePhase(DeployPipelineExecutor.java:207) [cd_deployer-8.1.1-1008.jar:8.1.1-1008]
    ... 6 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.sdl.marklogic.storage.filesystem.MarkLogicFSDAOFactory] is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:371) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:980) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.configureStorage(StorageFactoryConfigurationLoader.java:127) ~[cd_datalayer-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.configure(StorageFactoryConfigurationLoader.java:71) ~[cd_datalayer-8.1.1-1005.jar:8.1.1-1005]
    at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.initialize(StorageFactoryConfigurationLoader.java:54) ~[cd_datalayer-8.1.1-1005.jar:8.1.1-1005]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_91]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_91]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_91]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    ... 36 common frames omitted
  • Can you post a complete stacktrace? This error is too generic to say anything sensible about it. – Raimond May 24 '16 at 14:29
  • Also - can your share your Factory code? Might be that you need to set the @Scope to "prototype" instead of "Singleton" – Raimond May 24 '16 at 14:36
  • Code updated above and also with full stack trace. Thanks! – robrtc May 31 '16 at 12:17
  • Can you set the Component and Scope attributes on the actual MarkLogicFSDaoFactory class instead of on the parent BetterFSDaoFactory class? – Raimond May 31 '16 at 12:19
  • All of the configuration points to a class named "MarkLogicFSDaoFactory", yet the code you posted is for BetterFSDaoFactory. What's up with that? – Peter Kjaer May 31 '16 at 12:27
1

The class path is built when the service is installed, so it's not enough to just restart the service. You have to actually uninstall and reinstall it for it to pick up new folders under the service directory.

  • Wow, that's good to know! Trying now – robrtc May 31 '16 at 12:32
  • Still not working...I restarted the service and in the cd_core log I can see my jar file there: .\services\deployer-service\marklogic-deployer.jar; – robrtc May 31 '16 at 13:17
  • What happens in the init of a Custom Deployer that would cause it to fail and not find the custom class? – robrtc May 31 '16 at 13:27
  • Probably just a configuration issue. See my comment on your question - you seem to have configured a different class than what is in your code. – Peter Kjaer May 31 '16 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.