2012-02-13 74 views
1

我正在使用REST Web服務,我需要解析使用jaxb構建的XML。我得到以下例外。請幫我解決這個問題預先感謝如何解決XMLStreamException

java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException 
com.sun.xml.bind.v2.runtime.JAXBContextImpl.createMarshaller(JAXBContextImpl.java:686) 
com.sun.xml.bind.v2.runtime.JAXBContextImpl.createMarshaller(JAXBContextImpl.java:116) 
com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getMarshaller(AbstractJAXBProvider.java:167) 
com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getMarshaller(AbstractJAXBProvider.java:140) 
com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.writeTo(AbstractRootElementProvider.java:138) 
com.sun.jersey.api.client.TerminatingClientHandler.writeRequestEntity(TerminatingClientHandler.java:317) 
com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:179) 
com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:126) 
com.sun.jersey.api.client.Client.handle(Client.java:435) 
com.sun.jersey.api.client.WebResource.handle(WebResource.java:557) 
com.sun.jersey.api.client.WebResource.access$300(WebResource.java:69) 
com.sun.jersey.api.client.WebResource$Builder.put(WebResource.java:475) 
np.com.ntech.dto.EtopupClient.purchasePin(EtopupClient.java:54) 
np.com.ntech.dto.App.pinRequest(App.java:264) 
org.apache.jsp.fundtransfer.card_jsp._jspService(card_jsp.java:371) 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 

回答

2

這個類是在Java 1.6的引入,你可能不小心運行在Java 1.5的應用程序服務器或類似的東西。

+0

感謝artbristol。我會試一試java 1.6。 – Bikesh 2012-02-14 04:31:54