A
Anna
I am trying to use JAXB to unmarshall and marshall xml documents. I've
written a simple test class with a main method that I'm executing via
eclipse which takes an xml file from my c drive and unmarshalls the
data. Everything works great.
I'm now taking the same code and implementing it within an application
I'm developing. The application server I'm using is ATG.
I have added the following classes from the java web services developer
pack to my classpath
JAXB jar files -- jaxb-api.jar, jaxb-xjc.jar, jaxb-impl.jar,
jaxb-libs.jar
JAXP jar files -- jaxp-api.jar, sax.jar, dom.jar, xercesImpl.jar,
xalan.jar,
jwsdp-1.5/jwsdp-shared/lib -- jax-qname.jar, namespace.jar, xsdlib.jar,
relaxngDatatype.jar
When running my application I keep getting the following error.
java.lang.NoSuchMethodError:
com.sun.xml.bind.util.AttributesImpl.getIndexFast(Ljava/lang/String;Ljava/lang/String
I know the class AttributesImpl exists within jaxb-impl.jar. i also
know the method getIndexFast exists because I can call it within a test
java class. I've also modified my classpath to make sure that
jaxb-impl.jar is the first jar in the classpath. I did this to make
sure that if the class exists anywhere else its called from this jar.
I hav eno idea why i'm getting this error. Any thoughts from anyone
would be greatly appreciated. I've pasted the complete stack trace
below.
javax.servlet.ServletException:
com.sun.xml.bind.util.AttributesImpl.getIndexFast(Ljava/lang/String;Ljava/lang/StringI
at
atg.servlet.container.WebApplication.dispatchServletException(WebApplication.java:1072)
at
atg.servlet.container.WebApplication.dispatchRequest(WebApplication.java:831)
at
atg.servlet.container.WebApplication.dispatchRequest(WebApplication.java:626)
at
atg.servlet.pipeline.WebApplicationDispatcherPipelineServlet.service(WebApplicationDispatcherPipelineServlet.java:69)
at
atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:116)
at
atg.servlet.security.ThreadUserBinderServlet.service(ThreadUserBinderServlet.java:91)
at
atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:116)
at
atg.servlet.security.FormLoginPipelineServlet.service(FormLoginPipelineServlet.java:159)
at
atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:116)
.....stack trace CROPPED after 10 lines.
Caused by :java.lang.NoSuchMethodError:
com.sun.xml.bind.util.AttributesImpl.getIndexFast(Ljava/lang/String;Ljava/lang/StringI
at
com.ota.OTA_CancelRQ.impl.runtime.SAXUnmarshallerHandlerImpl.getAttribute(SAXUnmarshallerHandlerImpl.java:455)
at
com.ota.OTA_CancelRQ.impl.OTACancelRQImpl$Unmarshaller.enterElement(OTACancelRQImpl.java:244)
at
com.ota.OTA_CancelRQ.impl.runtime.SAXUnmarshallerHandlerImpl.startElement(SAXUnmarshallerHandlerImpl.java:125)
at
org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:575)
at
com.sun.xml.bind.unmarshaller.InterningXMLReader.startElement(InterningXMLReader.java:74)
at
org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)
at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1182)
.....stack trace CROPPED after 10 lines.
written a simple test class with a main method that I'm executing via
eclipse which takes an xml file from my c drive and unmarshalls the
data. Everything works great.
I'm now taking the same code and implementing it within an application
I'm developing. The application server I'm using is ATG.
I have added the following classes from the java web services developer
pack to my classpath
JAXB jar files -- jaxb-api.jar, jaxb-xjc.jar, jaxb-impl.jar,
jaxb-libs.jar
JAXP jar files -- jaxp-api.jar, sax.jar, dom.jar, xercesImpl.jar,
xalan.jar,
jwsdp-1.5/jwsdp-shared/lib -- jax-qname.jar, namespace.jar, xsdlib.jar,
relaxngDatatype.jar
When running my application I keep getting the following error.
java.lang.NoSuchMethodError:
com.sun.xml.bind.util.AttributesImpl.getIndexFast(Ljava/lang/String;Ljava/lang/String
I know the class AttributesImpl exists within jaxb-impl.jar. i also
know the method getIndexFast exists because I can call it within a test
java class. I've also modified my classpath to make sure that
jaxb-impl.jar is the first jar in the classpath. I did this to make
sure that if the class exists anywhere else its called from this jar.
I hav eno idea why i'm getting this error. Any thoughts from anyone
would be greatly appreciated. I've pasted the complete stack trace
below.
javax.servlet.ServletException:
com.sun.xml.bind.util.AttributesImpl.getIndexFast(Ljava/lang/String;Ljava/lang/StringI
at
atg.servlet.container.WebApplication.dispatchServletException(WebApplication.java:1072)
at
atg.servlet.container.WebApplication.dispatchRequest(WebApplication.java:831)
at
atg.servlet.container.WebApplication.dispatchRequest(WebApplication.java:626)
at
atg.servlet.pipeline.WebApplicationDispatcherPipelineServlet.service(WebApplicationDispatcherPipelineServlet.java:69)
at
atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:116)
at
atg.servlet.security.ThreadUserBinderServlet.service(ThreadUserBinderServlet.java:91)
at
atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:116)
at
atg.servlet.security.FormLoginPipelineServlet.service(FormLoginPipelineServlet.java:159)
at
atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:116)
.....stack trace CROPPED after 10 lines.
Caused by :java.lang.NoSuchMethodError:
com.sun.xml.bind.util.AttributesImpl.getIndexFast(Ljava/lang/String;Ljava/lang/StringI
at
com.ota.OTA_CancelRQ.impl.runtime.SAXUnmarshallerHandlerImpl.getAttribute(SAXUnmarshallerHandlerImpl.java:455)
at
com.ota.OTA_CancelRQ.impl.OTACancelRQImpl$Unmarshaller.enterElement(OTACancelRQImpl.java:244)
at
com.ota.OTA_CancelRQ.impl.runtime.SAXUnmarshallerHandlerImpl.startElement(SAXUnmarshallerHandlerImpl.java:125)
at
org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:575)
at
com.sun.xml.bind.unmarshaller.InterningXMLReader.startElement(InterningXMLReader.java:74)
at
org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)
at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1182)
.....stack trace CROPPED after 10 lines.