aspose file tools*
The moose likes Servlets and the fly likes Where to place a JSP file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Where to place a JSP file" Watch "Where to place a JSP file" New topic
Author

Where to place a JSP file

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, I was wondering in which directory should I place the JSP file. I put it in the same directory as the html files and web-inf folder. But tomcat can not find it. Can anyone please help me?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
JSP files go in with the normal HTML files. See the Tomcat examples. Why do you think Tomcat didn't find the JSP? There are other reasons for failing to deliver the page, typically not being able to find tools.jar
Bill

------------------
author of:
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Thank you Bill. The last time tomcat seemed to have found it. Only it says:
Error: 500
Location: /wroxPJSPch04/JSPDeclaration.jsp
Internal Servlet Error:
javax.servlet.ServletException: sun/tools/javac/Main
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
Root cause:
java.lang.NoClassDefFoundError: sun/tools/javac/Main
at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:245)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

I see that the root cause is "java.lang.NoClassDefFoundError: sun/tools/javac/Main". Is that the tool.jar? How can I fix this?

Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
yes, that is tools.jar that is not being found. %JAVA_HOME% and %TOMCAT_HOME% must be set correctly. Copying tools.jar to %TOMCAT_HOME% can also be a good idea.

42
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where to place a JSP file