Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 16th, 2009, 02:47 AM
Registered User
 
Join Date: Jan 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default CLASS_PATH problem

hi everyone
i have jdk1.6.0_11 installed in /usr/java/jdk1.6.0_11
and tomcat in /opt/apache-tomcat-5.5.27
OS Linux(Fedora 10)
to set CLASS_PATH, i added these lines to my /etc/profile :
export CATALINA_HOME=/opt/apache-tomcat-5.5.27
export CLASS_PATH=$CLASS_PATH:/opt/apache-tomcat-5.5.27/common/lib/servlet-api.jar
export CLASS_PATH=$CLASS_PATH:/opt/apache-tomcat-5.5.27/common/lib/mysql-connector-java-5.1.7-bin.jar
export JAVA_HOME=/usr/java/jdk1.6.0_11
my problem is this:
when i tried to browse jsp files other than given with tomcat itself
it gives error :
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:3: Package javax.servlet not found in import.
import javax.servlet.*;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:4: Package javax.servlet.http not found in import.
import javax.servlet.http.*;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:5: Package javax.servlet.jsp not found in import.
import javax.servlet.jsp.*;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:6: Package javax.servlet.jsp.tagext not found in import.
import javax.servlet.jsp.tagext.*;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:12 : Package org.apache.jasper.runtime not found in import.
import org.apache.jasper.runtime.*;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:14 : Class org.apache.jasper.JasperException not found in import.
import org.apache.jasper.JasperException;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:19 : Package com.Yasna.forum not found in import.
com.Yasna.forum.*;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:21 : Package com.Yasna.forum.util not found in import.
com.Yasna.forum.util.*;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:23 : Package com.Yasna.forum.util.tree not found in import.
com.Yasna.forum.util.tree.*;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:25 : Package com.Yasna.forum.util.admin not found in import.
com.Yasna.forum.util.admin.*;
^
/opt/apache-tomcat-5.5.27/work/Catalina/localhost/yazd/_0002fadmin_0002findex_0002ejspindex_jsp_0.java:28 : Superclass admin.HttpJspBase of class admin._0002fadmin_0002findex_0002ejspindex_jsp_0 not found.
public class _0002fadmin_0002findex_0002ejspindex_jsp_0 extends HttpJspBase {
^
11 errors, 1 warning

org.apache.jasper.compiler.Compiler.compile(Compil er.java:254)
org.apache.jasper.servlet.JspServlet.doLoadJSP(Jsp Servlet.java:462)
org.apache.jasper.servlet.JasperLoader12.loadJSP(J asperLoader12.java:146)
org.apache.jasper.servlet.JspServlet.loadJSP(JspSe rvlet.java:433)
org.apache.jasper.servlet.JspServlet$JspServletWra pper.loadIfNecessary(JspServlet.java:152)
org.apache.jasper.servlet.JspServlet$JspServletWra pper.service(JspServlet.java:164)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:318)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:391)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
this ( i think) indicates wrong setting of CLASS_PATH to servlet-api.jar which is /opt/apache-tomcat-5.5.27/common/lib/servlet-api.jar ( i am sure for this)
what could be the problem?
please help
 
Old February 17th, 2009, 06:40 PM
Authorized User
 
Join Date: Dec 2008
Posts: 50
Thanks: 1
Thanked 5 Times in 5 Posts
Default

copy the the jar file which contains javax package to the lib folder of your tomcat and restart.

I am 100% sure but i think it will help

Thanks









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.