NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

SAAJ - javax.xml.ws.WebServiceException: Unable to create JAXBContext

 
Post new topic   Reply to topic    NetBeans Forums -> SOA Users
View previous topic :: View next topic  
Author Message
adiththan3



Joined: 18 Jan 2012
Posts: 2

PostPosted: Wed Jan 18, 2012 12:23 pm    Post subject: SAAJ - javax.xml.ws.WebServiceException: Unable to create JAXBContext Reply with quote

I have been trying to create a XML file from a Java Web service and create a SOAP message with Attachment using SAAJ to send it to another Web service. My Web service code is given below.

______________________________________________________________________

DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document document = documentBuilder.newDocument();
Element rootElement = document.createElement(root);
document.appendChild(rootElement);
Element ele1 = document.createElement("ID");
ele1.appendChild(document.createTextNode(InstanceId));
rootElement.appendChild(ele1);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
DOMSource source = new DOMSource(document);
File file = new File("/CurrentStatus.xml");
StreamResult result = new StreamResult(file);
transformer.transform(source, result);

______________________________________________________________________

On deploying this Web service, I get the following error.
javax.xml.ws.WebServiceException: Unable to create JAXBContext

______________________________________________________________________

Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 3
counts of IllegalAnnotationExceptions
java.lang.StackTraceElement does not have a no-arg default constructor.
this problem is related to the following location:
at java.lang.StackTraceElement
at public java.lang.StackTraceElement[]
java.lang.Throwable.getStackTrace()
at java.lang.Throwable
at private java.lang.Throwable
Local.jaxws.TransformerConfigurationExceptionBean.exception
at Local.jaxws.TransformerConfigurationExceptionBean
javax.xml.transform.SourceLocator is an interface, and JAXB can't
handle interfaces.
this problem is related to the following location:
at javax.xml.transform.SourceLocator
at private javax.xml.transform.SourceLocator
Local.jaxws.TransformerConfigurationExceptionBean.locator
at Local.jaxws.TransformerConfigurationExceptionBean
javax.xml.transform.SourceLocator does not have a no-arg default constructor.
this problem is related to the following location:
at javax.xml.transform.SourceLocator
at private javax.xml.transform.SourceLocator
Local.jaxws.TransformerConfigurationExceptionBean.locator
at Local.jaxws.TransformerConfigurationExceptionBean
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:153)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:149)
... 20 more
Exception occured in J2EEC Phase
com.sun.enterprise.deployment.backend.IASDeploymentException:
Deployment Error -- Exception occured in the wsgen process
javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.enterprise.webservice.WsUtil.runWsGen(WsUtil.java:1848)
at com.sun.enterprise.webservice.WsUtil.genWSInfo(WsUtil.java:2249)
at com.sun.enterprise.deployment.backend.ModuleDeployer.loadDescriptors(ModuleDeployer.java:427)
at com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModuleDeployer.java:160)
at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:182)
at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:208)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:283)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835)
at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:225)


deployment started : 0%
Deploying application in domain failed; Deployment Error -- Exception
occured in the wsgen process javax.xml.ws.WebServiceException: Unable
to create JAXBContext
BUILD FAILED (total time: 3 seconds)

______________________________________________________________________

I have tried adding javax.jar and other relevant jar files to the Web application libraries but of no use.

Any help to fix this problem would be very useful for me.

Thanks in advance.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> SOA Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo