0 Replies Latest reply on Aug 16, 2010 2:03 PM by max tomlinson

    wsconsume and JAXB errors:

    max tomlinson Newbie

      I'm using wsconsume to generate artifacts for a JBoss 4.2 JAX-WS service

      There are quite a few complex types related to the WSN Notification spec. The issue seems to be that some types are defined as QName and the generated code can't handle these.
      It can't instantiate QName. If I modify the generated code to make it a String, it loads.

      I was initially getting JAXB errors on server startup trying to deploy the service


      # java.lang.IllegalStateException: Cannot build JAXB context 
      #     at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder.java:925) 
      # @XmlAttribute/@XmlValue need to reference a Java type that maps to text in XML. 
      #     this problem is related to the following location: 
      #         at protected java.util.List org.oasis_open.docs.wsn.t_1.TopicType.messageTypes 

      The problem was that the generated wsconsume stubs define messageTypes as List<QName>. If I change it to List<String> I get past the problem.
      But obviously, this is not good. I want to implement the Oasis WSN spec and generate working stubs and go from there.

      From the spec for this (Oasis WSN spec):

      <xsd:attribute name="messageTypes">
      <xsd:list itemType="xsd:QName"/>

      Do I need to create JAXB binding files to somehow change the type of xsd:QName to something else? e.g. String.
      (I can pass binding files into the wsconsume process)
      Can I get a sample of how to do this?

      any help greatly appreciated.