• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RequestDispatcher forward and Unable to compile class

 
Jerry Mcguire
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

My new guy has created a small prototype webapp for us which runs on his notebook with Tomcat6 and SunJDK. The 'jar' is then deployed to our machine with Tomcat5.5 and OpenJDK, which doesn't look good.

The web browser reports an HTTP Status 500 saying 'Unable to compile class for JSP...'


When I trace the java source code, I find that the exception is generated from the following line:


The CLASSPATH and java version:


What are we missing and how to make it work just like on the the new guy's machine? Please help. Thanks.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What can't be compiled is a JSP page, not a servlet. Which page are you trying to access when the error occurs? That's where you need to look for the problem.
 
Jerry Mcguire
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying...

The URL in the web browser that display the error is
http://localhost:8080/myproj/do

Line number 09. of the MainServlet says 'url' is "/myproj/home.jsp", and which we intend to mean $TOMCAT_HOME/webapps/myproj/home.jsp

$ cat web.xml :
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jerry,

Since your url-pattern is /do/*,

try sending the request like,
 
amit punekar
Ranch Hand
Posts: 544
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
"home.jsp" is the place where the compilation error is coming.
You will need to debug that to resolve the problem.
Check what is happening in the "home.jsp" and let us know.


regards,
amit
 
Jerry Mcguire
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same error screen with do/abc do/something ... any specific action should follow do/?

I confess that I'm completely new to java, javascripts... had only done some helloworld with JSP before.
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jerry,

Could you please send complete source code of "MainServlet" and your jsp?
 
Jerry Mcguire
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hold on a second...

following amit punkar's advice...
By removing the following import in the home.jsp, everything suddenly shows up. I haven't verified the functionalities of the content yet, but it's progress.



What is wrong with this line?
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think 'Session' is not a class here. I think this causes the problem
 
Jerry Mcguire
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you amit punekar and Chinmaya Chowdary.

I find hope today!
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
"org.apache.catalina.Session" is an internal Tomcat API.
Why you needed to import that?
Anyway its good that your problem is resolved.

Regds,
amit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic