tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saurabh Arora" <SAr...@novell.com>
Subject Re: Re[4]: XML parser
Date Thu, 21 Nov 2002 04:57:54 GMT

 We had also faced  a similar problem in a project. We are currently working on a prototype
for loading 
a specific version of xerces.jar (which is compatible with our application) , using the InternalclassLoader.

 You can try to write your own code for the same, write your own classloader, load the classes
from a specified
jar and create instance of the same.

Saurabh

>>> hoju@visi.com 11/20/02 10:45PM >>>
Hello Cédric,

Here's a good explanation.  It even explains why it probably works for
you.

Here's the bug:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7175 

Here's the applicable comment:

------- Additional Comments From Patrick Luby 2002-03-16 23:24 -------

I agree with Remy that you should stop trying to override the default XML parser. 
While you *may* be able to override it when using JDK 1.3, you will absolutely 
not be able to do it with JDK 1.4 as JDK 1.4 treats the XML parsing classes (also 
known as "endorsed" classes) as system classes. Hence, once the JVM is started, 
JDK 1.4 will not all any class loader in the process load alternate XML parsing 
classes that fall in any package names listed in the following URL:

  http://java.sun.com/j2se/1.4/docs/guide/standards/index.html 

The only way around this JDK 1.4 restriction for your webapp only is to create an 
XML parser with package names that are not listed in the above URL (i.e. a very 
non-standard parser).

There is another way around this restriction. However, it will force all webapps 
(and the container itself) to use your XML parser. You can put your parser jar 
files in the common/lib directory (4.0.x) or in the common/endorsed directory 
(HEAD).



Jake


Wednesday, November 20, 2002, 10:27:36 AM, you wrote:

CV> I'am interested by more informations on this subject.

CV> I actually use XML librairies in my /WEB-INF/lib directory, on a Tomcat
CV> 4.0.4-LE, and it works fine. May be because of the light edition.

CV> Regards,

CV>   Cédric

CV> ----- Original Message -----
CV> From: "Jacob Kjome" <hoju@visi.com>
CV> To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
CV> Sent: Wednesday, November 20, 2002 5:25 PM
CV> Subject: Re[2]: XML parser


>> Hello Charlie,
>>
>> There is actually more to it.  Putting XML or DOM libraries in
>> WEB-INF/lib violates the Sun classloading spec which Tomcat has been
>> enforcing since the 4.0.2 release.  Now, don't ask me why the Sun
>> classloading spec says what it says.  Just know that you are
>> prohibited from putting XML/DOM libraries in a child classloader such
>> as WEB-INF/lib.  Ask Remmy if you want an explanation.
>>
>> Jake
>>
>> Wednesday, November 20, 2002, 9:02:01 AM, you wrote:
>>
>> CC> do not put xerces.jar in WEB-INF/lib. It will not work there since it
CV> is
>> CC> already in /common/lib. Tomcat comes with Xerces already, so unless
CV> you need
>> CC> functionality not contained in the provided xerces.jar, you don't have
CV> to do
>> CC> anything. if you need a newer version, replace the one in /common/lib.
>>
>> CC> Charlie
>>
>> >> -----Original Message-----
>> >> From: Paul_Wallace@allsolutions.com.au 
>> >> [mailto:Paul_Wallace@allsolutions.com.au] 
>> >> Sent: Wednesday, November 20, 2002 12:34 AM
>> >> To: tomcat-user@jakarta.apache.org 
>> >> Subject: XML parser
>> >>
>> >>
>> >> Hi,
>> >>      In my effort to parse an XML file and pull out data from it's
>> >> elements where I may maninpulate them, I have downloaded the
>> >> Xerces.ZIP
>> >> (which incidentally is 4.8 MB - expanded to 22!), extracted it to
>> >> webapps/ROOT/WEB-INF/lib/. Is this the correct location? If
>> >> not, where
>> >> should it reside? Looking at the rest of the documentation I
>> >> cannot  find
>> >> any syntax simple enough to what I want to do.
>> >>         What I want to do is (real simple now!), I have an XML file:
>> >>
>> >> <?xml version="1.0" encoding="iso-8859-1" ?>
>> >> <root>
>> >>         <a_tag>1st selection</a_tag>
>> >>         <a_tag>2nd selection</a_tag>
>> >> </root>
>> >>
>> >> in a JSP I want to parse the file, iterate through it extracting the
>> >> element values. Perhaps storing them in a array.
>> >>         So I have 3 factors here, the one (desired) not
>> >> present in this
>> >> email being the JSP syntax to parse and get hold of the data. Ie:
>> >>
>> >> <%@ page language="java" %>
>> >> <html>..
>> >>
>> >> <%
>> >>
>> >> parse and acquire contents of a_tag
>> >>
>> >> %>
>> >>
>> >> ..</html>
>> >>
>> >> I am obviously simplifying as much as possible here. Again, all input
>> >> apreciated.
>> >>
>> >> Paul.
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> ;-)
>> >>
>> >>
>> >> Yep and yep
>> >>
>> >> For usage in Tomcat the process of "installation" is just as you say..
>> >> manually copy the jar file into either your webapps lib folder or into
>> >> the global lib folder so that all your different webapps can
>> >> access it.
>> >> Generally it's advisable to copy it into your webapp's lib folder as
>> >> this makes your webapp deployable as a standalone application (ie: no
>> >> external dependencies).
>> >>
>> >> <yep 2> the full download includes files documentation (yep,
>> >> pretty much
>> >> the website docs but available offline), jar files and demos
>> >> for a wide
>> >> range of applications. Mind you mine (2.2.0) is only 4.8
>> >> meg.. not 22 so
>> >> I can't say for sure that you haven't got hold of something extra as
>> >> well.
>> >>
>> >> It's then a case of finding out what to do with the thing
>> >> you've now got
>> >> access to.  To look into that further, have a look at the different
>> >> demos provided and see if they give you what you want.
>> >>
>> >> If you find yourself still struggling a more specific question about
>> >> what you're trying to achieve and where it's going wrong may evoke a
>> >> more useful response.
>> >>
>> >> G'luck.
>> >>
>> >> Tref
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>>
>> CC> --
>> CC> To unsubscribe, e-mail:
CV> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> CC> For additional commands, e-mail:
CV> <mailto:tomcat-user-help@jakarta.apache.org>
>>
>>
>>
>> --
>> Best regards,
>>  Jacob                            mailto:hoju@visi.com 
>>
>>
>> --
>> To unsubscribe, e-mail:
CV> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
CV> <mailto:tomcat-user-help@jakarta.apache.org>
>>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com 


-->.apache.org 
>> >> 
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message