jaxb
  1. jaxb
  2. JAXB-894

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: runtime
    • Labels:
      None
    • Environment:

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

      Description

      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; }

      }

        Activity

        Hide
        bojangles added a comment -

        Any further updates on this issue?

        Show
        bojangles added a comment - Any further updates on this issue?
        Hide
        Iaroslav Savytskyi added a comment -

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

        Show
        Iaroslav Savytskyi added a comment - I have to finish the issue I'm working on... This bug will be the next.
        Hide
        Iaroslav Savytskyi added a comment -

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

        Show
        Iaroslav Savytskyi added a comment - I wasn't able to reproduce this bug. Can you please provide some runnable testcase. Thanks a lot.
        Hide
        Iaroslav Savytskyi added a comment -

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

        Show
        Iaroslav Savytskyi added a comment - Also please try to use latest jaxb-impl from maven.

          People

          • Assignee:
            Iaroslav Savytskyi
            Reporter:
            bojangles
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: