LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-16-2011, 01:56 AM   #1
Jerry Mcguire
Member
 
Registered: Jul 2009
Location: Hong Kong SAR
Distribution: RedHat, Fedora
Posts: 201

Rep: Reputation: 31
RequestDispatcher forword


Hi all,

I have a web app that generates an exception in the web browser:

Code:
exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

Stacktrace:
	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...
My trace to the java source code says the problem occurs at the following line:
Code:
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
    ...
    RequestDispatcher rd = sc.getRequestDispatcher(url);
    System.out.println("[DEBUG]" + url);
    if (rd != null)
        rd.forward(req, res);   // This line generates the exception
    else
        System.out.println("[DEBUG]rd is null");
}
Other information:
Code:
$ echo $CLASSPATH
.:/usr/share/tomcat5/common/lib:/usr/share/tomcat5/common/lib/servlet.jar
$ java -version
java version "1.6.0"
OpenJDK  Runtime Environment (build 1.6.0-b09)
OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)
Can anyone tell me what I have done wrong? How to make it work? Please.

btw, the same app works in Tomcat6 with SunJDK. I'm using Tomcat5.5 and OpenJDK.

Thanks.
 
Old 03-16-2011, 04:17 AM   #2
Jerry Mcguire
Member
 
Registered: Jul 2009
Location: Hong Kong SAR
Distribution: RedHat, Fedora
Posts: 201

Original Poster
Rep: Reputation: 31
Thanks for viewing.

The problem is solved with the advice from amit punekar and friends from
JavaRanch
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How I can to forword data through router? MMaghraby Linux - Networking 6 10-26-2008 06:30 AM
How I can to forword data through router? MMaghraby Linux - Security 1 10-21-2008 07:12 AM
How I can to forword data through router? MMaghraby Linux - Server 1 10-21-2008 07:10 AM
How I can to forword data through router? MMaghraby Linux - Networking 1 10-21-2008 07:10 AM
ip forword not working FNC Linux - Networking 4 07-12-2007 06:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration