Fórumok

.NoSuchBeanDefinitionException

camille vienot, módosítva 15 év-val korábban

.NoSuchBeanDefinitionException

New Member Bejegyzések: 15 Csatlakozás dátuma: 2008.10.10. Legújabb bejegyzések
Hello,
I have a problem when calling a custom service from Velocity.
Her is how I proceed:
1. I ve created a portlet with SDK
2. create service.xml + ant build-service
3. deploy portlet: it works when called from portlet JSP pages
4. Call the service from a Journal article through Velocity: it does not work

Instead of the journal content, an error message is displayed:

Invocation of method 'findService' in class com.liferay.portal.velocity.ServiceLocator threw exception org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.liferay.sampleservicebuilder.service.QuoteLocalService.velocity' is defined @ com.liferay.portlet.journal.util.JournalVmUtil[1,43]

I checked in the portlet-spring.xml file and have got the following:
<bean id="com.liferay.sampleservicebuilder.service.QuoteLocalService.velocity" class="org.springframework.aop.framework.ProxyFactoryBean" parent="baseVelocityService">
<property name="target" ref="com.liferay.sampleservicebuilder.service.QuoteLocalService.impl" />
</bean>

My knowledge of spring is not as good as to understand the porblem. Maybe I should use another BeanFactoryClass?
Thank you for reading and suggestions
Camille
camille vienot, módosítva 15 év-val korábban

RE: .NoSuchBeanDefinitionException

New Member Bejegyzések: 15 Csatlakozás dátuma: 2008.10.10. Legújabb bejegyzések
i had not seen a thread already exist on this issue:
camille vienot, módosítva 15 év-val korábban

RE: .NoSuchBeanDefinitionException

New Member Bejegyzések: 15 Csatlakozás dátuma: 2008.10.10. Legújabb bejegyzések
Hello again,
I cannot find org.springframework.aop.framework.ProxyFactoryBean class in the spring.jar of the ROOT instance. Maybe this is the reason why the bean is not created. I am trying to point to a new class in the portlet-spring.xml, but I am not sure what class to use.
I was not able to find the class used for the portal services. Anyone has an idea?
Thanks for reading,
Camille
thumbnail
Wilson Man, módosítva 15 év-val korábban

RE: .NoSuchBeanDefinitionException

Liferay Master Bejegyzések: 581 Csatlakozás dátuma: 2006.06.21. Legújabb bejegyzések
i'm not seeing this issue with my setup. which version of liferay are you on? (i'm using trunk which is pre 5.2. Also, how are you getting your service in your template?
camille vienot, módosítva 15 év-val korábban

RE: .NoSuchBeanDefinitionException

New Member Bejegyzések: 15 Csatlakozás dátuma: 2008.10.10. Legújabb bejegyzések
Thank you for replying,
Im using the latest version of trunk. And to call my service from my journal template, i use the following syntax:
#set($QuoteLocalService = $serviceLocator.findService("com.liferay.sampleservicebuilder.service.QuoteLocalService"))

When I call the service from the portlet in which it is defined, it works. But using velocity, it throws a NoSuchBeanDefinitionException because it could not find the com.liferay.sampleservicebuilder.service.QuoteLocalService.bean. However, it is defined and associated to the same java class than the portal services. It must not been loaded at the same time though
I ll keep looking. I may build the service in the ext environment.
Thanks
thumbnail
Wilson Man, módosítva 15 év-val korábban

RE: .NoSuchBeanDefinitionException

Liferay Master Bejegyzések: 581 Csatlakozás dátuma: 2006.06.21. Legújabb bejegyzések
that's strange, i'm doing something similar and it's working for me. i'm running tomcat 6, trunk revision 22388. i've deployed trunk to my tomcat 6 instance and my plugins sdk is pointing to the same tomcat for building services. is that your setup?
camille vienot, módosítva 15 év-val korábban

RE: .NoSuchBeanDefinitionException

New Member Bejegyzések: 15 Csatlakozás dátuma: 2008.10.10. Legújabb bejegyzések
I am running on tomcat 5.5. I am using the tomcat-5.5.26 bundle and did not update trunk. Is there any known issue for this configuration? In the mean time, I tried developing the service using the ext environment. It still does not work because the service found is null but at least, the bean is correctly loaded.
camille vienot, módosítva 15 év-val korábban

RE: .NoSuchBeanDefinitionException

New Member Bejegyzések: 15 Csatlakozás dátuma: 2008.10.10. Legújabb bejegyzések
The service works well when build and deployed using the ext environment, but not using sdk. I will do with it. Thnak you for your concern.
Camille
thumbnail
jigs vachhani, módosítva 14 év-val korábban

RE: .NoSuchBeanDefinitionException

Liferay Master Bejegyzések: 803 Csatlakozás dátuma: 2008.03.10. Legújabb bejegyzések
Its working fine for me so thank you so much for sharing your knowledge