Thursday, December 2, 2010

Problems starting Nexus on Tomcat 6 on ubuntu

I pulled down the .war version (nexus-webapp-1.8.0.1.war) of the Nexus Open Source from the folks at Sonatype.

When I tried to deploy under Tomcat 6 on Ubuntu (10.10) the first thing you get is the following:


Dec 2, 2010 2:43:28 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/share/nexus/WEB-INF/lib/servlet-api-2.5-6.1.12.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger (org.sonatype.appcontext.AppContext).
log4j:WARN Please initialize the log4j system properly.
Dec 2, 2010 2:43:35 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Dec 2, 2010 2:43:35 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/nexus] startup failed due to previous errors
Dec 2, 2010 2:43:35 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/nexus] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@591686f7]) and a value of type [org.codehaus.plexus.classworlds.realm.ClassRealm] (value [ClassRealm[plexus.core, parent: null]]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Dec 2, 2010 2:43:35 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/nexus] created a ThreadLocal with key of type [null] (value [com.google.inject.internal.InjectorImpl$1@55f6efd2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@46faf015]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.


So I removed the offending file (servlet-api-2.5-6.1.12.jar) from the exploded war directory structure.

When trying to restart get the following in the catalina.out:



INFO: Deploying configuration descriptor nexus.xml
log4j:WARN No appenders could be found for logger (org.sonatype.appcontext.AppContext).
log4j:WARN Please initialize the log4j system properly.
Dec 2, 2010 2:45:22 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Dec 2, 2010 2:45:22 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/nexus] startup failed due to previous errors
Dec 2, 2010 2:45:22 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/nexus] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@46ab1778]) and a value of type [org.codehaus.plexus.classworlds.realm.ClassRealm] (value [ClassRealm[plexus.core, parent: null]]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Dec 2, 2010 2:45:22 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/nexus] created a ThreadLocal with key of type [null] (value [com.google.inject.internal.InjectorImpl$1@71fdf17c]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@56f93e5b]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.


Went and moved the location of log4j.properties from WEB-INF to WEB-INF/classes. I changed the log level to debug and restarted Tomcat getting:



2010-12-02 14:58:08 DEBUG - e.m.m.MimeDetectorR~ - Registering MimeDetector with name [eu.medsea.mimeutil.detector.ExtensionMimeDetector] and description [Get the mime types of file extensions]
2010-12-02 14:58:09 INFO - o.s.n.t.DefaultNexu~ - Initializing Nexus Timeline...
2010-12-02 14:58:09 ERROR - o.s.n.c.a.DefaultNe~ - ^M
******************************************************************************^M
* Could not create work directory [ /usr/share/tomcat6/sonatype-work/nexus]!!!! *^M
* Nexus cannot start properly until the process has read+write permissions to this folder *^M
******************************************************************************
2010-12-02 14:58:09 ERROR - o.s.n.c.a.DefaultNe~ - ^M


So I created the directory structure and added all rwr to the directory.


$ sudo mkdir -p /usr/share/tomcat6/sonatype-work/nexus
$ sudo chmod -R 777 /usr/share/tomcat6/sonatype-work


NOTE: had help from article HERE.

Problems starting Nexus on Tomcat 6 on ubuntu

I pulled down the .war version (nexus-webapp-1.8.0.1.war) of the Nexus Open Source from the folks at Sonatype.

When I tried to deploy under Tomcat 6 on Ubuntu (10.10) the first thing you get is the following:


Dec 2, 2010 2:43:28 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/share/nexus/WEB-INF/lib/servlet-api-2.5-6.1.12.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger (org.sonatype.appcontext.AppContext).
log4j:WARN Please initialize the log4j system properly.
Dec 2, 2010 2:43:35 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Dec 2, 2010 2:43:35 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/nexus] startup failed due to previous errors
Dec 2, 2010 2:43:35 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/nexus] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@591686f7]) and a value of type [org.codehaus.plexus.classworlds.realm.ClassRealm] (value [ClassRealm[plexus.core, parent: null]]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Dec 2, 2010 2:43:35 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/nexus] created a ThreadLocal with key of type [null] (value [com.google.inject.internal.InjectorImpl$1@55f6efd2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@46faf015]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.

How to download the nexus book?

Download HERE

Repository Management with Nexus
Maven Book