Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

RequestDispatcher forward and Unable to compile class

 
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.
 
Rancher
Posts: 43016
76
  • 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 :
 
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jerry,

Since your url-pattern is /do/*,

try sending the request like,
 
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: 437
Oracle Java
  • 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: 437
Oracle Java
  • 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
 
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic