Foros de discusión

Problem at restart with Tomcat 6.0.20 and later

Nicolas T., modificado hace 14 años.

Problem at restart with Tomcat 6.0.20 and later

New Member Mensaje: 1 Fecha de incorporación: 6/04/10 Mensajes recientes
Hello everyone,


I'm encountering some problem while migrating from Tomcat 6.0.18 to Tomcat 6.0.20 and later.

My portal (Liferay 5.2.3) comes with several portlets in separated WARs. Each WAR contains a context.xml file in META-INF and each context file contains :

<context>
	<loader loaderClass="com.liferay.support.tomcat.loader.PortalClassLoader" />
</context>


At the first startup with Tomcat 6.0.18, no problem. No problem either at second and next Tomcat startups.

At the first startup with Tomcat 6.0.20 (and later), each context file is copied inside $CATALINA_HOME/conf/Catalina/localhost (there were no copy with Tomcat 6.0.18). No problem for this first startup.
But, for the next startups, the files in $CATALINA_HOME/conf/Catalina/localhost prevent my portlets to be correctly registered. I get these errors for each WAR :

6 avr. 2010 14:59:39 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Déploiement du descripteur de configuration portlet-myportlet.xml
6 avr. 2010 14:59:39 com.liferay.portal.kernel.log.Jdk14LogImpl error
GRAVE: Portal class loader is not available to override the default Catalina web class loader
6 avr. 2010 14:59:39 org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart
6 avr. 2010 14:59:39 org.apache.catalina.core.StandardContext start
GRAVE: Erreur de démarrage du contexte [/portlet-myportlet] suite aux erreurs précédentes
6 avr. 2010 14:59:39 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
ATTENTION: JDBC driver de-registration failed
java.lang.NullPointerException
        at org.apache.catalina.loader.WebappClassLoader.clearReferencesJdbc(WebappClassLoader.java:1804)
        at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1740)
        at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1658)
        at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:710)
        at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4649)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4512)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:519)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

I checked twice my configuration, common.loader in catalina.properties and so on. The PortalClassLoader class is really accessible via the common.loader classpath.

A solution is to delete manually the xml files from $CATALINA_HOME/conf/Catalina/localhost. (This can't be a solution for production.)

The problem appears since Tomcat 6.0.19. I tried :
- 6.0.16, 6.0.18 : OK
- 6.0.20, 6.0.24, 6.0.26 : KO
It seems to be the same problem that this issue LPS-4210 : http://issues.liferay.com/browse/LPS-4210

The problem doesn't depend on Liferay version. I get the same issue with Liferay 5.2.3 and 5.1.2.
I even tried to install the bundle liferay 5.2.3 + Tomcat 6 (which comes with tomcat 6.0.18 and works fine) and to change only Tomcat : the problem reappears.


Has anybody encountered this problem ?
Is there a way to indicate to Tomcat to not copy context files ? (deployXML="false" in Host tag from server.xml doesn't work at all : it completely disables the parsing of context files)



Thanks by advance.
Nicolas.
Clark Cui, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

New Member Mensajes: 17 Fecha de incorporación: 15/02/10 Mensajes recientes
Hi, I also have this issue while migrating from Tomcat 6.0.18 to Tomcat 6.0.20.
Anyone knows? Thanks a lot.
Matvey Kazakov, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

New Member Mensaje: 1 Fecha de incorporación: 26/02/10 Mensajes recientes
Same issue on Liferay 6.0.2 RC2 bundle
Al Faller, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

New Member Mensajes: 16 Fecha de incorporación: 1/10/09 Mensajes recientes
Hi All -

Has there been any progress on this problem? I'm having the same issue, and have dealt with it by removing the xml files on shutdown, but it doesn't seem to be a great solution. Any recommendations?

Thanks,
Al
thumbnail
Samuel Liu, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

Expert Mensajes: 301 Fecha de incorporación: 27/05/10 Mensajes recientes
Hey Al,

I am in the process of reopening this ticket. Could you tell me what version of Liferay you're on / if you upgraded, and what version you were upgrading to? Or if you were just upgrading tomcat.

This would greatly help me to diagnose the problem.

Warm regards,
Sam
Al Faller, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

New Member Mensajes: 16 Fecha de incorporación: 1/10/09 Mensajes recientes
Samuel Liu:
Hey Al,

I am in the process of reopening this ticket. Could you tell me what version of Liferay you're on / if you upgraded, and what version you were upgrading to? Or if you were just upgrading tomcat.

This would greatly help me to diagnose the problem.

Warm regards,
Sam


Hi Sam,

I'm running 5.2 EE SP4 on Tomcat 6.0.26. I was running 6.0.18 and didn't have the problem. I'm pretty sure the problem stems from Tomcat bug #42747, https://issues.apache.org/bugzilla/show_bug.cgi?id=42747 which was addressed in 6.0.19.

Regards,

Al
thumbnail
Samuel Liu, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

Expert Mensajes: 301 Fecha de incorporación: 27/05/10 Mensajes recientes
Thanks for the detail, Al!

I'll get this ticket updated emoticon

Warm regards,
Sam
thumbnail
Igor Popik, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

New Member Mensajes: 4 Fecha de incorporación: 25/11/09 Mensajes recientes
Problem is caused by "improper" order of deployment of web applications by tomcat (LPS-4210). Liferay ROOT.war should be always deployed first for portal class loader to work. To fix this You have to put portal context in $CATALINA_HOME/conf/server.xml (inside Host tag).

My sample configuration:

  

<host name="localhost" appbase="webapps" unpackwars="true" autodeploy="true" deployonstartup="true" deployxml="true" xmlvalidation="false" xmlnamespaceaware="false">

<!-- ROOT Liferay context START -->
   <context path="" crosscontext="true" docbase="ROOT">
    <realm className="org.apache.catalina.realm.JAASRealm" appName="PortalRealm" userClassNames="com.liferay.portal.security.jaas.PortalPrincipal" roleClassNames="com.liferay.portal.security.jaas.PortalRole" debug="99" useContextClasssLoader="false" />
   </context>

<!-- ROOT Liferay context END -->

      </host>




This should fix the problem. Credits also go to WT ;-)
thumbnail
Jakub Liska, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

Regular Member Mensajes: 187 Fecha de incorporación: 25/03/10 Mensajes recientes
Doesn't work for me Igor... I have always " NoClassDefFoundError: com/liferay/portlet/StrutsPortlet " during deploy, no matter which Tomcat version I use. As I remember, using PortalClassloader in portlets using classes from portal-impl has never worked for me.

I'm testing it on sample-struts-liferay-portlet from plugin-SDK

BTW, I don't thing there should be triple "s" in useContextClassLoader attribute name :-P
thumbnail
Luis Rodríguez Fernández, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

Junior Member Mensajes: 86 Fecha de incorporación: 26/06/09 Mensajes recientes
Hi Igor!

Thanks a lot, it works perfectly! We are working with LR-5.2.3 Community over Tomcat 6.0.29 in a Windows 2008 R2 (64 bits) against Oracle 10g (uf...)

By the way, has anybody the recipe for working against Oracle 10g in such enviroment. Our perfomance is really low...

Thanks a lot,

Luis
Radhakrishna Meduri, modificado hace 10 años.

RE: Problem at restart with Tomcat 6.0.20 and later

New Member Mensajes: 22 Fecha de incorporación: 5/12/11 Mensajes recientes
Hi Luis,

We are trying to upgrade from LR 5.1.2 to 6.1.
I am finding it very difficulty in getting exact steps to upgrade to 6.1.
I am fine even clear steps on fresh LR 6.1.
could you please help me?

Thanks
Radhakrishna
thumbnail
Domingo Piña, modificado hace 13 años.

RE: Problem at restart with Tomcat 6.0.20 and later

Junior Member Mensajes: 28 Fecha de incorporación: 3/04/09 Mensajes recientes
Tested with LR-6.0.5 Community and works OK.
Thanks!!!