'Package does not exist' and 'cannot resolve symbol' woes

2003-07-18 Thread mnewby
Greetings, oh most gracious and knowledgable tomcat-users community.

I'm hopeful someone(s) of you can shed some light on our problem.  We're
encountering a 'Package does not exist' and 'cannot resolve symbol' errors
when attempting to load some JSP pages.  This error appears to be one that's
been discussed at length on this group.  I've reviewed many of the postings,
and have tweaked our files in accordance with what I saw in the responses,
but without success so far.

I'll try to present our configuration as concisely as I can, while still
including enough information for someone to ascertain what's wrong.  Below
this short discussion of our problem, I've included the following pieces of
information:

o  Configuration notes
o  Error message snippet displayed in the browser
o  Offending JSP portion
o  Contents of the nexlbundle.jar file

The part that's got me stumped is that I've got multiple copies of the
com.nexl.dmgr.DashboardUnmarshaller class and other com.nexl classes in
places I think Tomcat should be looking to find them, yet it's still unable
to find the package.  The .java and compiled .class files are in
/home/msdadm/htdocs/WEB-INF/classes/com/nexl/dmgr/, as well as in the
nexlbundle.jar file in /home/msdadm/htdocs/WEB-INF/classes/lib/, and
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/lib/.  As you can see from
the classpath listed in the error message below, all three of these
directories are on the classpath.

One other note, a trivial JSP page such as:

  2 + 2 = %= 2 + 2%

compiles and displays properly.  It's just when you go including customized
classes to make a useful page that things break down...  :-)

Thanks for reading, and hope you can help us!

-matt

--

Configuration notes

o  I generally followed PixelFreak's HOWTO to get the system set up.
   - http://www.pixelfreak.net/howto/apache2_jk2_tomcat/socket.html
o  We're running Apache 2.0.47, Tomcat 4.1.24/LE, and jk2 2.0.2, currently
on a Mandrake Linux 9.1 system (this is merely a test-bed, and we'll be
moving to Redhat later on).
o  I pulled down the Tomcat binaries, built the Apache from source, then
built the jk2 from source so it matches up with the minor version of Apache.
o  Tomcat's server.xml points the localhost appBase at /home/msdadm/htdocs.

I'm not sure what else might be helpful to put here.

--

Error message snippet displayed in the browser

The error message we're getting is (I edited the -classpath string to put
carriage returns after the ':' to make the classpath a little easier to
read):

type Exception report

message 

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception 

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

An error occurred at line: 11 in the jsp file: /dashboardTree.jsp

Generated servlet error:
Project base dir set to: /usr/local/tomcat
Detected Java version: 1.4 in: /usr/local/j2sdk1.4.2/jre
Detected OS: Linux
[javac] dashboardTree_jsp.java added as
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/work/Standalone/localhost/_/dashbo
ardTree_jsp.class doesn't exist.
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Using external javac compiler
[javac] Since fork is true, ignoring compiler setting.
[javac] Compilation arguments:
[javac] '-classpath'
[javac] '/usr/local/java/lib/tools.jar:
 /usr/local/tomcat/bin/bootstrap.jar:
 /home/msdadm/htdocs/WEB-INF/classes:
 /home/msdadm/htdocs/WEB-INF/lib/dom.jar:
 /home/msdadm/htdocs/WEB-INF/lib/jaxp.jar:
 /home/msdadm/htdocs/WEB-INF/lib/jcommon-0.7.2.jar:
 /home/msdadm/htdocs/WEB-INF/lib/jfreechart-0.9.6.jar:
 /home/msdadm/htdocs/WEB-INF/lib/nexlbundle.jar:
 /home/msdadm/htdocs/WEB-INF/lib/rrdj.jar:
 /home/msdadm/htdocs/WEB-INF/lib/sax.jar:
 /usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/classes:
 /usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/lib/sax.jar:
 /usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/lib/rrdj.jar:
 
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/lib/jfreechart-0.9.6.jar:
 
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/lib/jcommon-0.7.2.jar:
 /usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/lib/jaxp.jar:
 /usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/lib/dom.jar:
 
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/lib/nexlbundle.jar:
 /usr/local/jakarta-tomcat-4.1.24-LE-jdk14/common/classes:
 
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/common/lib/servlet.jar:
 
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/common/lib/commons-logging-api.jar
:
 
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/common/lib/commons-collections.jar
:
 
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/common/lib/jasper-compiler.jar:
 
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/common/lib/naming-factory.jar:
 

RE: 'Package does not exist' and 'cannot resolve symbol' woes

2003-07-18 Thread Shapira, Yoav

Howdy,
Let's get back to basics to simplify things:

- Do a clean installation of tomcat to a new location.  Don't install
Apache, don't connect to the existing apache, leave it standalone
tomcat.

The part that's got me stumped is that I've got multiple copies of the
com.nexl.dmgr.DashboardUnmarshaller class and other com.nexl classes in
places I think Tomcat should be looking to find them, yet it's still
unable
to find the package.  The .java and compiled .class files are in
/home/msdadm/htdocs/WEB-INF/classes/com/nexl/dmgr/, as well as in the
nexlbundle.jar file in /home/msdadm/htdocs/WEB-INF/classes/lib/, and
/usr/local/jakarta-tomcat-4.1.24-LE-jdk14/shared/lib/.  As you can see
from
the classpath listed in the error message below, all three of these
directories are on the classpath.

WEB-INF/classes/lib is not a correct location for anything except
classes whose package is lib (a rare but valid use-case: not your use
case).

Remove the nexlbundle.jar from shared/lib.  Remove the lib directory and
its contents under WEB-INF/classes.  Remove the unpacked classes and
java files from WEB-INF/classes.  Put only the nexlbundle.jar file in
WEB-INF/lib.

That will fix 98% of your problem.  The other 2% are:

jdk14/work/Standalone/localhost/_/dashbo
ardTree_jsp.class doesn't exist.

Clean out the work directory of your tomcat server and try again.

ardTree_jsp.java:14: package com.nexl does not exist
[javac] import com.nexl.*;

You do realize the nexlbundle.jar contains no com.next classes, right?
Only com.nexl.dmgr and com.nexl.xml classes.  You need to import those
packages if you want them.  Importing com.next.* does not import these
child packages.

After you get it to work standalone, you can add Apache back in and move
the nexlbundle.jar to the shared or common repository if you'd like.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]