Foros de discusión

NoSuchBeanDefinitionException with required-deployment-contexts

Milan Gulyas, modificado hace 10 años.

NoSuchBeanDefinitionException with required-deployment-contexts

New Member Mensaje: 1 Fecha de incorporación: 11/07/13 Mensajes recientes
Hi Guys,

I am using Liferay 6.1.1 with tomcat 7.0.27 server and MySQL 5.6.12.
I have a database structure in a portlet called ServiceBuilder-portlet and i would like to use the util classes in Details-portlets. I found this stackoverflow post and tried to follow the 3rd solution of it, because that seemed the most general.

When I deploy the portlets I get 2 errors.
One says:
Could not delete C:/Liferay/liferay-portal-tomcat-6.1.1-ce-ga2/tomcat-7.0.27/webapps/Details-portlet/WEB-INF/lib. May be locked by another process.


I saw no effect of this error, so i skipped dealing with it.

The second is an exception, when i try to use the dependent classes (this is just the end of the trace):

rdEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.sample.portlet.RealEstate.service.TypeLocalService' is defined
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1094)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:276)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)
	at com.liferay.portal.bean.BeanLocatorImpl.doLocate(BeanLocatorImpl.java:137)
	at com.liferay.portal.bean.BeanLocatorImpl.locate(BeanLocatorImpl.java:83)


Basicly it stands that the first time I try to use a XxxLocalServiceUtil it is not loaded as a bean. (In trace lines above these occur my classes)

What I did to my portlets:
  • Create ServiceBuilder-portlet
  • Create the entities and build
  • set dependency in Details-portlet in liferay-plugin-package.properties (required-deployment-contexts=ServiceBuilder-portlet)


The XxxLocalServiceUtil classes are basicly in the service folder, so they will get into the jar file.
After i deploy both of the portlets (ServiceBuilder-portlet first) the ServiceBuilder-portlet-service.jar will be placed in the Details-portlet\WEB-INF\lib folder.

Please help me, I am stuck with this for 3 days now.

Thanks,
Milan