This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Bad Magic Number  RSS feed

 
ndsk
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ricemouse
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this TechNote.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Tomer Libal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!