Foros de discusión

Liferay 6.0 and 6.1 deployment of war fails

A B, modificado hace 10 años.

Liferay 6.0 and 6.1 deployment of war fails

New Member Mensajes: 8 Fecha de incorporación: 26/04/13 Mensajes recientes
Hi,
I am trying to deploy war files for the liferay 6.0.6 and 6.1 on both i.e. tomcat and glassfish but had no luck yet. I have download the bundled versions (with tomcat and glassfish) as well and they worked well, I have resolved the jar dependencies for the war file but no luck with the WAR deployment. I also tried to copy all the jar files from the bundled versions and to those glassfish/tomcat servers which I installed but it didn't work.
Following are the logs from Tomcat and Glassfish!
Tomcat6 shows following###
INFO: Detected server tomcat
Loading jar:file:/var/lib/tomcat6/webapps/liferay-portal/WEB-INF/lib/portal-impl.jar!/portal.properties
15:14:47,048 ERROR [ContextLoader:220] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'asyncAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'asyncAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'threadLocalCacheAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'threadLocalCacheAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'bufferedIncrementAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bufferedIncrementAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'transactionAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'liferayTransactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayTransactionManager' defined in class path resource [META-INF/hibernate-spring.xml]: Cannot resolve reference to bean 'liferayDataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayDataSource' defined in class path resource [META-INF/infrastructure-spring.xml]: Cannot create inner bean 'com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean#78b3e62' of type [com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean] while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean#78b3e62' defined in class path resource [META-INF/infrastructure-spring.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/liferay/portal/kernel/annotation/BeanReference
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)

####################################Glassfish V3 (Liferay 6.0)
And glassfish shows following
[#|2013-05-08T14:03:12.174+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=26;_ThreadName=Thread-2;|Loading file:/var/glassfish3/glassfish/domains/domain1/generated/jsp/liferay-portal/loader_1018058632/portal.properties|#]

[#|2013-05-08T14:03:16.654+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=26;_ThreadName=Thread-2;|14:03:16,645 ERROR [ContextLoader:220] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'asyncAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'asyncAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'threadLocalCacheAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'threadLocalCacheAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'bufferedIncrementAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bufferedIncrementAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'transactionAdvice' while setting bean property 'nextMethodInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'liferayTransactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayTransactionManager' defined in class path resource [META-INF/hibernate-spring.xml]: Cannot resolve reference to bean 'liferayDataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayDataSource' defined in class path resource [META-INF/infrastructure-spring.xml]: Cannot create inner bean 'com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean#685d5a4d' of type [com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean] while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean#685d5a4d' defined in class path resource [META-INF/infrastructure-spring.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/liferay/portal/kernel/annotation/BeanReference
##############################################################################################################
##############Logs of Liferay 6.1 over glassfish

[#|2013-05-08T14:17:35.397+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=21;_ThreadName=Thread-2;|14:17:35,396 INFO [admin-thread-pool-4848(7)][DialectDetector:136] Found dialect org.hibernate.dialect.HSQLDialect
|#]

[#|2013-05-08T14:18:42.450+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=23;_ThreadName=Thread-2;|Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" |#]

[#|2013-05-08T14:18:42.452+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=23;_ThreadName=Thread-2;|java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.lang.String.substring(String.java:1939)
at org.hsqldb.Scanner.scanUndelimitedIdentifier(Scanner.java:868)
at org.hsqldb.Scanner.scanIdentifierChain(Scanner.java:809)
at org.hsqldb.Scanner.scanToken(Scanner.java:1758)
at org.hsqldb.Scanner.scanNext(Scanner.java:261)
at org.hsqldb.ParserBase.read(ParserBase.java:244)
at org.hsqldb.ParserDQL.readTableName(ParserDQL.java:5532)
at org.hsqldb.ParserDQL.readTableOrSubquery(ParserDQL.java:1791)
at org.hsqldb.ParserDQL.XreadTableReference(ParserDQL.java:1203)
at org.hsqldb.ParserDQL.XreadFromClause(ParserDQL.java:1190)
at org.hsqldb.ParserDQL.XreadTableExpression(ParserDQL.java:1091)
at org.hsqldb.ParserDQL.XreadQuerySpecification(ParserDQL.java:1084)
at org.hsqldb.ParserDQL.XreadSimpleTable(ParserDQL.java:1067)
at org.hsqldb.ParserDQL.XreadQueryPrimary(ParserDQL.java:996)
at org.hsqldb.ParserDQL.XreadQueryTerm(ParserDQL.java:962)
at org.hsqldb.ParserDQL.XreadQueryExpressionBody(ParserDQL.java:941)
at org.hsqldb.ParserDQL.XreadQueryExpression(ParserDQL.java:915)
at org.hsqldb.ParserDQL.compileCursorSpecification(ParserDQL.java:5680)
at org.hsqldb.ParserCommand.compilePart(ParserCommand.java:142)
at org.hsqldb.ParserCommand.compileStatements(ParserCommand.java:90)
at org.hsqldb.Session.executeDirectStatement(Session.java:1194)
at org.hsqldb.Session.execute(Session.java:993)
at org.hsqldb.jdbc.JDBCStatement.fetchResult(JDBCStatement.java:1830)
at org.hsqldb.jdbc.JDBCStatement.executeQuery(JDBCStatement.java:181)
at org.hsqldb.jdbc.JDBCDatabaseMetaData.execute(JDBCDatabaseMetaData.java:6170)
at org.hsqldb.jdbc.JDBCDatabaseMetaData.getTables(JDBCDatabaseMetaData.java:3172)
at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectionNoQuery(DefaultConnectionTester.java:185)
at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:62)
at com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:67)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:368)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:310)
at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:1999)
|#]

[#|2013-05-08T14:18:46.720+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=24;_ThreadName=Thread-2;|Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" |#]
thumbnail
David H Nebinger, modificado hace 10 años.

RE: Liferay 6.0 and 6.1 deployment of war fails

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
You got the deployments all wrong...

The best thing you can do is start w/ a clean bundle and a clean download of the app container at the same version as the bundle is using.

Use a diff tool to compare the two directories and identify the changes, then apply them to your real deployment target.

On tomcat, for example, you'll be doing the following:

1. create the lib/ext directory and copy the jars from the bundle there.
2. edit the catalina.properties file to use the lib/ext directory as a global jar dir
3. deploy the liferay war.

Glassfish will be pretty much the same, but I'm not using GF so I don't have the same details.

Using the diff tool will highlight the changes that you need to make to a vanilla version of the container.
A B, modificado hace 10 años.

RE: Liferay 6.0 and 6.1 deployment of war fails

New Member Mensajes: 8 Fecha de incorporación: 26/04/13 Mensajes recientes
I did this with tomcat, but it failed, did you deploy war file of liferay's community edition and which version did you deploy ?
Please share !
thumbnail
David H Nebinger, modificado hace 10 años.

RE: Liferay 6.0 and 6.1 deployment of war fails

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
I don't think you did...

Both exceptions are reporting NoClassDefException for classes which are part of the portal-service.jar which (for tomcat) is in lib/ext. Since you're getting NoClassDef exceptions, then you haven't tweaked the container correctly. Either the lib/ext directory is not there, or the jars have not been put there, or the catalina.properties file was not modified to include the lib/ext directory.

It really doesn't matter what version of Liferay/tomcat/glassfish you're using; each version of tomcat requires the same changes, and I believe GF is about the same.

NOTE: Deploying Liferay to any existing application container is always more than just dropping the war file in. If that's all you're doing to deploy Liferay, then of course it's going to fail.