掲示板

Problem at restart with Tomcat 6.0.20 and later

14年前 に Nicolas T. によって更新されました。

Problem at restart with Tomcat 6.0.20 and later

New Member 投稿: 1 参加年月日: 10/04/06 最新の投稿
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.
13年前 に Clark Cui によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

New Member 投稿: 17 参加年月日: 10/02/15 最新の投稿
Hi, I also have this issue while migrating from Tomcat 6.0.18 to Tomcat 6.0.20.
Anyone knows? Thanks a lot.
13年前 に Matvey Kazakov によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

New Member 投稿: 1 参加年月日: 10/02/26 最新の投稿
Same issue on Liferay 6.0.2 RC2 bundle
13年前 に Al Faller によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

New Member 投稿: 16 参加年月日: 09/10/01 最新の投稿
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
13年前 に Samuel Liu によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

Expert 投稿: 301 参加年月日: 10/05/27 最新の投稿
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
13年前 に Al Faller によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

New Member 投稿: 16 参加年月日: 09/10/01 最新の投稿
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
13年前 に Samuel Liu によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

Expert 投稿: 301 参加年月日: 10/05/27 最新の投稿
Thanks for the detail, Al!

I'll get this ticket updated emoticon

Warm regards,
Sam
thumbnail
13年前 に Igor Popik によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

New Member 投稿: 4 参加年月日: 09/11/25 最新の投稿
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
13年前 に Jakub Liska によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

Regular Member 投稿: 187 参加年月日: 10/03/25 最新の投稿
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
13年前 に Luis Rodríguez Fernández によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

Junior Member 投稿: 86 参加年月日: 09/06/26 最新の投稿
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
10年前 に Radhakrishna Meduri によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

New Member 投稿: 22 参加年月日: 11/12/05 最新の投稿
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
13年前 に Domingo Piña によって更新されました。

RE: Problem at restart with Tomcat 6.0.20 and later

Junior Member 投稿: 28 参加年月日: 09/04/03 最新の投稿
Tested with LR-6.0.5 Community and works OK.
Thanks!!!