incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harry Metske" <harry.met...@gmail.com>
Subject Re: jsp's cannot find class from JSPWiki.jar
Date Wed, 26 Nov 2008 20:38:56 GMT
Can't find evidence of duplicaties, I ran tomcat with -verbose:class and
then I see it coming from just 1 jar:

metskem@bismarck:/tmp$ grep org.apache.jspwiki.log catalina.out
javax.servlet.ServletException: java.lang.NoClassDefFoundError:
org/apache/jspwiki/log/LoggerFactory
Caused by: java.lang.NoClassDefFoundError:
org/apache/jspwiki/log/LoggerFactory
Caused by: java.lang.ClassNotFoundException:
org.apache.jspwiki.log.LoggerFactory
javax.servlet.ServletException: java.lang.NoClassDefFoundError:
org/apache/jspwiki/log/LoggerFactory
Caused by: java.lang.NoClassDefFoundError:
org/apache/jspwiki/log/LoggerFactory
[Loaded org.apache.jspwiki.log.LoggerFactory from
file:/usr/local/tomcat/webapps/JSPWiki/WEB-INF/lib/JSPWiki.jar]
[Loaded org.apache.jspwiki.log.LoggerInterface from
file:/usr/local/tomcat/webapps/JSPWiki/WEB-INF/lib/JSPWiki.jar]
[Loaded org.apache.jspwiki.log.Logger from
file:/usr/local/tomcat/webapps/JSPWiki/WEB-INF/lib/JSPWiki.jar]

And also, I'm getting the same NoClassDefFoundError running the web-tests,
so it is not Tomcat specific.

I had been thinking about Logger.getLogger versus LoggerFactory.getLogger
too. I found it more logical to name the class LoggerFactory.
The code changes are not that dramatic (sed has done it already)

regards,
Harry

2008/11/26 Janne Jalkanen <Janne.Jalkanen@ecyrd.com>

>
> Check that you don't accidentally have an older JAR file anywhere in your
> classpath; that's what usually gets me :-)
>
> BTW, would it be better to name the class as "Logger" just so that we don't
> have to do any changes except an import change?
>
> /Janne
>
>
> On Nov 26, 2008, at 20:41 , Harry Metske wrote:
>
>  Hi devs,
>>
>> this must be a stupid error, but I don't see it.
>> I'm working on https://issues.apache.org/jira/browse/JSPWIKI-376 (move
>> from
>> log4j to slf4j), and created a few classes in package
>> org.apache.jspwiki.log
>> Starting up JSPWiki shows that the LoggerFactory in this package is
>> invoked
>> about 75 times by JSPWiki classes requesting loggers.
>> However, when I call the first jsp (Wiki.jsp), which has
>> org.apache.jspwiki.log.LoggerFactory imported, I get this
>> NoClassDefFoundError.
>> Strange, the JSP does compile ! (?)
>> Same results with other JSP's.
>> The class resides in JSPWiki.jar.
>> Why can the other jspwiki classes find this LoggerFactory, but JSP's can't
>> ?
>> HTTP Status 500 -
>> ------------------------------
>>
>> *type* Exception report
>>
>> *message*
>>
>> *description* *The server encountered an internal error () that prevented
>> it
>> from fulfilling this request.*
>>
>> *exception*
>>
>> javax.servlet.ServletException: java.lang.NoClassDefFoundError:
>> org/apache/jspwiki/log/LoggerFactory
>>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274)
>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>>  com.ecyrd.jspwiki.ui.WikiServletFilter.doFilter(WikiServletFilter.java:175)
>>        com.ecyrd.jspwiki.ui.WikiJSPFilter.doFilter(WikiJSPFilter.java:111)
>>
>> *root cause*
>>
>> java.lang.NoClassDefFoundError: org/apache/jspwiki/log/LoggerFactory
>>        org.apache.jsp.Wiki_jsp.<init>(Wiki_jsp.java:15)
>>        sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>
>>  sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>>
>>  sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>        java.lang.reflect.Constructor.newInstance(Constructor.java:532)
>>        java.lang.Class.newInstance0(Class.java:372)
>>        java.lang.Class.newInstance(Class.java:325)
>>
>>  org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:145)
>>
>>  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
>>
>>  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>>  com.ecyrd.jspwiki.ui.WikiServletFilter.doFilter(WikiServletFilter.java:175)
>>        com.ecyrd.jspwiki.ui.WikiJSPFilter.doFilter(WikiJSPFilter.java:111)
>>
>> *root cause*
>>
>> java.lang.ClassNotFoundException: org.apache.jspwiki.log.LoggerFactory
>>        java.net.URLClassLoader$1.run(URLClassLoader.java:217)
>>        java.security.AccessController.doPrivileged(Native Method)
>>        java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>>
>>  org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
>>
>>  org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
>>        java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
>>        org.apache.jsp.Wiki_jsp.<init>(Wiki_jsp.java:15)
>>        sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>
>>  sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>>
>>  sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>        java.lang.reflect.Constructor.newInstance(Constructor.java:532)
>>        java.lang.Class.newInstance0(Class.java:372)
>>        java.lang.Class.newInstance(Class.java:325)
>>
>>  org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:145)
>>
>>  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
>>
>>  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>>  com.ecyrd.jspwiki.ui.WikiServletFilter.doFilter(WikiServletFilter.java:175)
>>        com.ecyrd.jspwiki.ui.WikiJSPFilter.doFilter(WikiJSPFilter.java:111)
>>
>> *note* *The full stack trace of the root cause is available in the Apache
>> Tomcat/6.0.16 logs.*
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message