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/...
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/...
QName. If I modify the generated code to make it a
http://www.coderanch.com/t/410859/java/java/String-StringBuffer-StringBui...
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/...
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/...
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/...
QName>. If I change it to List<
http://www.coderanch.com/t/410859/java/java/String-StringBuffer-StringBui...
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/...
QName to something else? e.g.
http://www.coderanch.com/t/410859/java/java/String-StringBuffer-StringBui...
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&...]