The moose likes JSP and the fly likes Bad Magic Number Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Bad Magic Number" Watch "Bad Magic Number" New topic
Author

Bad Magic Number

ndsk
Greenhorn

Joined: Mar 12, 2002
Posts: 1
I am getting a different error, when I run my jsp pages. I am using Jrun 3.0, jdk1.2.
This is the error I am getting.

500 Internal Server Error
/positive/structures.jsp:
javax.servlet.ServletException: jrun__positive__structures2ejsp18 (Bad magic number)
java.lang.ClassFormatError: jrun__positive__structures2ejsp18 (Bad magic number)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at allaire.jrun.servlet.JSPClassLoader.loadClass(../servlet/JSPClassLoader.java:82)
at java.lang.ClassLoader.loadClass(Unknown Source)
at allaire.jrun.servlet.JRunServletLoader.loadServletInstance(../servlet/JRunServletLoader.java:221)
at allaire.jrun.servlet.JRunServletLoader.loadServletInstance(../servlet/JRunServletLoader.java:190)
at allaire.jrun.servlet.JRunServletLoader.loadServlet(../servlet/JRunServletLoader.java:177)
at allaire.jrun.servlet.JRunSE.getServletReference(../servlet/JRunSE.java:1267)
at allaire.jrun.jsp.JSPServlet.loadServlet(../jsp/JSPServlet.java:241)
at allaire.jrun.jsp.JSPServlet.loadPage(../jsp/JSPServlet.java:181)
at allaire.jrun.jsp.JSPServlet.service(../jsp/JSPServlet.java:169)
at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(../ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(../WorkerThread.java:75)

This doesnot happen frequently. If I save the same file into some other name, It works very well.
How can I avoid this error? Please help me.
Thanks in advance,
sampath kumar.
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
ndsk,
JavaRanch has a Naming Policy Please read and change your display name.
Bad Magic number is usually caused by a bug in either the compiler or the classloader. Check with Allaire for an update that may address this problem. Basically every java class file needs to start with 0xCAFEBABE which is how the classloader knows that the file is indeed a Java class file. Additionally check to see what JDK is recommended. You probably should upgrade to 1.3.1.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
ricemouse
Greenhorn

Joined: Jul 01, 2002
Posts: 1
I encounter the same situation when I copy the class compiled in unix system to a nt system which are both jdk 1.2.2.
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Try this TechNote.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
"ricemouse"
Your name doesn't follow the javaranch guideliens on names. Please take a moment and change your "Publicly Displayed Name" by modifying your profile.
Thanks for your cooperation.
- madhav


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Tomer Libal
Greenhorn

Joined: Jan 26, 2003
Posts: 3
The compiled jsp have these bad "Magic Number" after recompiling jrun will not delete the jsp if no change was done in this file.
So try to delete the bad jrun class file.
these should sove your problem
 
IntelliJ Java IDE
 
subject: Bad Magic Number
 
Threads others viewed
using custom tags & tag handler class - URGENT
JSP NullPointerException in the next morning
Strange Jikes error
More JRun Install Problems
problem with struts1.1 please help me...
Two Laptop Bag

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture