geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevan Miller <kevan.mil...@gmail.com>
Subject Re: [jira] Updated: (GERONIMO-518) Deploying Struts app fails on Logging ClassCastException
Date Tue, 27 Sep 2005 16:45:06 GMT
Good point. I didn't notice that they were including Commons in their
WEB-INF/lib. I think this is related to the context-priority-classloader
discussion I brought up last week.

Section 9.7.2 of the Servlet spec specifies that for a J2EE product "The
container should not allow applications to override or access the
container's implementation classes". Depending on your definition of
"implementation classes", Geronimo's servlet classloaders permit a number of
"implementation classes" (including commons-logging) to be loaded from the
web app's context. As this situation points out, this can lead to a number
of problems.

>From my previous note, here's the current list of restrictions for each
ClassLoader.

TomcatClassLoader:
java, javax, org/apache/geronimo, org/apache/jasper, org/apache/tomcat,
org/apache/naming, org/apache/catalina, org/xml, org/w3c

JettyClassLoader:
java, javax, org/apache/geronimo, org/mortbay, org/xml, org/w3c

Seems like we need to make a concerted effort to identify the Geronimo
implementation" classes and prevent them from being loaded from a servlet's
context...

One meta-question -- I note that Jeff has moved this from a "Jira"
discussion to a "dev" discussion (which I've maintained). What's the
process, here? After consensus is reached in "dev", is that then captured in
the Jira?

--kevan

On 9/27/05, Jeff Genender <genj1@sun.savoirtech.com> wrote:
>
> I am not convinced this is a bug. Commons Logging in a web app with its
> own jar can have conflicts with the app server's version. This is a
> common problem with many app servers...including JBoss.
>
> I recommend this person remove the commons logging jar from the web/lib
> directory, and see if it works.
>
> > [ http://issues.apache.org/jira/browse/GERONIMO-518?page=all ]
> >
> > Aaron Mulder updated GERONIMO-518:
> > ----------------------------------
> >
> > Fix Version: 1.0-M5
> > (was: 1.0)
> >
> > Reported to still be a problem in M4. We really need to resolve this as
> > "all web apps work except Struts" is not a very good story.
> >
> > java.lang.ClassCastException
> > at org.apache.commons.logging.LogFactory.newFactory
> > (LogFactory.java:497)
> > at org.apache.commons.logging.LogFactory.getFactory
> > (LogFactory.java:272)
> > at org.apache.commons.logging.LogFactory.getLog
> > (LogFactory.java:381)
> > at
> > org.apache.struts.action.ActionServlet.<init>(ActionServlet.java:331)
> >
> > Caused by: java.lang.ClassCastException
> > at org.apache.commons.logging.LogFactory.newFactory
> > (LogFactory.java:495)
> >
> >> Deploying Struts app fails on Logging ClassCastException
> >> --------------------------------------------------------
> >>
> >> Key: GERONIMO-518
> >> URL: http://issues.apache.org/jira/browse/GERONIMO-518
> >> Project: Geronimo
> >> Type: Bug
> >> Components: core, web
> >> Reporter: Aaron Mulder
> >> Assignee: Aaron Mulder
> >> Priority: Critical
> >> Fix For: 1.0-M5
> >
> >>
> >> Deploying a web app based on Struts results in the ClassCastException
> in
> >> commons logging displayed below. The web app includes a version of
> >> commons-logging in its WEB-INF/lib. The same web app can be
> >> successfully deployed in Tomcat 5.0.25 with no problems.
> >> Exception in thread "Thread-4" java.lang.ExceptionInInitializerError
> >> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> >> Method)
> >> at
> >> sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:39)
> >> at
> >> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:27)
> >> at
> >> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> >> at java.lang.Class.newInstance0(Class.java:350)
> >> at java.lang.Class.newInstance(Class.java:303)
> >> at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:199)
> >> at
> >> org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:240)
> >> at
> >> org.mortbay.jetty.servlet.ServletHandler.initializeServlets(
> ServletHandler.java:447)
> >> at
> >> org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(
> WebApplicationHandler.java:298)
> >> at
> >> org.mortbay.jetty.servlet.WebApplicationContext.doStart(
> WebApplicationContext.java:512)
> >> at
> >> org.apache.geronimo.jetty.JettyWebAppContext.doStart(
> JettyWebAppContext.java:244)
> >> ...
> >> Caused by: org.apache.commons.logging.LogConfigurationException:
> >> java.lang.ClassCastException:
> >> org.apache.geronimo.kernel.log.GeronimoLogFactory
> >> at
> >> org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609)
> >> at java.security.AccessController.doPrivileged(Native Method)
> >> at
> >> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)
> >> at
> >> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:298)
> >> at
> >> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
> >> at
> >> org.apache.struts.action.ActionServlet.<clinit>(ActionServlet.java:375)
> >> ... 67 more
> >> Caused by: java.lang.ClassCastException:
> >> org.apache.geronimo.kernel.log.GeronimoLogFactory
> >> at
> >> org.apache.commons.logging.LogFactory$2.run(LogFactory.java:571)
> >> ... 72 more
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > If you think it was sent incorrectly contact one of the administrators:
> > http://issues.apache.org/jira/secure/Administrators.jspa
> > -
> > For more information on JIRA, see:
> > http://www.atlassian.com/software/jira
> >
>
>

Mime
View raw message