You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Timm, Sean" <ST...@mailgo.com> on 2000/06/27 03:55:40 UTC

FW: Parser.jar required?

The latest CVS drop appears to require parser.jar (even though Xerces is a
full JAXP implementation).  It appears that this has to do with package
naming (ie. no longer com.sun but javax...)  Is this a known issue?  It
would be nice to get this fixed before the 3.2 release.  Are there other
issues with this that I'm not aware of?  If not, I'd be glad to take a look
at it if no one else currently is.

- Sean T.

Re: Solve XML parser bag of cats by removing lib?

Posted by Costin Manolache <co...@eng.sun.com>.
Yes, that's very high on my free-time mini-projects list.

I hope we'll have it in tomcat 3.3 ( at least I'll do as much as
I can for that). There are many other advantages and implications
in separating the run-time classpath available to webapps and
improving the lib/ directory ( security, etc).


I don't think we can have it in 3.2 - it's not a critical bug.

Costin



Jim Rudnicki wrote:

> Could the XML bag of cats problem be solved by not storing servlet engine
> packages in the global "lib" directory?  Why should the servlet engine
> spread its dependencies among all web apps?
>
> I'm thinking that there should be two "lib" directories: "lib" and "global".
> LIB would store servlet engine dependencies and would not be available to
> the classloaders for the web apps.
> GLOBAL would store common packages and would be available to all web app
> classloaders, but _not_ the servlet engines classloader.
>
> Alas, I don't know how difficult this would be, but there already is
> different classloaders for these things I believe.
>
> Jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Solve XML parser bag of cats by removing lib?

Posted by Jim Rudnicki <jd...@pacbell.net>.
Could the XML bag of cats problem be solved by not storing servlet engine
packages in the global "lib" directory?  Why should the servlet engine
spread its dependencies among all web apps?

I'm thinking that there should be two "lib" directories: "lib" and "global".
LIB would store servlet engine dependencies and would not be available to
the classloaders for the web apps.
GLOBAL would store common packages and would be available to all web app
classloaders, but _not_ the servlet engines classloader.

Alas, I don't know how difficult this would be, but there already is
different classloaders for these things I believe.

Jim






Re: XML parser bag of cats

Posted by External Lists <Ex...@ManagedObjects.com>.
> Tomcat depends only on JAXP - which is the factory and the hook you are
talking
> about.

The following files, as of the June 4 nightly build, still directly
reference the Sun XML parser:

src/j2ee/org/apache/tomcat/deployment/WebComponentDescriptorReader.java
src/j2ee/org/apache/tomcat/deployment/SecurityConstraintReader.java
src/j2ee/org/apache/tomcat/util/XMLParser.java

The last file is the one that looks to be fairly Sun XML parser-dependent.

Have these dependencies been eradicated since the June 4 nightly build?

Thanks very much,

John



Re: XML parser bag of cats

Posted by Costin Manolache <co...@eng.sun.com>.
> The other answer is for people developing XML-aware applications like
> Tomcat not to depend on a particular parser.  The way to do that is to
> depend only on the org.w3c.dom (or org.xml.sax) interfaces internally, to
> always use a factory method to get a DOM Document object back from a
> different physical document, and then to expose a hook for that factory
> method.  This makes it possible to configure a different parser
> implementation underneath the application without breaking it.  Of course,
> we still have to deal with the DOM level 1 versus DOM level 2 issue, but
> that one is appreciably easier to manage.

Tomcat depends only on JAXP - which is the factory and the hook you are talking
about.

It have a fallback to parser.jar ( which is the original parser used with tomcat
since 3.0 and so very stable ), but that's only used if jaxp fails.

Costin


Re: XML parser bag of cats

Posted by Eric Hamilton <Er...@haht.com>.
At 06:32 PM 6/28/00 -0400, you wrote:
>I am wondering if I am feeling a unique pain, or if others share it:

It's not unique.  It's a real problem that crops up any time that two
distributions that have chosen to incorporate different XML parsers meet in
the same VM.

One answer is the for the world to get together and agree on a single
open-source XML parser.  I don't like this one :-)

The other answer is for people developing XML-aware applications like
Tomcat not to depend on a particular parser.  The way to do that is to
depend only on the org.w3c.dom (or org.xml.sax) interfaces internally, to
always use a factory method to get a DOM Document object back from a
different physical document, and then to expose a hook for that factory
method.  This makes it possible to configure a different parser
implementation underneath the application without breaking it.  Of course,
we still have to deal with the DOM level 1 versus DOM level 2 issue, but
that one is appreciably easier to manage.

>
>The state of XML parsers is a bit of a mess, in that you have the following
>bag of cats:
[snip]
>Has anyone out there succeeded in assembling components that continue to
>have both Sun XML and Xerces dependencies?
>
>Thanks for any guidance on this.


Re: XML parser bag of cats

Posted by Jason Hunter <jh...@collab.net>.
> I am wondering if I am feeling a unique pain, or if others share it:
> 
> The state of XML parsers is a bit of a mess, in that you have the following
> bag of cats:
> 
> - javax.xml (JAXP 1.0.1)
> - com.sun.xml (reference implementation in JAXP 1.0.1)
> - org.w3c.dom (level 1 support shipped with JAXP 1.0.1)
> - org.w3c.dom (level 2 support shipped in Xerces)
> - org.xml.sax (level 1 support shipped with JAXP 1.0.1)
> - org.xml.sax (level 2 support shipped in Xerces)
> - org.apache.xerces (at various levels)
> 
> The thing that's biting me is that I would like to assemble components that
> are dependent on Xerces, with its post level 1 XML parsing support, with
> components (like Tomcat) that still depend on Sun's XML parser, which
> support level 1 DOM and SAX.  Since the two flavors of org.w3c.dom and
> org.xml.sax are different, one XML parser is going to lose.
> 
> I am trying to reconcile this mess, but I doubt that com.sun.xml will work
> with the newer org.w3c.dom and org.xml.sax classes/interfaces that are
> required to also support Xerces.
> 
> Has anyone out there succeeded in assembling components that continue to
> have both Sun XML and Xerces dependencies?
> 
> Thanks for any guidance on this.
> 
> John W. Cocula
> Managed Objects

I'm not sure what you're doing, but I suggest you take a look at JDOM. 
It lets you avoid all kinds of these issues.  http://jdom.org.  You may
see it as another cat, but it was created by myself and Brett McLaughlin
(author of O'Reilly's "Java and XML") partially to avoid this "cat
race".  Also to make XML work faster and easier.

With it you don't need JAXP (it uses an adapter model instead, so you
can use more parsers than JAXP supports (DOM2/SAX2 included) and you
don't need to ship the JAXP JAR).  You also don't really need DOM or SAX
unless you want to use them.  Just plug in whatever supporting parser
library you want -- and your versioning problems go away.

There's also a JavaWorld article on JDOM at
http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom.html.

-jh-

Re: XML parser bag of cats

Posted by Christophe Warland <cw...@mail.com>.
I am running Cocoon inside Tomcat 3.2. As you might now, Cocoon ships with its
own build of xerces and xalan and the release notes says to put them before any
other Tomcat jar files in the classpath if you want to run Cocoon in Tomcat.

Then, somehow, my Tomcat 3.2 build didn't want to run if jaxp was not in the
classpath. So I ended up with this tomcat.bat file (excerpt):

set CLASSPATH=.
set CLASSPATH=%TOMCAT_HOME%\classes
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\cocoon.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\fop_0_12_1.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet_2_2.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\stylebook-1.0-b2.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xalan_1_0_1.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xerces_1_0_3.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
set CLASSPATH=%CLASSPATH%;c:\java\jaxp1.0.1\jaxp.jar
set CLASSPATH=%CLASSPATH%;c:\java\jaxp1.0.1\parser.jar

Somehow it works, and that's all I want for the moment. I'll think about  JAXP
vs Xerces when my first problem appears.

Regards,

Christophe

External Lists wrote:

> I am wondering if I am feeling a unique pain, or if others share it:
>
> The state of XML parsers is a bit of a mess, in that you have the following
> bag of cats:
>
> - javax.xml (JAXP 1.0.1)
> - com.sun.xml (reference implementation in JAXP 1.0.1)
> - org.w3c.dom (level 1 support shipped with JAXP 1.0.1)
> - org.w3c.dom (level 2 support shipped in Xerces)
> - org.xml.sax (level 1 support shipped with JAXP 1.0.1)
> - org.xml.sax (level 2 support shipped in Xerces)
> - org.apache.xerces (at various levels)
>
> The thing that's biting me is that I would like to assemble components that
> are dependent on Xerces, with its post level 1 XML parsing support, with
> components (like Tomcat) that still depend on Sun's XML parser, which
> support level 1 DOM and SAX.  Since the two flavors of org.w3c.dom and
> org.xml.sax are different, one XML parser is going to lose.
>
> I am trying to reconcile this mess, but I doubt that com.sun.xml will work
> with the newer org.w3c.dom and org.xml.sax classes/interfaces that are
> required to also support Xerces.
>
> Has anyone out there succeeded in assembling components that continue to
> have both Sun XML and Xerces dependencies?
>
> Thanks for any guidance on this.
>
> John W. Cocula
> Managed Objects
>
> ----- Original Message -----
> From: "Costin Manolache" <co...@eng.sun.com>
> To: <to...@jakarta.apache.org>
> Sent: Monday, June 26, 2000 10:05 PM
> Subject: Re: FW: Parser.jar required?
>
> > If jaxp is available and installed in CLASSPATH, it will be used - that
> means
> > you
> >  can use xerces or any other jaxp parser.
> >
> > You should use JAXP if possible.
> >
> > If jaxp is not available -  we fall back to parser.jar.
> >
> > Costin
> >
> > "Timm, Sean" wrote:
> >
> > > The latest CVS drop appears to require parser.jar (even though Xerces is
> a
> > > full JAXP implementation).  It appears that this has to do with package
> > > naming (ie. no longer com.sun but javax...)  Is this a known issue?  It
> > > would be nice to get this fixed before the 3.2 release.  Are there other
> > > issues with this that I'm not aware of?  If not, I'd be glad to take a
> look
> > > at it if no one else currently is.
> > >
> > > - Sean T.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

--

--------------------------------------------------------------------
Christophe Warland                   S1 Corporation
R&T Engineer                         Technology Center
christophe.warland@s1.com            705 Westech Drive
Phone: +1 678 421-4015               Norcross, GA 30092
Fax:   +1 253 399-5709               U.S.A.
--------------------------------------------------------------------
   "If you're looney enough to run a file of unknown origin
 with a .vbs extension, that would be referred to as Darwinism."
       -- a Slashdot user, June 2000

Darwin Awards: http://www.darwinawards.com
Slashdot info: http://google.com/search?q=slashdot
VBS in action: http://google.com/search?q=vbs&btnI=I'm_feeling_lucky



XML parser bag of cats

Posted by External Lists <Ex...@ManagedObjects.com>.
I am wondering if I am feeling a unique pain, or if others share it:

The state of XML parsers is a bit of a mess, in that you have the following
bag of cats:

- javax.xml (JAXP 1.0.1)
- com.sun.xml (reference implementation in JAXP 1.0.1)
- org.w3c.dom (level 1 support shipped with JAXP 1.0.1)
- org.w3c.dom (level 2 support shipped in Xerces)
- org.xml.sax (level 1 support shipped with JAXP 1.0.1)
- org.xml.sax (level 2 support shipped in Xerces)
- org.apache.xerces (at various levels)

The thing that's biting me is that I would like to assemble components that
are dependent on Xerces, with its post level 1 XML parsing support, with
components (like Tomcat) that still depend on Sun's XML parser, which
support level 1 DOM and SAX.  Since the two flavors of org.w3c.dom and
org.xml.sax are different, one XML parser is going to lose.

I am trying to reconcile this mess, but I doubt that com.sun.xml will work
with the newer org.w3c.dom and org.xml.sax classes/interfaces that are
required to also support Xerces.

Has anyone out there succeeded in assembling components that continue to
have both Sun XML and Xerces dependencies?

Thanks for any guidance on this.

John W. Cocula
Managed Objects

----- Original Message -----
From: "Costin Manolache" <co...@eng.sun.com>
To: <to...@jakarta.apache.org>
Sent: Monday, June 26, 2000 10:05 PM
Subject: Re: FW: Parser.jar required?


> If jaxp is available and installed in CLASSPATH, it will be used - that
means
> you
>  can use xerces or any other jaxp parser.
>
> You should use JAXP if possible.
>
> If jaxp is not available -  we fall back to parser.jar.
>
> Costin
>
> "Timm, Sean" wrote:
>
> > The latest CVS drop appears to require parser.jar (even though Xerces is
a
> > full JAXP implementation).  It appears that this has to do with package
> > naming (ie. no longer com.sun but javax...)  Is this a known issue?  It
> > would be nice to get this fixed before the 3.2 release.  Are there other
> > issues with this that I'm not aware of?  If not, I'd be glad to take a
look
> > at it if no one else currently is.
> >
> > - Sean T.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>


Re: FW: Parser.jar required?

Posted by Costin Manolache <co...@eng.sun.com>.
If jaxp is available and installed in CLASSPATH, it will be used - that means
you
 can use xerces or any other jaxp parser.

You should use JAXP if possible.

If jaxp is not available -  we fall back to parser.jar.

Costin

"Timm, Sean" wrote:

> The latest CVS drop appears to require parser.jar (even though Xerces is a
> full JAXP implementation).  It appears that this has to do with package
> naming (ie. no longer com.sun but javax...)  Is this a known issue?  It
> would be nice to get this fixed before the 3.2 release.  Are there other
> issues with this that I'm not aware of?  If not, I'd be glad to take a look
> at it if no one else currently is.
>
> - Sean T.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org