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

XML Parsing

16 views
Skip to first unread message

Tom Holmes Jr.

unread,
May 10, 2001, 11:37:48 AM5/10/01
to
According to most of the messages on this list WAS 3.5 uses the ancient
Xerces/Xalan jar files version 1.0, is that correct? If not, what version
do they use?

I copied the xmlj, xerces, and xalan from WebSphere to my local IDE
development environment, and I was able to compile my Servlet using the WAS
xerces and xalan jar files. My code is listed below. All I want my servlet
to do right now is ti simply take two URL's parse them and give me my HTML
content to the client/browser. I get an error when I move it up to the WAS
App Server and I have listed that error message down below.

//*** These are the imports I thought we should use ... they came from the
SimpleTransform.
import org.xml.sax.SAXException;
import org.apache.xalan.xslt.XSLTProcessorFactory;
import org.apache.xalan.xslt.XSLTInputSource;
import org.apache.xalan.xslt.XSLTResultTarget;
import org.apache.xalan.xslt.XSLTProcessor;

/**Process the HTTP Get request*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();

//*** URL source of my XML file
String sXMLPath = http://www.mywebsite.net/myfile.xml
//** URL source of my XSL file
String XSLPath = http://www.mywebsite.net/myfile.xsl

try
{
//*** Have the XSLTProcessorFactory obtain a interface to a new
XSLTProcessor object.
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
// Have the XSLTProcessor processor object transform "foo.xml" to
// System.out, using the XSLT instructions found in "foo.xsl".
processor.process(new XSLTInputSource(sXMLPath),new
XSLTInputSource(sXSLPath),new XSLTResultTarget(out));
}
catch(org.xml.sax.SAXException saxe)
{ System.out.println("org.xml.sax.SAXException: " + saxe.getMessage() ); }
}

This is the error message I am getting. Why would I be getting an
java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser
message when I tested out this code directly against the same
xalan/xerces/xmlj files?

Any help would be much appreciated. Thanks.

<HR width="100%">
<B>Root Error-1</B>: org/apache/xerces/parsers/DOMParser<BR><XMP>
java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName0(Compiled Code)
at java.lang.Class.forName(Compiled Code)
at org.apache.xalan.xslt.XSLTEngineImpl.<init>(XSLTEngineImpl.java:360)
at
org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor(XSLTProcessorFactory
.java:79)
at com.tmfi.medeview.servlets.DrugList.doGet(DrugList.java:43)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(Compiled
Code)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Compiled
Code)
at com.ibm.servlet.engine.webapp.IdleServletState.service(Compiled Code)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Compiled
Code)
at com.ibm.servlet.engine.webapp.ServletInstance.service(Compiled Code)
at
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(Compiled
Code)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Compiled
Code)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(C
ompiled Code)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Compiled
Code)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(Compiled
Code)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(Compiled
Code)
at
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(Compiled
Code)
at
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(Compiled
Code)
at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(Compiled
Code)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(Co
mpiled Code)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(Compiled
Code)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(Com
piled Code)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.notifyService(Compiled Code)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.run(Compiled Code)
at
com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run
(Compiled Code)
at java.lang.Thread.run(Compiled Code)
</XMP><BR>
<HR width="100%">
<B>Wrapped Error-2</B>: org/apache/xerces/parsers/DOMParser<BR><XMP>
javax.servlet.ServletException: org/apache/xerces/parsers/DOMParser
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at javax.servlet.ServletException.<init>(Compiled Code)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(Compiled
Code)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Compiled
Code)
at com.ibm.servlet.engine.webapp.IdleServletState.service(Compiled Code)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Compiled
Code)
at com.ibm.servlet.engine.webapp.ServletInstance.service(Compiled Code)
at
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(Compiled
Code)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Compiled
Code)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(C
ompiled Code)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Compiled
Code)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(Compiled
Code)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(Compiled
Code)
at
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(Compiled
Code)
at
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(Compiled
Code)
at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(Compiled
Code)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(Co
mpiled Code)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(Compiled
Code)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(Com
piled Code)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.notifyService(Compiled Code)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.run(Compiled Code)
at
com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run
(Compiled Code)
at java.lang.Thread.run(Compiled Code)
</XMP><BR>
<HR width="100%">
<B>Wrapped Error-3</B>: Server caught unhandled exception from servlet
[DrugList]: org/apache/xerces/parsers/DOMParser<BR><XMP>
com.ibm.servlet.engine.webapp.UncaughtServletException: Server caught
unhandled exception from servlet [DrugList]:
org/apache/xerces/parsers/DOMParser
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at javax.servlet.ServletException.<init>(ServletException.java:132)
at
com.ibm.websphere.servlet.error.ServletErrorReport.<init>(ServletErrorReport
.java:43)
at
com.ibm.servlet.engine.webapp.WebAppErrorReport.<init>(WebAppErrorReport.jav
a:32)
at
com.ibm.servlet.engine.webapp.UncaughtServletException.<init>(UncaughtServle
tException.java:11)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(C
ompiled Code)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Compiled
Code)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(Compiled
Code)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(Compiled
Code)
at
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(Compiled
Code)
at
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(Compiled
Code)
at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(Compiled
Code)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(Co
mpiled Code)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(Compiled
Code)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(Com
piled Code)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.notifyService(Compiled Code)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.run(Compiled Code)
at
com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run
(Compiled Code)
at java.lang.Thread.run(Compiled Code)
</XMP><BR>

Paul Ilechko

unread,
May 10, 2001, 1:45:50 PM5/10/01
to
did you put those jars in the admin server classpath ?

Paul Ilechko

unread,
May 10, 2001, 2:54:30 PM5/10/01
to
I saw a post here a while ago that to get a different parser to
work you had to put the jars at the beginning of the admin server
classpath.

"Tom Holmes Jr." wrote:
>
> > did you put those jars in the admin server classpath ?
>

> No, the ancient version of Xerces, Xalan, and XMLJ that came with WebSphere
> are in the /lib directory of WebSphere.
> Because this Servlet is going to be deployed at a customer site eventually,
> I have no idea of what other XML translations are going on. Certainly
> WebSphere itself uses it's versions of Xalan and Xerces to do it's own work,
> so I am hesitant about upgrading the XML parser for this customer.
>
> Please let me know if you need any more information. Thanks.
>
> Tom
>
> "Paul Ilechko" <paul.i...@bms.com> wrote in message
> news:3AFAD3CE...@bms.com...

Tom Holmes Jr.

unread,
May 10, 2001, 2:45:27 PM5/10/01
to
> did you put those jars in the admin server classpath ?

No, the ancient version of Xerces, Xalan, and XMLJ that came with WebSphere


are in the /lib directory of WebSphere.
Because this Servlet is going to be deployed at a customer site eventually,
I have no idea of what other XML translations are going on. Certainly
WebSphere itself uses it's versions of Xalan and Xerces to do it's own work,
so I am hesitant about upgrading the XML parser for this customer.

Please let me know if you need any more information. Thanks.

Tom

"Paul Ilechko" <paul.i...@bms.com> wrote in message
news:3AFAD3CE...@bms.com...

Tom Holmes Jr.

unread,
May 10, 2001, 3:48:59 PM5/10/01
to
Right, but I wasn't trying to get different parsers to work. I was trying
to get my file to transform with the EXISTING XML jar files that came
natively with WAS 3.5. What I need is for someone to show me the correct
code for the XML-HTML transformation with the older Xalan and Xerces files.

However, I do have some new information. It turns out the "web-app" that
was created has a classpath to the Orion directory. I suspect that maybe
this web-app is using these Xerces and Xalan from Orion than from WebSphere,
but I can't be sure until I try an experiement.

My next step is to replace the xalan and xerces under the Orion directory
(which the web-app is using as a classpath) with the new xalan and xerces
jar from xml.apache.org. Then I am going to put back my original servlet
and see what develops.

Thanks.

Tom

"Paul Ilechko" <paul.i...@bms.com> wrote in message

news:3AFAE3E6...@bms.com...

0 new messages