Re: Servlets work, but JSP doesn't...

2001-03-29 Thread John Clark L. Naldoza

 Jason,

 You have to have JAVA_HOME environment variable defined so that jasper is
 able to find the compiler in order to compile the jsp.

 ~larry


i.e.

inside your tomcat.sh file have the following entries...

TOMCAT_HOME=/tmp/jakarta-tomcat # or wherever..;-)

JAVA_HOME=/opt/jdk1.2.2 # Depends on where your JDK is installed...

CP=$TOMCAT_HOME/classes:$TOMCAT_HOME/lib/ant.jar:$TOMCAT_HOME/lib/xml.jar
CP=$CP:$TOMCAT_HOME/lib/jasper.jar:$TOMCAT_HOME/lib/servlet.jar:$TOMCAT_HOME
/lib/parser.jar
CP=$CP:$TOMCAT_HOME/lib/webserver.jar:$TOMCAT_HOME/lib/jaxp.jar:/opt/jdk1.2.
2/lib/tools.jar

CLASSPATH=$CP:$CLASSPATH

would also work..;-)


Cheers,


John Clark




RE: Servlets work, but JSP doesn't...

2001-03-28 Thread Stefán F. Stefánsson

Your problem is because the tools.jar is not in the classpath.  This
file is located in the lib subdirectory of your jdk home.  One way of
letting Tomcat know where the file is would be to put it in your
classpath but what you can also do is set the JAVA_HOME variable to
point to the jdk directory (note: the jdk root directory... not the lib
directory under the jdk root directory).  That way Tomcat can figure out
where to find the tools.jar file.

-Original Message-
From: Jason Wells [mailto:[EMAIL PROTECTED]]
Sent: 29. mars 2001 01:11
To: [EMAIL PROTECTED]
Subject: Servlets work, but JSP doesn't...


Hi there,

I have created a context called /stest and I am able to execute
servlets, e.g. /stest/servlet/SomeServlet, from this context. However I
am unable to execute JSP pages, e.g. /stest/SomePage.jsp, from this
context. I get the following 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.jav
a:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnec
tion(Ajp13ConnectionHandler.java:160)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416
)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:49
8)
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(J
spServlet.java:152)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
t.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.jav
a:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnec
tion(Ajp13ConnectionHandler.java:160)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416
)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:49
8)
at java.lang.Thread.run(Thread.java:484)

This is my configuration:
- Apache 1.3.19
- Tomcat 3.2.1
- JBoss 2.1
- Red Hat Linux 6.2
- Sun JVM 1.3

Maybe something vital is missing from my classpath, but I have no idea
what it could be. Or maybe the JSP has to be in a particular location
within the context, though I find no mention of that in the Tomcat docs
or the Servlet 2.2 spec. Any help is appreciated. Thanks in advance.
-- 
Jason Wells
Web Architect
Xsilogy, Inc.
http://www.xsilogy.com/