cancel
Showing results for 
Search instead for 
Did you mean: 

Upgraded to 4.2.e in Windows and facing issues.

umamaheswari
Champ in-the-making
Champ in-the-making
[size=14] Hi All,

I upgraded the Alfresco Community Edition in my system from 3.4.b to 4.2.e. I started the server and the start up was fine. But when i built the customisation and placed the jar in respective lib folder , I am getting lot of BeanCreationException. I will post a part of the log here. If I had not set the bean properties properly , why was it working fine with alfresco 3.4.b. Please help in resolving this start up issue.[/size]


Logs :



ERROR [web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'siteTemplateExtension' defined in class path resource [alfresco/template-services-context.xml]: Cannot resolve reference to bean 'SiteService' while setting bean property 'siteService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SiteService' defined in class path resource [alfresco/site-services-context.xml]: Cannot resolve reference to bean 'siteService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'siteService' defined in class path resource [alfresco/site-services-context.xml]: Invocation of init method failed; nested exception is org.alfresco.error.AlfrescoRuntimeException: 10120000 Property 'directNodeService' has not been set: com.customrule.executor.CustomSiteServiceImpl@6eb7f7 (class com.customrule.executor.CustomSiteServiceImpl)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
   at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
   at java.util.concurrent.FutureTask.run(FutureTask.java:166)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:724)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SiteService' defined in class path resource [alfresco/site-services-context.xml]: Cannot resolve reference to bean 'siteService' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'siteService' defined in class path resource [alfresco/site-services-context.xml]: Invocation of init method failed; nested exception is org.alfresco.error.AlfrescoRuntimeException: 10120000 Property 'directNodeService' has not been set: com.customrule.executor.CustomSiteServiceImpl@6eb7f7 (class com.customrule.executor.CustomSiteServiceImpl)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
   … 30 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'siteService' defined in class path resource [alfresco/site-services-context.xml]: Invocation of init method failed; nested exception is org.alfresco.error.AlfrescoRuntimeException: 10120000 Property 'directNodeService' has not been set: com.customrule.executor.CustomSiteServiceImpl@6eb7f7 (class com.customrule.executor.CustomSiteServiceImpl)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
   at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
   … 40 more
Caused by: org.alfresco.error.AlfrescoRuntimeException: 10120000 Property 'directNodeService' has not been set: com.customrule.executor.CustomSiteServiceImpl@6eb7f7 (class com.customrule.executor.CustomSiteServiceImpl)
   at org.alfresco.util.PropertyCheck.mandatory(PropertyCheck.java:44)
   at org.alfresco.repo.site.SiteServiceImpl.init(SiteServiceImpl.java:373)
   at com.customrule.executor.CustomSiteServiceImpl.init(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)

7 REPLIES 7

mitpatoliya
Star Collaborator
Star Collaborator
There might be few of injected services are removed or gets renamed in latest version
For instance in your this bean com.customrule.executor.CustomSiteServiceImpl
It is throwing error of not able to set "directNodeService".

Best way is to compile your code against 4.2 sdk and check all missing dependencies.

umamaheswari
Champ in-the-making
Champ in-the-making
Thanks for the reply Mits,

I have compiled the build against Alfresco-SDK-4.0.d only and got this error.

mitpatoliya
Star Collaborator
Star Collaborator
But all the services which you are injecting in your context files for your custom beans are you able to search all those beans within SDK 4.0.d?

Hi Mits,

I am able to search those bean definition only if I have added SDK AlfrescoEmbedded in my Workspace. This "directNodeService" is a  property that is called in init method of SiteServiceImpl in 4.2.e which was not mandatorily checked in 3.4.b. My question is which is the appropriate way to declare this "directNodeService" and define since its a new property in this version.
Is it mandatory to add SDK AlfrescoEmbedded into my workspace always besides adding jars also to build and run customisations successfully ??

Thanks once again..

mitpatoliya
Star Collaborator
Star Collaborator
Que:which is the appropriate way to declare this "directNodeService" and define since its a new property in this version?
Ans: I do not think way of declaring property is changed just two step
       Step1: Insert following tag in your bean defination
             

       <property name="directNodeService" ref="nodeService"/>

       Step2: defind property in bean and generate getter setter for that property.
   


Que: Is it mandatory to add SDK AlfrescoEmbedded into my workspace always besides adding jars also to build and run customisations successfully ??
Ans: Well not necessary but a good practice.

Mits,

I have declared the property in site-services-context.xml as


<bean id="siteService" class="com.customrule.executor.CustomSiteServiceImpl" init-method="init">



<property name="directNodeService" ref="nodeService"/>
..

</bean>


but No luck Smiley Sad I still get the same error.

Any suggestions ??


Thanks,

mrogers
Star Contributor
Star Contributor
You havn't given enough information about your configuration to help.   

But in general you should never change any of the alfresco config directly - it should be overridden.   One side effect of hacking files and not isolating your changes it becomes difficult to post your config on the forums for help!   Another side effect is that it makes updating much more difficult.

Clearly there's been a change in the spring config between 3.4 and 4.2. that your overrides are interfering with.

The good news is that its simply an initialisation error so it should be easy to track down.    I'd pay attention to the difference between your definition of the siteService and "baseNodeService which is what you are replacing.