[jboss-user] [JBoss Web Services] - wsconsume and JAXB errors:

max tomlinson do-not-reply at jboss.com
Mon Aug 16 14:06:55 EDT 2010


max tomlinson [http://community.jboss.org/people/finbarr] created the discussion

"wsconsume and JAXB errors:"

To view the discussion, visit: http://community.jboss.org/message/557561#557561

--------------------------------------------------------------
I'm using wsconsume to generate artifacts for a  http://www.coderanch.com/forums/f-63/JBoss 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  http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/xml/namespace/QName.html QName and the generated code can't handle these. 
 It can't instantiate  http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/xml/namespace/QName.html QName. If I modify the generated code to make it a  http://www.coderanch.com/t/410859/java/java/String-StringBuffer-StringBuilder-Performance String, it loads.
 
 I was initially getting JAXB errors on server startup trying to deploy the service
 
 e.g. 
 
 #  http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/lang/IllegalStateException.html 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  http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/util/List.html java.util.List org.oasis_open.docs.wsn.t_1.TopicType.messageTypes  
 #  
 
 The problem was that the generated wsconsume stubs define messageTypes as List< http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/xml/namespace/QName.html QName>. If I change it to List< http://www.coderanch.com/t/410859/java/java/String-StringBuffer-StringBuilder-Performance 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:simpleType>
 <xsd:list itemType="xsd:QName"/>
 </xsd:simpleType>
 </xsd:attribute>
 
 Do I need to create JAXB binding files to somehow change the type of xsd: http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/xml/namespace/QName.html QName to something else? e.g.  http://www.coderanch.com/t/410859/java/java/String-StringBuffer-StringBuilder-Performance String.
 (I can pass binding files into the wsconsume process)
 Can I get a sample of how to do this? 
 
 any help greatly appreciated.
 
 Max

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/557561#557561]

Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100816/d3676298/attachment.html 


More information about the jboss-user mailing list