actually, there are three versions. you should get rid of the older 2
because they may be conflicting. you should also get rid of other
duplicates(xalan,xml-apis,regexp,xmldb?).

you have no way of knowing which version of xerces is loaded first - only
the first version loaded(may be the old or new depending on the classloader)
will be used unless the other ones contain packages not in the first jar.

Charlie

> -----Original Message-----
> From: Chua Eng Huang, Cecil [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 4:47 PM
> To: Tomcat Users List
> Subject: RE: Re[2]: REPOST: Document.importNode not working-works fine
> in modified JSDK2.1
> 
> 
> Dear all,
>  
> I tried moving the jars as earlier suggested.
>  
> Here's the contents of the directory.  As you can see, Xerces 
> IS in the directory (actually two versions of it).
>  
>  Volume in drive C has no label.
>  Volume Serial Number is 90E8-430D
>  Directory of C:\JAKART~1.1\lib\apps
> 07/30/2002  04:39p      <DIR>          .
> 07/30/2002  04:39p      <DIR>          ..
> 03/13/2002  11:47p             417,110 ant-1.4.1.jar
> 12/12/2000  02:36p             443,047 ant.jar
> 01/28/2002  02:31p              71,695 antlr.jar
> 01/28/2002  02:31p             130,307 avalon-excalibur-4.0.jar
> 01/28/2002  02:31p              35,299 avalon-framework-4.0.jar
> 04/23/2001  02:59p             779,765 castor.jar
> 01/28/2002  02:31p             694,162 cocoon.jar
> 01/28/2002  02:31p              54,831 cos.jar
> 01/28/2002  02:31p              24,026 db.jar
> 03/13/2002  11:47p              15,991 examples.jar
> 01/28/2002  02:31p             461,188 exist.jar
> 01/28/2002  02:31p              28,383 getopt.jar
> 04/23/2001  02:59p              30,358 infozone-lexus.jar
> 03/13/2002  11:47p              44,009 infozone-tools.jar
> 01/28/2002  02:31p              29,871 jakarta-regexp-1.2.jar
> 04/23/2001  02:59p              29,795 jakarta-regexp.jar
> 01/28/2002  02:31p              66,521 jasper-runtime.jar
> 12/12/2000  02:37p             209,875 jasper.jar
> 04/23/2001  02:59p             246,635 javaclass.jar
> 01/28/2002  02:31p               6,407 java_readline.jar
> 12/12/2000  02:36p               5,618 jaxp.jar
> 01/28/2002  02:31p             193,431 jdbc7.0-1.2.jar
> 04/23/2001  02:59p              98,496 jndi.jar
> 01/28/2002  02:31p              25,391 jstyle.jar
> 04/23/2001  02:59p               8,809 jta-spec1_0_1.jar
> 04/23/2001  02:59p              45,054 junit.jar
> 01/28/2002  02:31p             158,892 log4j.jar
> 01/28/2002  02:31p              70,529 logkit-1.0.jar
> 01/28/2002  02:31p              34,369 maybeupload_1-0-5pre3.jar
> 01/28/2002  02:31p              62,403 mysql.jar
> 04/23/2001  02:59p              12,468 omquery.jar
> 03/13/2002  11:47p           1,729,689 openorb-1.2.0.jar
> 03/13/2002  11:47p             283,371 openorb_tools-1.2.0.jar
> 01/28/2002  02:31p             413,614 optional.jar
> 12/12/2000  02:36p             136,133 parser.jar
> 05/06/1999  09:41a              33,271 qtag.jar
> 03/26/2002  07:43a                  94 README
> 01/28/2002  02:31p              72,154 resolver.jar
> 12/12/2000  02:36p              40,836 servlet.jar
> 07/30/2002  04:39p                   0 show.txt
> 01/28/2002  02:31p             105,291 trove.jar
> 12/12/2000  02:37p             406,998 webserver.jar
> 03/13/2002  11:47p             720,930 xalan-2.0.1.jar
> 01/28/2002  02:31p             897,409 xalan-2.2.0-D14.jar
> 03/13/2002  11:47p           1,808,885 xerces-1.4.3.jar
> 01/28/2002  02:31p           1,781,968 xerces-1.4.4.jar
> 04/23/2001  02:59p             795,604 xerces.jar
> 03/13/2002  11:47p             589,139 xindice.jar
> 03/13/2002  11:47p              77,890 xml-apis-1.0.jar
> 01/28/2002  02:31p              92,409 xml-apis.jar
> 01/28/2002  02:31p               8,969 xmldb-api-20011111.jar
> 03/13/2002  11:47p               9,240 xmldb-sdk.jar
> 03/13/2002  11:47p              28,473 xmldb-xupdate.jar
> 03/13/2002  11:47p               8,969 xmldb.jar
> 01/28/2002  02:31p              59,975 xmlrpc-1.0rc1.jar
> 04/23/2001  02:59p             370,745 xtdash.jar
>               56 File(s)     15,006,791 bytes
>                2 Dir(s)     886,317,056 bytes free
>  
> There was also a request to see the variable temp2.  Enclosed 
> is the full source code for that function.
>  
>   private Document setupXMLSearchEngine(DocumentBuilder 
> builder, String result, DBConnTable d, readcore swarg) throws 
> ParserConfigurationException,SAXException,IOException,ClassNot
> FoundException,SQLException
>    {
>     Integer I=new Integer(swarg.value("currconfig"));
>     counter c=new counter();
>     String dbx=swarg.value("DBX");
>     while (c.value()<I.intValue())
>       c.inc();
>     StringTokenizer st=new 
> StringTokenizer(swarg.value("configuration"+c.fixInt(4)),", ",false);
>     String qt=st.nextToken();
>     String sa=st.nextToken();
>     DBTable db=null;
>     Document temp2=builder.newDocument();
>     Text tn=null;
>     Text tn2=null;
>     temp2.appendChild(temp2.createElement("Engine"));
>     Element root2=temp2.getDocumentElement();
>     Node engineNode=temp2.createElement("QueryTransformer");
>     db=d.runSelect("Select name from modules where id="+qt);
>     tn=temp2.createTextNode(db.getString("name"));
>     engineNode.appendChild(tn);
>     root2.appendChild(engineNode);
>     Node engineNode2=temp2.createElement("SearchAlgorithm");
>     db=d.runSelect("Select name from modules where id="+sa);
>     tn2=temp2.createTextNode(db.getString("name"));
>     engineNode2.appendChild(tn2);
>     root2.appendChild(engineNode2);
>     Document temp=null;
>     if (result==null)
>       temp=builder.parse(new InputSource(new 
> StringReader("<result>No records</result>")));
>     else
>       temp=builder.parse(new InputSource(new StringReader(result)));
>     Node temp3=temp.getDocumentElement();
>     Node temp4=temp2.importNode(temp3,true); //This is line 
> 109 where Tomcat bombs
>     root2.appendChild(temp4);
>     return temp2;
>    }
> 
> What I'll probably do if nothing else works is just write my 
> own importNode function within the module.
>  
> Cecil Chua
> 
>       -----Original Message----- 
>       From: Jacob Kjome [mailto:[EMAIL PROTECTED]] 
>       Sent: Mon 7/29/2002 3:31 PM 
>       To: Tomcat Users List 
>       Cc: 
>       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