Issue Details (XML | Word | Printable)

Key: JAXB-894
Type: Bug Bug
Status: Resolved Resolved
Resolution: Incomplete
Priority: Critical Critical
Assignee: Iaroslav Savytskyi
Reporter: bojangles
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
jaxb

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

Created: 04/Apr/12 03:35 PM   Updated: 27/Jun/12 02:27 PM   Resolved: 27/Jun/12 02:25 PM
Component/s: runtime
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment:

Windows 7, Ubuntu 11.10, Java(TM) SE Runtime Environment (build 1.7.0_03-b05), Netbeans 7.1.1


Tags:
Participants: bojangles and Iaroslav Savytskyi


 Description  « Hide

Description: JAXB will fail with an exception when the method is called on the client side if a byte[] is used as a parameter or return value for a web service method.

Example Code to Reproduce:

import javax.ejb.Stateless;
import javax.jws.WebService;

@Stateless
@WebService
public class ByteArrayTester {

public ByteArrayTester() {
}

public byte[] byteArrayReturnTester() {

return new byte[]{1, 2, 3, 4};
}

public void byteArrayParameterTester(byte[] byteArray) {
}
}

Exception:

Apr 04, 2012 10:57:51 AM manufacturingorderinsertionstation.exceptions.ExceptionHandler display
WARNING: javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:156)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:84)
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:235)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:652)
at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:640)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:332)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:315)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:297)
at javax.xml.ws.Service.getPort(Service.java:119)
at meis.turbocor.com.MEISLabelsService.getMEISLabelsPort(MEISLabelsService.java:72)
at com.turbocor.meis.labelsservicelibrary.GetHousingFolderLabelForHousingSN.getHousingFolderLabelForHousingSN(GetHousingFolderLabelForHousingSN.java:33)
at com.turbocor.meis.labelsservicelibrary.GetHousingFolderLabelForHousingSN.execute(GetHousingFolderLabelForHousingSN.java:49)
at manufacturingorderinsertionstation.cards.BuildOrderCard.handleScan(BuildOrderCard.java:134)
at manufacturingorderinsertionstation.MainFrame.scanRecieved(MainFrame.java:296)
at manufacturingorderinsertionstation.ScanListener.run(ScanListener.java:83)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
There's no ObjectFactory with an @XmlElementDecl for the element {}return.
this problem is related to the following location:
at protected javax.xml.bind.JAXBElement meis.turbocor.com.GetHousingThermalLabelForHousingSNResponse._return
at meis.turbocor.com.GetHousingThermalLabelForHousingSNResponse
There's no ObjectFactory with an @XmlElementDecl for the element {}return.
this problem is related to the following location:
at protected javax.xml.bind.JAXBElement meis.turbocor.com.GetHousingFolderLabelForHousingSNResponse._return
at meis.turbocor.com.GetHousingFolderLabelForHousingSNResponse
There's no ObjectFactory with an @XmlElementDecl for the element {}return.
this problem is related to the following location:
at protected javax.xml.bind.JAXBElement meis.turbocor.com.GetBuildOrderPDFForHousingSNResponse._return
at meis.turbocor.com.GetBuildOrderPDFForHousingSNResponse

at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:143)
... 15 more
Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
There's no ObjectFactory with an @XmlElementDecl for the element {}return.
this problem is related to the following location:
at protected javax.xml.bind.JAXBElement meis.turbocor.com.GetHousingThermalLabelForHousingSNResponse._return
at meis.turbocor.com.GetHousingThermalLabelForHousingSNResponse
There's no ObjectFactory with an @XmlElementDecl for the element {}return.
this problem is related to the following location:
at protected javax.xml.bind.JAXBElement meis.turbocor.com.GetHousingFolderLabelForHousingSNResponse._return
at meis.turbocor.com.GetHousingFolderLabelForHousingSNResponse
There's no ObjectFactory with an @XmlElementDecl for the element {}return.
this problem is related to the following location:
at protected javax.xml.bind.JAXBElement meis.turbocor.com.GetBuildOrderPDFForHousingSNResponse._return
at meis.turbocor.com.GetBuildOrderPDFForHousingSNResponse

at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:91)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:451)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:283)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:126)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1142)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:173)
at com.sun.xml.internal.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:96)
at com.sun.xml.internal.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:98)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:151)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:143)
... 17 more

Workaround:
If a byte array is a part of a class it will work correctly without error, for example:

public class Label {

private byte[] label;

public Label() {
}

public Label(byte[] label) { this.label = label; }

public byte[] getLabel() { return label; }

public void setLabel(byte[] label) { this.label = label; } }
}



bojangles added a comment - 20/Jun/12 08:44 PM

Any further updates on this issue?


Iaroslav Savytskyi added a comment - 21/Jun/12 07:30 AM

I have to finish the issue I'm working on... This bug will be the next.


Iaroslav Savytskyi added a comment - 27/Jun/12 02:00 PM

I wasn't able to reproduce this bug. Can you please provide some runnable testcase.
Thanks a lot.


Iaroslav Savytskyi added a comment - 27/Jun/12 02:27 PM

Also please try to use latest jaxb-impl from maven.