Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
pooja mahajan
Context initialization failed: Injection of autowired dependencies failed
January 31, 2013 2:22 AM
Answer

pooja mahajan

Rank: Junior Member

Posts: 45

Join Date: January 29, 2013

Recent Posts

i got error while deploying my application.war on liferay 6.1.1 same war is easily getting deployed on liferay 5.2
Following :

10:17:34,364 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].] (MSC service thread 1-3) Initializing Spring root WebApplicationContext
10:17:34,629 INFO (MSC service thread 1-3) 10:17:34,629 WARN [MSC service thread 1-3][PortletLocalServiceImpl:1145] Duplicate struts path alerts_WAR_clientportal
10:17:36,582 ERROR [org.springframework.web.portlet.DispatcherPortlet] (MSC service thread 1-3) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CrossSellingDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.ibatis.sqlmap.client.SqlMapClient com.closepf.crossselling.dao.CrossSellingDaoImpl.sqlMapClient; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.ibat
is.sqlmap.client.SqlMapClient] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=sqlMapClient)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1064) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) [org.springframework.context-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) [org.springframework.context-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.web.portlet.FrameworkPortlet.createPortletApplicationContext(FrameworkPortlet.java:356) [org.springframework.web.portlet-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.web.portlet.FrameworkPortlet.initPortletApplicationContext(FrameworkPortlet.java:294) [org.springframework.web.portlet-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.web.portlet.FrameworkPortlet.initPortletBean(FrameworkPortlet.java:268) [org.springframework.web.portlet-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.web.portlet.GenericPortletBean.init(GenericPortletBean.java:116) [org.springframework.web.portlet-3.0.3.jar:3.0.3.RELEASE]
at javax.portlet.GenericPortlet.init(GenericPortlet.java:107) [portlet.jar:]
at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:256)
at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:221)
at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:140)
at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:41) [portal-service.jar:]
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:310)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:546)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:321)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:120)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:188)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27) [portal-service.jar:]
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:151) [portal-service.jar:]
at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:141) [portal-service.jar:]
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42) [portal-service.jar:]
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:64) [portal-service.jar:]
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:56) [portal-service.jar:]
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:52) [portal-service.jar:]
at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:103) [portal-service.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_06]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_06]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_06]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.ibatis.sqlmap.client.SqlMapClient com.closepf.crossselling.dao.CrossSellingDaoImpl.sqlMapClient; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.ibatis.sqlmap.client.SqlMapClient] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualif
ier(value=sqlMapClient)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:507) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:283) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
... 41 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.ibatis.sqlmap.client.SqlMapClient] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=sqlMapClient)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:914) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:783) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:697) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
pooja mahajan
Injection of autowired dependencies fail in liferay 6.1+jboss7
May 21, 2013 4:05 AM
Answer

pooja mahajan

Rank: Junior Member

Posts: 45

Join Date: January 29, 2013

Recent Posts

I am using liferay-portal-6.1.1-ce-ga2 + jboss 7.1.1
i am trying to deploy my application.war

Can anyone please help me with this error:

Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'registrationDao' defined in PortletContext resource [/WEB-INF/docusign-portlet.xml]: Cannot resolve reference to bean 'sqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sqlMapClient' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) [org.springframework.beans-3.0.3.jar:3.0.3.RELEASE]
Manish Yadav
RE: Injection of autowired dependencies fail in liferay 6.1+jboss7
May 21, 2013 6:45 AM
Answer

Manish Yadav

Rank: Expert

Posts: 383

Join Date: May 26, 2012

Recent Posts

Could you please let us know sdk version you are using to create war file of portlet. War file created by plugin sdk 5.2 will not work with liferay 6.1 . you have to recreate war file with sdk 6.1
pooja mahajan
RE: Injection of autowired dependencies fail in liferay 6.1+jboss7
May 21, 2013 10:49 PM
Answer

pooja mahajan

Rank: Junior Member

Posts: 45

Join Date: January 29, 2013

Recent Posts

hi Manish,

thanks for replying my query.

Basically i am trying to upgrade my application from 5.2 to 6.1.1-ce-ga2.
Im liferay 5.2 :
1. we did not use any sdk plugin in eclipse for portlets.
2. Spring-PortletMVC framework

In liferay 6.1.1-ce-ga2 :
1. customize themes got deployed
2. algorithm : 6
and i get above error while deploying my application.war

Can you please suggest some way out
Manish Yadav
RE: Injection of autowired dependencies fail in liferay 6.1+jboss7
May 22, 2013 11:19 PM
Answer

Manish Yadav

Rank: Expert

Posts: 383

Join Date: May 26, 2012

Recent Posts

pooja mahajan:
hi Manish,

thanks for replying my query.

Basically i am trying to upgrade my application from 5.2 to 6.1.1-ce-ga2.
Im liferay 5.2 :
1. we did not use any sdk plugin in eclipse for portlets.
2. Spring-PortletMVC framework

In liferay 6.1.1-ce-ga2 :
1. customize themes got deployed
2. algorithm : 6
and i get above error while deploying my application.war

Can you please suggest some way out


Pooja you can't directly deploy war file of LR5.2 into LR6.1 because Liferay API is not same for 5.2 and 6.1.
you can create a new portlet with same name in sdk 6.1 and copy all files from 5.2 war file .Don't forget to run service builder and then create war file...Hope it will make sense
pooja mahajan
RESOLVED: Injection of autowired dependencies fail in liferay 6.1+jboss7
June 7, 2013 2:39 AM
Answer

pooja mahajan

Rank: Junior Member

Posts: 45

Join Date: January 29, 2013

Recent Posts

Thanks, for suggestion

With SDK for LR 6.1.1 :
application.war got deployed succesfully

Without SDK for LR 6.1.1 :
application.war got deployedby doing following changes:
-- In portlet.xml :
<portlet>
....
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/applicationContext.xml</value>
</init-param>
</portlet>
-- new spring jars in build path of application