Hi guys,

I've been fighting with this error, and I've researched it on Google, but I
can't really find a solution, and it's driving me a bit nuts.

My XSD is attached.

The CodeGen process using this XSD works just fine and generates the java
classes, binding.xml, etc, no worries. I'm doing this via maven with the
package "org.oma.protocols.mlp" assigned to it.

Then I'm trying to perform an unmarshal on some raw XML data like this
sample:

<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE svc_init SYSTEM "MLP_SVC_INIT_310.DTD">
 <svc_init>
   <hdr>
     <client>
       <id>USERNAME</id>
       <pwd>PASSWORD</pwd>
       <serviceid>SERVICEID</serviceid>
     </client>
     <initiator><msid type="MSISDN">MSISDN OF REQUESTING
USER</msid></initiator>
   </hdr>
   <slir>
     <msids>
       <msid type="MSISDN">MSISDN OF TARGET</msid>
     </msids>
     <eqop>
        <resp_timer>15</resp_timer>
     </eqop>
   </slir>
 </svc_init>

My unmarshal code looks like:

JAXBContext jaxbContext =
JAXBContext.newInstance(org.oma.protocols.mlp.SvcInit.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();

StringReader reader = new StringReader(postString);
org.oma.protocols.mlp.SvcInit svcinit = (org.oma.protocols.mlp.SvcInit)
unmarshaller.unmarshal(reader);

This then produces a whole bunch of run-time errors like these:

12:49:12,160 ERROR [STDERR] (pool-25-thread-1)
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 9 counts of
IllegalAnnotationExceptions
Two classes have the same XML type name "type". Use @XmlType.name and
@XmlType.namespace to assign different names to them.
        this problem is related to the following location:
                at org.oma.protocols.mlp.RespReq$Type
                at public org.oma.protocols.mlp.RespReq$Type
org.oma.protocols.mlp.RespReq.getType()
                at org.oma.protocols.mlp.RespReq
                at public org.oma.protocols.mlp.RespReq
org.oma.protocols.mlp.Eqop.getRespReq()
                at org.oma.protocols.mlp.Eqop
                at public org.oma.protocols.mlp.Eqop
org.oma.protocols.mlp.EmeLir.getEqop()
                at org.oma.protocols.mlp.EmeLir
                at public org.oma.protocols.mlp.EmeLir
org.oma.protocols.mlp.SvcInit.getEmeLir()
                at org.oma.protocols.mlp.SvcInit
        this problem is related to the following location:
                at org.oma.protocols.mlp.LocType$Type
                at public org.oma.protocols.mlp.LocType$Type
org.oma.protocols.mlp.LocType.getType()
                at org.oma.protocols.mlp.LocType
                at public org.oma.protocols.mlp.LocType
org.oma.protocols.mlp.EmeLir.getLocType()
                at org.oma.protocols.mlp.EmeLir
                at public org.oma.protocols.mlp.EmeLir
org.oma.protocols.mlp.SvcInit.getEmeLir()
                at org.oma.protocols.mlp.SvcInit

There's a pile more of similar errors as well.

Is there a real "solution" for this? What am I doing wrong? Am I supposed
to manually go through the generated classes every time and add these
@XmlType tags? I'm not totally clear on what type of tag of that sort I
could add that wouldn't break my system?

Any help is much appreciated!

Thank you,
Andrew

Attachment: mlp_svc_init_310.xsd
Description: XML document

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to