Foros de discusión
Liferay 6.0.6 Portlet Service Mysql "Could not inject BeanReference fields"
Tom Mahy, modificado hace 12 años.
Liferay 6.0.6 Portlet Service Mysql "Could not inject BeanReference fields"
Regular Member Mensajes: 103 Fecha de incorporación: 11/05/11 Mensajes recientes
Hi,
Im on liferay 6.0.6 CE.
I created a portlet and made a service of it. I also made it a remote service.
This works great and i can access it from everywhere.
Now in trying to create some custom SQL queries.
step 1: create a finderImpl class --> CommunityFinderImpl
step 2 : extends BasePersistenceImpl<Community> implements CommunityFinder{
step 3 : do a service build.
New classes are created and everything looks good.
From my CommunityLocalServiceImpl i call the CommunityUtil.mysearch(String value);
I then deploy it and get this :
any ideas ?
Im on liferay 6.0.6 CE.
I created a portlet and made a service of it. I also made it a remote service.
This works great and i can access it from everywhere.
Now in trying to create some custom SQL queries.
step 1: create a finderImpl class --> CommunityFinderImpl
step 2 : extends BasePersistenceImpl<Community> implements CommunityFinder{
step 3 : do a service build.
New classes are created and everything looks good.
From my CommunityLocalServiceImpl i call the CommunityUtil.mysearch(String value);
I then deploy it and get this :
12:12:54,111 ERROR [ContextLoader:220] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'be.company.service.CommunityLocalService': Could not inject BeanReference fields; nested exception is java.lang.IllegalArgumentException: Can not set be.company.service.CommunityLocalService field be.company.service.base.CommunityServiceBaseImpl.communityLocalService to $Proxy339
at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:142)
at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:148)
at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor.postProcessBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
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.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 com.liferay.portal.spring.context.PortletContextLoaderListener.contextInitialized(PortletContextLoaderListener.java:71)
at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextListener.doPortalInit(PortalClassLoaderServletContextListener.java:91)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:52)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:50)
at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextListener.contextInitialized(PortalClassLoaderServletContextListener.java:52)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: Can not set be.company.service.CommunityLocalService field be.company.service.base.CommunityServiceBaseImpl.communityLocalService to $Proxy339
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:680)
at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:139)
... 33 more
12:12:54,116 ERROR [PortalClassLoaderServletContextListener:94] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'be.company.service.CommunityLocalService': Could not inject BeanReference fields; nested exception is java.lang.IllegalArgumentException: Can not set be.company.service.CommunityLocalService field be.company.service.base.CommunityServiceBaseImpl.communityLocalService to $Proxy339
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'be.company.service.CommunityLocalService': Could not inject BeanReference fields; nested exception is java.lang.IllegalArgumentException: Can not set be.company.service.CommunityLocalService field be.company.service.base.CommunityServiceBaseImpl.communityLocalService to $Proxy339
at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:142)
at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:148)
at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor.postProcessBeforeInitialization(BeanReferenceAnnotationBeanPostProcessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
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.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 com.liferay.portal.spring.context.PortletContextLoaderListener.contextInitialized(PortletContextLoaderListener.java:71)
at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextListener.doPortalInit(PortalClassLoaderServletContextListener.java:91)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:52)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:50)
at com.liferay.portal.kernel.servlet.PortalClassLoaderServletContextListener.contextInitialized(PortalClassLoaderServletContextListener.java:52)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: Can not set be.company.service.CommunityLocalService field be.company.service.base.CommunityServiceBaseImpl.communityLocalService to $Proxy339
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:680)
at com.liferay.portal.spring.annotation.BeanReferenceAnnotationBeanPostProcessor._autoInject(BeanReferenceAnnotationBeanPostProcessor.java:139)
... 33 more
any ideas ?
Krishna Melkote, modificado hace 12 años.
RE: Liferay 6.0.6 Portlet Service Mysql "Could not inject BeanReference fie
Junior Member Mensajes: 52 Fecha de incorporación: 22/09/10 Mensajes recientes
Tom Mahy, modificado hace 12 años.
RE: Liferay 6.0.6 Portlet Service Mysql "Could not inject BeanReference fie
Regular Member Mensajes: 103 Fecha de incorporación: 11/05/11 Mensajes recientes
Hi,
Applied the patch, but i'm still getting the same error.
Regards,
Tom Mahy
Applied the patch, but i'm still getting the same error.
Regards,
Tom Mahy
Tom Mahy, modificado hace 12 años.
RE: Liferay 6.0.6 Portlet Service Mysql "Could not inject BeanReference fie (Respuesta)
Regular Member Mensajes: 103 Fecha de incorporación: 11/05/11 Mensajes recientes
moved content from ClassLocalServiceImpl to ClassServiceImpl and everything works