cancel
Showing results for 
Search instead for 
Did you mean: 

Context initialization failed + StandardContext Error

mythox
Champ on-the-rise
Champ on-the-rise
Hi, the below question might be asked for many times already, but as a beginner of both Alfresco and tomcat, I still cannot cure by the previously solution, a few line of installation error I found on the catalina.out as following:

Feb 2, 2009 6:14:12 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured f
or this context. The duplicate definition has been ignored.
18:14:53,505  ERROR [web.context.ContextLoader] Context initialization failed

Feb 2, 2009 6:14:53 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Feb 2, 2009 6:14:53 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/alfresco] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NO
PLoggerRepository.

Any idea is welcome, thankyou in advance

Steven
4 REPLIES 4

openpj
Elite Collaborator
Elite Collaborator
Try to delete myfaces jars from Alfresco WEB-INF/lib, maybe you have just these files installed in your Tomcat lib directory.

Hope this helps.

mythox
Champ on-the-rise
Champ on-the-rise
Thankyou, i've renamed the 3rd and 4th of below item into another name

./tomcat/webapps/share/WEB-INF/lib/myfaces-api-1.1.5.jar
./tomcat/webapps/share/WEB-INF/lib/myfaces-impl-1.1.5.jar
./tomcat/webapps/alfresco/WEB-INF/lib/myfaces-api-1.1.5.jar
./tomcat/webapps/alfresco/WEB-INF/lib/myfaces-impl-1.1.5.jar

started Alfresco and find no error message under cataline.out now!

then browse to it again, but same HTTP status error:
=======
HTTP Status 404

type: Status report

message:

description: The requested resource () is not available.
========

then i found something logged by localhost.2009-02-06.log

========
Feb 6, 2009 10:36:12 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Feb 6, 2009 10:36:21 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.apache.myfaces.webapp.StartupServletCont
extListener
java.lang.ClassNotFoundException: org.apache.myfaces.webapp.StartupServletContextListener
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        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:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        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:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Feb 6, 2009 10:36:21 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Feb 6, 2009 10:36:22 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Feb 6, 2009 10:36:22 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
========

Can you please advise?  Thankyou.

Steven

mythox
Champ on-the-rise
Champ on-the-rise
Appreciate if anyone can help, thankyou.

jsmith
Champ in-the-making
Champ in-the-making
I had the same errors you did and I tried what was suggested above and ended up with the same errors in the localhost file.  I'm running this on Ubuntu 10.04.1 LTS just for reference so some of my paths may be slightly different.

I think I figured it out though.  First stop Tomcat and clean out all the alfresco stuff to start fresh:

service tomcat6 stop
rm -fr $TOMCAT_HOME/webapps/alfresco/
rm -fr $TOMCAT_HOME/webapps/share/
rm -fr $TOMCAT_HOME/work/Catalina/localhost/alfresco
rm -fr $TOMCAT_HOME/work/Catalina/localhost/share

Then replace the .war files in $TOMCAT_HOME/webapps/ with the originals with the myfaces-xx.jar files not removed/renamed.

Then modify your catalina.sh script.  Mine is located in /usr/share/tomcat6/bin.  I added the following right after the beginning comments before any of the code.  Basically it sets higher memory settings for java which Alfresco requires.  Some may be higher than needed but they worked for me.

export CATALINA_OPTS="-Xss1024K -Xms1G -Xmx2G -XX:MaxPermSize=256M -XX:NewSize=512m"

Then I started Tomcat and alfresco deployed fine.  I still had this entry but there wasn't any "severe" errors any more.

INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.

Now I only have one problem after these changes….  the catalina.xxxxxx.log file and other tomcat logs no longer have any information updated in them until I stop Tomcat and then they fills with all the information since the last start!