Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Weird Tomcat and Servlet problem.

7 views
Skip to first unread message

Somebody

unread,
Mar 26, 2001, 9:18:24 PM3/26/01
to
Hi, I get this exception once in a while from Tomcat while trying to
run my servlet. What does the first 6 lines of this message mean?
Sometimes a System.out.println("Hello") fixes the problem which makes
it even more intriguing. But then it comes back when I recompile the
code at a later time. Anybody recognize any of these? I can send you
my code :(.

java.lang.ClassFormatError: c391_project/MSTnotes (Illegal constant
pool type)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass0(Compiled Code)
at java.lang.ClassLoader.defineClass(Compiled Code)
at
org.apache.tomcat.loader.AdaptiveClassLoader12.doDefineClass(AdaptiveC
lassLoader12.java:93)
at
org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(Compiled Code)
at
org.apache.tomcat.loader.AdaptiveServletLoader.loadClass(AdaptiveServl
etLoader.java:174)
at
org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:
265)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.j
ava:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection
(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled
Code)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)
2001-03-26 07:07:04 - Ctx( /melvin ): Exception in init null -
java.lang.NullPointerException
at java.lang.ClassLoader.resolveClass0(Native Method)
at java.lang.ClassLoader.resolveClass0(Compiled Code)
at java.lang.ClassLoader.resolveClass(Compiled Code)
at
org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(Compiled Code)
at
org.apache.tomcat.loader.AdaptiveServletLoader.loadClass(AdaptiveServl
etLoader.java:174)
at
org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:
265)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.j
ava:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection
(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled
Code)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)

2001-03-26 07:07:04 - Ctx( /melvin ): Exception in: R( /melvin +
/servlet/c391_project.MSTnotes + null) -
java.lang.NullPointerException
at java.lang.ClassLoader.resolveClass0(Native Method)
at java.lang.ClassLoader.resolveClass0(Compiled Code)
at java.lang.ClassLoader.resolveClass(Compiled Code)
at
org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(Compiled Code)
at
org.apache.tomcat.loader.AdaptiveServletLoader.loadClass(AdaptiveServl
etLoader.java:174)
at
org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:
265)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.j
ava:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection
(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled
Code)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)


Jon Skeet

unread,
Mar 27, 2001, 2:32:45 AM3/27/01
to
Somebody <mt...@hotmail.com> wrote:
> Hi, I get this exception once in a while from Tomcat while trying to
> run my servlet. What does the first 6 lines of this message mean?
> Sometimes a System.out.println("Hello") fixes the problem which makes
> it even more intriguing. But then it comes back when I recompile the
> code at a later time. Anybody recognize any of these? I can send you
> my code :(.

Are you compiling on the same system that you're running? It looks like
it could be a file transfer problem.

Alternatively, which compiler are you using? If it's not a standard one
(eg jikes or javac) I suggest you try one of those.

--
Jon Skeet - sk...@pobox.com
http://www.pobox.com/~skeet

Somebody

unread,
Mar 29, 2001, 1:38:14 AM3/29/01
to
Actually, I'm compiling on my own machine. However, when I compiled it
on the running machine, the same problem came up. Shouldn't java be
platform independent? I'm running the servlet on a Solaris station
using J2EE.

"Jon Skeet" <sk...@pobox.com> wrote in message
news:MPG.152a527c...@10.1.1.51...

Jon Skeet

unread,
Mar 29, 2001, 2:05:29 AM3/29/01
to
Somebody <mt...@hotmail.com> wrote:
> Actually, I'm compiling on my own machine. However, when I compiled it
> on the running machine, the same problem came up. Shouldn't java be
> platform independent? I'm running the servlet on a Solaris station
> using J2EE.

Yes, Java should be platform independent - but that doesn't stop
bytecodes from getting screwed up by being transferred with ftp in ascii
mode, which is one of the more common ways of getting a dodgy class
file.

kelvekar

unread,
Mar 29, 2001, 2:50:43 AM3/29/01
to
I think, its problem with the version ur tomcat is using and
the version u r using to compile servlets, check them out using
java -version command...

Jon Skeet

unread,
Mar 29, 2001, 3:14:48 AM3/29/01
to

How could that give a corrupt class file? I've *never* seen this, and
the OP says he's tried compiling on the same box he's running on (and
thus presumably using the same version of Java).

kelvekar

unread,
Mar 29, 2001, 3:18:35 AM3/29/01
to
I think i have a solution, is it that u are using character set
other than the default of ur system? If so, compile your class
files using -encoding flag, that should solve the problem...

Another possibility is -
If u compile using jdk1.2.x and try it on tomcat, which may be
using 1.1.x, u could face this problem. It is possible that
tomcat is using an older version of java.

Hope this helps.

Jon Skeet

unread,
Mar 29, 2001, 3:47:04 AM3/29/01
to
kelvekar <kelvekar...@sun.partner.remarq.com.invalid> wrote:
> I think i have a solution, is it that u are using character set
> other than the default of ur system? If so, compile your class
> files using -encoding flag, that should solve the problem...

That *could* be it, although I'd have thought the compiler would
complain - if the compiler is generating invalid class files, for
*whatever* reason, it's a serious bug.



> Another possibility is -
> If u compile using jdk1.2.x and try it on tomcat, which may be
> using 1.1.x, u could face this problem. It is possible that
> tomcat is using an older version of java.

I'd hope not, but that's a possibility. I didn't think JDK1.2 would
generate invalid classfiles for 1.1 unless you specifically asked it to
though...

Simon Brooke

unread,
Mar 31, 2001, 4:31:50 AM3/31/01
to
on Thursday 29 March 2001 09:14, Jon Skeet wrote:

> the OP says he's tried compiling on the same box he's running on (and
> thus presumably using the same version of Java).

That doesn't prove anything. I have five different JVMs on this box,
for testing purposes...

--
si...@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/

-- mens vacua in medio vacuo --

0 new messages