Wednesday, October 14, 2009

Liferay service deploying exception

I was working with the announcement portlet and wanted to make it a portlet plugin rather than editing it in the liferay ext environment. Initially I only wanted to change the appearance of it. For this while coping the jsp files and other required file to a newly created directories I have added the following jar files too. After
few tries I got it to work.

commons-beanutils.jar
commons-configuration.jar
commons-digester.jar
commons-lang.jar
commons-math.jar
displaytag.jar
easyconf.jar
newsletter-portlet-service.jar
struts.jar
xstream.jar

When I tried to add my own set of tables using the service builder and
deployed the portlet the server started to spit the following error.




Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'liferayTransactionManager' defined in ServletContext resource
[/WEB-INF/classes/META-INF/hibernate-spring.xml]: Initialization of bean failed
; nested exception is org.springframework.beans.TypeMismatchException: Failed to
convert property value of type [com.liferay.portal.spring.hibernate.PortletHibe
rnateConfiguration] to required type [org.hibernate.SessionFactory] for property
'sessionFactory'; nested exception is java.lang.IllegalArgumentException: Canno
t convert value of type [com.liferay.portal.spring.hibernate.PortletHibernateCon
figuration] to required type [org.hibernate.SessionFactory] for property 'sessio
nFactory': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)


10:09:49,297 INFO [STDOUT] 10:09:49,297 ERROR [PortletApplicationContext] org.s
pringframework.beans.factory.parsing.BeanDefinitionParsingException: Configurati
on problem: Class that bean class [com.liferay.portal.spring.annotation.BeanRefe
renceAnnotationBeanPostProcessor] depends on not found
Offending resource: ServletContext resource [/WEB-INF/classes/META-INF/base-spri
ng.xml]
Bean 'beanReferenceAnnotationBeanPostProcessor'; nested exception is java.lang.N
oClassDefFoundError: org/springframework/beans/factory/BeanFactoryAware
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Config
uration problem: Class that bean class [com.liferay.portal.spring.annotation.Bea
nReferenceAnnotationBeanPostProcessor] depends on not found
Offending resource: ServletContext resource [/WEB-INF/classes/META-INF/base-spri
ng.xml]
Bean 'beanReferenceAnnotationBeanPostProcessor'; nested exception is java.lang.N
oClassDefFoundError: org/springframework/beans/factory/BeanFactoryAware
at org.springframework.beans.factory.parsing.FailFastProblemReporter.err
or(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC
ontext.java:85)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.er
ror(BeanDefinitionParserDelegate.java:288)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa
rseBeanDefinitionElement(BeanDefinitionParserDelegate.java:487)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa
rseBeanDefinitionElement(BeanDefinitionParserDelegate.java:389)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa
rseBeanDefinitionElement(BeanDefinitionParserDelegate.java:358)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.processBeanDefinition(DefaultBeanDefinitionDocumentReader.java:239)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:153)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)

And loads of other error !!!!!!!!!!!!!!!!!!!!!!!


After struggling for some time I got to know what was going on. I have added the spring.jar and portal-impl.jar initially for my testing and I didnt remove them from the project and that was the issue. After removing these two files the protlet started to deploy without any problem

================================================================================

No comments:

Post a Comment

Subscribe