geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <xhh...@gmail.com>
Subject Re: ClassNotFoundException: log4j Appender (Geronimo 3.0-beta1)
Date Mon, 26 Mar 2012 13:47:00 GMT
Hmm, could you try this,  <sys:import-package>!org.**apach
e.log4j*</sys:import-**package> ?

2012/3/26 Juho Autio <juho.autio@profium.com>

> Hi,
>
> Geronimo 3.0-beta1 fails to deploy my war due to classloading problems.
>
> Note that this war was successfully deployed on Geronimo 2.2.1 with tomcat
> 6 and also on a plain tomcat 7.
>
> My war has a web.xml with 2.3 servlet doctype and it ships some jar
> libraries under WEB-INF/lib/ - most importantly, a copy of log4j.jar. The
> war has a geronimo-web.xml with just an empty sys:environment element in it.
>
> When I try to deploy on Geronimo 3.0-beta1, I get this stacktrace:
>
> 2012-03-22 12:08:36,754 ERROR [[/myapp]] Servlet /myapp threw load()
> exception
> java.lang.**ClassNotFoundException: org.apache.log4j.Appender
>        at org.eclipse.osgi.internal.**loader.BundleLoader.**
> findClassInternal(**BundleLoader.java:467)
>        at org.eclipse.osgi.internal.**loader.BundleLoader.findClass(**
> BundleLoader.java:429)
>        at org.eclipse.osgi.internal.**loader.BundleLoader.findClass(**
> BundleLoader.java:417)
>        at org.apache.geronimo.hook.**equinox.GeronimoClassLoader.**
> loadClass(GeronimoClassLoader.**java:85)
>        at java.lang.ClassLoader.**loadClass(ClassLoader.java:**247)
>        at java.lang.Class.forName0(**Native Method)
>        at java.lang.Class.forName(Class.**java:247)
>        at org.apache.xbean.recipe.**RecipeHelper.loadClass(**
> RecipeHelper.java:52)
>        at org.apache.xbean.recipe.**ObjectRecipe.getType(**
> ObjectRecipe.java:353)
>        at org.apache.xbean.recipe.**ObjectRecipe.internalCreate(**
> ObjectRecipe.java:266)
>        at org.apache.xbean.recipe.**AbstractRecipe.create(**
> AbstractRecipe.java:96)
>        at org.apache.xbean.recipe.**AbstractRecipe.create(**
> AbstractRecipe.java:61)
>        at org.apache.geronimo.j2ee.**annotation.Holder.newInstance(**
> Holder.java:178)
>        at org.apache.geronimo.tomcat.**TomcatInstanceManager.**
> newInstance(**TomcatInstanceManager.java:74)
>        at org.apache.catalina.core.**StandardWrapper.loadServlet(**
> StandardWrapper.java:1087)
>        at org.apache.catalina.core.**StandardWrapper.load(**
> StandardWrapper.java:1031)
>        at org.apache.catalina.core.**StandardContext.loadOnStartup(**
> StandardContext.java:4957)
>        at org.apache.catalina.core.**StandardContext$3.call(**
> StandardContext.java:5284)
>        at org.apache.catalina.core.**StandardContext$3.call(**
> StandardContext.java:5279)
>        at java.util.concurrent.**FutureTask$Sync.innerRun(**
> FutureTask.java:303)
>        at java.util.concurrent.**FutureTask.run(FutureTask.**java:138)
>        at java.util.concurrent.**ThreadPoolExecutor$Worker.**
> runTask(ThreadPoolExecutor.**java:886)
>        at java.util.concurrent.**ThreadPoolExecutor$Worker.run(**
> ThreadPoolExecutor.java:908)
>        at java.lang.Thread.run(Thread.**java:662)
>
>
> Interestingly, if I remove the log4j jar, the stacktrace above is avoided,
> but the same issue hits in an actual servlet initialization. It has a
> slightly different error message:
>
> 2012-03-22 13:53:31,565 ERROR [DeploymentPortlet] The application was not
> deployed.
> Could not fully load class: com.myapp.MyFilter
>  due to:org/apache/log4j/Appender
>  in classLoader:
> org.apache.geronimo.hook.**equinox.GeronimoClassLoader@**3c982419
> java.lang.**NoClassDefFoundError: Could not fully load class:
> com.myapp.MyFilter
>  due to:org/apache/log4j/Appender
>  in classLoader:
>
>
> I also tried adding
>
> <sys:import-package>!org.**apache.log4j.*</sys:import-**package>
>
> in geronimo-web.xml (while having the log4j jar in place in the war), but
> this didn't help as ClassNotFoundException repeated.
>
>
> Any suggestions how to resolve this?
>
> Cheers,
> Juho Autio
>



-- 
Ivan

Mime
View raw message