Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Viewing JSP files  RSS feed

 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using tomcat 4.1.12. I am unable to view any JSP file in a browser (I keep getting ClassFormatError message).
Tomcat is installed properly. Also, there is absolutely no problem viewing any .html file.
Any feedback will be appreicated.
Thanks,
Saket
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Saket
Does it possibly have anything to do with your actual JSP code. Java throws a ClassFormatError when:
... the Java Virtual Machine attempts to read a class file and determines that the file is malformed or otherwise cannot be interpreted as a class file

Seems something may be amiss with the generated Servlet code.
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Mark.
The JSP code seems fine. Even if I change mines to a simple time displaying one, error message persists. Only now it is NullPointerException.
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saket
Can you post your JSP and deployment descriptor code?
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the late reply Mark. Here's a sample JSP code I am using for testing purpose only:
<html>
<head>
<title>
JSP Test
</title>
</head>
<body>
<h1> JSP Test </h1>
Time: <%= new java.util.Date() %>
</body>
</html>
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saket
I tried your code and it worked ok on Tomcat version 4.0.4.
I can only assume there must be something out of whack somewhere else. Do you have a deployment decriptor mapping for this JSP file? Have you made any changes to the Tomcat configuration files since initial installation? Are all your system path parameters set up correctly?
I'm just guessing here
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made several changes (in a go) to the following files:
serverl.xml
setclasspath.sh
.cshrc
I couldn't locate the exact source of my error but following the changes I made above, everything seems okay.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!