Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Cannot view Tomcat/JSP example source Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Cannot view Tomcat/JSP example source" Watch "Cannot view Tomcat/JSP example source" New topic
Author

Cannot view Tomcat/JSP example source

Ronald Whalen
Ranch Hand

Joined: Mar 27, 2001
Posts: 38
Hello everybody!
Small problem. Actually two that are probably inter-realted. I have Tomcat up and running but it only starts if I use the command "tomcat run". Any other variation will not work. Usually the startSErver error -- cannot find.
JSP's actually execute, but when I try to view the code through the browser (using pre-set Tomcat examples-Like NumberGuess) I get page not found error. I can find the pages and view the source in textpad but not through the hyperlink in the browser.
My env vars:
CLASSPATH= C:\WINNT\system32;C:\WINNT\System32\Wbem;C:\WINNT\Java\Classes\RxAssistant.zip;c:\ApacheGroup\tomcat\lib\ant.jar;c:\ApacheGroup\tomcat\lib\jasper.jar;c:\ApacheGroup\tomcat\lib\serv let.jar;c:\ApacheGroup\tomcat\lib\webserver.jar;c:\ApacheGroup\tomcat\lib\xml.jar
JAVA_HOME=c:\jdk1.3
PATH=c:\jdk1.3\bin
TOMCAT_HOME=c:\tomcat
These are set via start->settings->CP->system
Then I run a .bat that adds these for no real reason I believe. I was having so much trouble getting vars right that it works like this and I didn;t want to change anything unless told to do so by someone who knows that they are doing.
set JAVA_HOME=C:\jdk1.3
set TOMCAT_HOME=C:\ApacheGroup\tomcat
set path=%path%;JAVA_HOME\bin;
set classpath=%classpath%;JAVA_HOME\lib\tools.jar;.;
OS: Win2000
I hope someone can help me out with this.
Thanks!
Ronald

[This message has been edited by Ronald Whalen (edited April 03, 2001).]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
You should be seeing some kind of error message in the Tomcat console window. Normally if a JSP fails after creating a page it is because tools.jar is missing and the JVM can't compile the page to a class file.
Bill
Ronald Whalen
Ranch Hand

Joined: Mar 27, 2001
Posts: 38
Bill,
I have the JAVA_HOME\lib\tools.jar in my classpath, if that is what you were referring to.
I copied this error message from the tomcat .log when I tried to view the source of the JSP through the browser window:Context

log: path="" Socket Exception/index.html
Context log: path="/examples" Socket Exception/examples/jsp/index.html
Context log: path="/examples" Error in jsp service() : Invalid JSP file /jsp/num/numguess.jsp
javax.servlet.ServletException: Invalid JSP file /jsp/num/numguess.jsp
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)
at jsp._0002fjsp_0002fsource_0002ejspsource_jsp_0._jspService(_0002fjsp_0002fsource_0002ejspsource_jsp_0.java:86)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:484)
Context log: path="/examples" <b>Internal Servlet Error:</b><br>
<pre>
javax.servlet.ServletException: Invalid JSP file /jsp/num/numguess.jsp
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)
at jsp._0002fjsp_0002fsource_0002ejspsource_jsp_0._jspService(_0002fjsp_0002fsource_0002ejspsource_jsp_0.java:86)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:484)
</pre>
<b>Root cause:</b>
<pre>
javax.servlet.jsp.JspTagException: Invalid JSP file /jsp/num/numguess.jsp
at examples.ShowSource.doEndTag(ShowSource.java:26)
at jsp._0002fjsp_0002fsource_0002ejspsource_jsp_0._jspService(_0002fjsp_0002fsource_0002ejspsource_jsp_0.java:76)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:484)
</pre>
Ronald
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot view Tomcat/JSP example source