Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XML parsing problem with Xerces (Apache) with Websphere but not with Websphere Test Environment !?

428 views
Skip to first unread message

Pascal Noppe

unread,
Nov 29, 2000, 3:00:00 AM11/29/00
to
Hi there,
I have a frustrating problem. I will try to explain it as clear as possible.
Please, help.

I want to parse XML-files, using Apache's Xerces package. Doing this in a
servlet in Visual Age's WebSpehere Test Environment gives no problem at all
(VA 3.5). I just imported the Xerces package, and everything was ok and
running.

Trying to run the servlet on WebSphere Standard Edition 3.5, however, gives
the following error (?!!!) :

java.lang.NoSuchMethodError: org.apache.xerces.dom.NodeImpl: method
(Lorg/apache/xerces/dom/DocumentImpl;)V not found at
org.apache.xerces.dom.ParentNode.(ParentNode.java:116) at
org.apache.xerces.dom.DocumentImpl.(DocumentImpl.java:235) at
org.apache.xerces.dom.DeferredDocumentImpl.(DeferredDocumentImpl.java:189)
at org.apache.xerces.parsers.DOMParser.startDocument(DOMParser.java:910) at
org.apache.xerces.validators.common.XMLValidator.callStartDocument(XMLValida
tor.java:732) at
org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatch(XM
LDocumentScanner.java:740) at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:380) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
at
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:12
3) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:138) at
be.reference.pn.XmlTest.performTask(XmlTest.java:34) at
be.reference.pn.XmlTest.doGet(XmlTest.java:15) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:534) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:639) at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
.java:580) at
com.ibm....
...

I have the xerces.jar file in the classpath of the web application the
servlet is running in. Removing this file from the classpath gives me a
totally different error, so no question about that. I tried all three
versions of xerces (1.2.0/1.2.1/1.2.2) - the same error.


The line of code I want to be executed is the following. It is that line of
code that gives the error (look for XmlTest.java:34 on the stackTrace).

Document document =
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new
FileInputStream("myXmlFile"));


Debugging in the WebSphere Test Environment doesn't make sense, since
everything is working fine there.
Using sun's XML parsing package 'jaxp.jar' works fine with WebSphere, so
that's weird too...
I suspect WebSphere has some Xml parsing classes of it's own that interact
with the Xerces package, but I cannot find the problem!

Anyone has an idea, a suggestion ??
I cannot be the first one using the Xerces package with WebSphere...

Thanx a lot for any help,
Pascal

Annick Vergauwen

unread,
Nov 29, 2000, 3:00:00 AM11/29/00
to

Xerces uses the Class.Forname this as sometimes a strange behaviour when
installed in the web application classpath.
Try to install it in the classpath of the application server (with the
-classpath command line option).
This worked for me.

Greetings,


Luc

Luc Vanlathem

unread,
Nov 29, 2000, 3:00:00 AM11/29/00
to

Pascal,


An interesting on this subject can be found on www.ejbinfo.com.

Pascal Noppe

unread,
Nov 30, 2000, 3:00:00 AM11/30/00
to
Thanks for your answers.
Putting the xerces.jar v1.2.x in front of the WAS classpath at the
admin.config file did the job, indeed.
I hope I do not get conflicts at some point but I'll pray every day...

tx again,
Pascal


Luc Vanlathem <anni...@mailandnews.com> wrote in message
news:3A252EFD...@mailandnews.com...

Luc Vanlathem

unread,
Nov 30, 2000, 3:00:00 AM11/30/00
to

Pascal,

An interesting chapter on class loaders exists in the redbook SG246161.
This book will come out in December an is the IBM bible of Websphere (1000
pages).
You can find it via the internet on www.redbooks.ibm.com.
Other interesting books on Websphere can be found (for free!!!).

Pascal Noppe

unread,
Nov 30, 2000, 3:00:00 AM11/30/00
to
I just figured out Xerces should work with the fix pack WAS PTF 2.
However, I installed and what happens installing the fix pack, is the
following : xerces.jar (version 1.1.3) is installed in de WAS bin directory;
but the jar is in no way configured in the WAS classpath. Adding the jar
manually to the classpath (in front of xml4j.jar!!) makes the whole thing
work.
Is the fix pack failing or was the installation not correct ?
The installation did not give any errors!

Who is to tell ??

Pascal

Luc Vanlathem <anni...@mailandnews.com> wrote in message

news:3A260F8C...@mailandnews.com...

Linda Harris

unread,
Dec 1, 2000, 3:00:00 AM12/1/00
to
This was an interesting article but I had differences from the author
with my Websphere after I installed PTF2.
The xerces that came with PTF2 was 1.1.3. Xalan is already in Websphere's
admin.config, xerces is not, and needs to be added to the application's
classpath.

I believe that the xalan that comes with Webpshere is not compatable
with the 1.1.3 xerces version. I don't know how to tell the version level
for xalan because I couldn't see it in the jar but the dates on the files
seem to support my theory. I was running xerces 1.0.3 which worked with the
xalan that is packaged with Websphere. I then tried upgrading to xerces
1.1.3 (that came with Websphere), but xalan was getting errors about classes
not found. Ugrading my version of xalan seems to fix these and everything
seems to work OK. But these leads to my dilemma,
I can't run with the versions of xerces/xalan that are shipped with
Websphere so I either have to upgrade the version of xalan on downgrade the
version of xerces. Neither of these two options makes me very comfortable.

Linda

Billy Newport

unread,
Dec 3, 2000, 3:00:00 AM12/3/00
to
Hi Linda,
I don't understand something here. You get xerces and xalan with WAS PTF2.
Are these the jars you were using or did you try a xalan that you already
had with the xerces that came with WAS?

Did you use both the jars that are in appserver/lib or did you download one?

It's a shame that a version tag is not included in the xalan jars, makes
identifying it a little difficult.

Billy

"Linda Harris" <harr...@diebold.com> wrote in message
news:908pav$gac$1...@news.software.ibm.com...

Billy Newport

unread,
Dec 3, 2000, 3:00:00 AM12/3/00
to
It's fine, you need to add xerces on the classpath.

Billy

"Pascal Noppe" <pno...@reference.be> wrote in message
news:90611h$ehc$1...@news.software.ibm.com...


> I just figured out Xerces should work with the fix pack WAS PTF 2.
> However, I installed and what happens installing the fix pack, is the
> following : xerces.jar (version 1.1.3) is installed in de WAS bin
directory;
> but the jar is in no way configured in the WAS classpath. Adding the jar
> manually to the classpath (in front of xml4j.jar!!) makes the whole thing
> work.
> Is the fix pack failing or was the installation not correct ?
> The installation did not give any errors!
>
> Who is to tell ??
>
> Pascal
>

> Luc Vanlathem <anni...@mailandnews.com> wrote in message

> news:3A260F8C...@mailandnews.com...
> >
> > Pascal,
> >
> > An interesting chapter on class loaders exists in the redbook SG246161.
> > This book will come out in December an is the IBM bible of Websphere
(1000
> > pages).
> > You can find it via the internet on www.redbooks.ibm.com.
> > Other interesting books on Websphere can be found (for free!!!).
> >
> > Pascal Noppe wrote:
> >
> > > Thanks for your answers.
> > > Putting the xerces.jar v1.2.x in front of the WAS classpath at the
> > > admin.config file did the job, indeed.
> > > I hope I do not get conflicts at some point but I'll pray every day...
> > >
> > > tx again,
> > > Pascal
> > >

0 new messages