Jake is right about "server/lib". Sorry - mental lapse on my part.... I
meant common/lib. Thanks for catching that.

The XML/DOM packages comes with J2SDK 1.3.1 EE
(http://java.sun.com/j2ee/sdk_1.3/techdocs/api/index.html) but is now
bundled with the J2SDK 1.4.x SE. I was implicitly assuming EE since Cecil
mentioned the JSDK (servlet) 2.1, which is part of the complete EE distro.
My assumption is that JSDK SE 1.4.x is not in the picture since TC would
have found the XML/DOM packages during runtime. Clearly, using 1.4.x would
be a good (and recommended) solution.

So ultimately, yes, Xerxes is the issue at hand, and Cecil needs to resolve
classpath issues.

Greg

-----Original Message-----
From: Jacob Kjome [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 3:32 PM
To: Tomcat Users List
Subject: Re[2]: REPOST: Document.importNode not working-works fine in
modified JSDK2.1


Hello Greg,

The advice below to store your application accessible classes in
$TOMCAT_HOME/server/lib/ is bad information.  That will only be seen
by Tomcat itself.  If you want both Tomcat and apps to see your
library, you need to store that in $TOMCAT_HOME/common/lib or in
$TOMCAT_HOME/lib (analogous to $TOMCAT_HOME/shared/lib in Tomcat 4.1.x) for
just your apps and not Tomcat to see it.

What JDK are you using?  XML/DOM libraries did not come with JDK1.3.x,
but do come with j2sdk1.4.x.

If you are using anything less than JDK1.4.x, you need to make sure to
put something like Xerces in a directory accessible to Tomcat's
classloaders.  With Tomcat-3.3.x, you need to put it in either
$TOMCAT_HOME/lib/apps or $TOMCAT_HOME/lib/common.

Get out of the habit of putting any XML/DOM libraries in your own
app's WEB-INF/lib directory.  It is forbidden by the Sun classloading
spec to do this (see their spec for details) and Tomcat-4.0.2+
enforces this.

Jake

Monday, July 29, 2002, 8:26:16 AM, you wrote:

GW> Document.importNode not working-works fine in modified JSDK2.1Yes
indeed, the <PROJECT>/WEB-INF/lib is where you place app specific JARs.

GW> But your problem is dealing with XML and JSDK 2.1... the JSDK does not
contain the "org.w3c" package. You probably know this already, but here's
the javadoc link for the JSDK 2.2... the 2.1 is
GW> offline now, since 2.3 is the standard.
GW> http://java.sun.com/products/servlet/2.2/javadoc/index.html

GW> The 1.3.x J2EE complete JAR does... but the older versions did not.

GW> So, the questions therefore, are....
GW> 1. What is your "compile-time" classpath... Where is the compiler
finding org.w3c.dom / org.xml.sax ?
GW> 2. What is your "run-time classpath".
GW> 3. If # 1 and # 2 are different, do you also have servlet spec
differences? ( 2.1 vs. 2.2 or 2.3 )

GW> I think the long and short of it will be that you need to add the
"org.w3c.dom" and "org.xml.sax" packages to the $TOMCAT_HOME/server/lib/ or
to your $PROJECT/WEB-INF/lib/




GW> [Greg Waehner]  -----Original Message-----
GW> From: Chua Eng Huang, Cecil [mailto:[EMAIL PROTECTED]]
GW> Sent: Monday, July 29, 2002 9:02 AM
GW> To: Tomcat Users List
GW> Subject: RE: REPOST: Document.importNode not working-works fine in
modified JSDK2.1


GW>   This is probably it.  However, I have dumped every jar file into
webapps\examples\WEB-INF\lib,
GW>   which according to my understanding of the various docs is where
you're supposed to put all your own JAR files.

GW>   >Also, what are these "special" JARs? Tomcat is a J2EE servlet
container, but it does not contain all the components of >the "easy
download" J2SDK EE. So, look in the JAR files and see if the
GW> "org.w2c.dom" package is there... it may not be (I >forget). If that's
the case, then you are compiling with a classpath that does not match the
runtime classpath. This is >common with Tomcat,
GW> unless you want to point your compile classpath to
$TOMCAT_HOME/server/lib/ for the JARs. >A lot of people use the J2EE.jar for
simplicity, but then must remember to compare the run-time packages
GW> when a problem >occurs.
GW>   The code does compile fine (otherwise I wouldn't be getting a crash by
Tomcat itself.  I'd get it from the compiler).

GW>   Cecil Chua





--
Best regards,
 Jacob                            mailto:[EMAIL PROTECTED]


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



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

Reply via email to