Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need urgent help to resolve this issue while marshalling and unmarshalling in JAXB

 
sriram sundararajan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I am using JAXB 2.1.9 for marshalling and unmarshalling.

My xsd is having 2 abstract elements along with other regular elements, when i try to marshall it in web tier it is working fine i can able to
convert xsd to java object.

Using mqseries i got a xml messaage and a MDB has been configured to listen those messages.
when i try to unmarshall it in MDB (message driven bean) it is throwing 2 exception stating


There's no ObjectFactory with an @XmlElementDecl for the element {http://niem.pv/ps/ps-core/2.0}PersonSex.

and

There's no ObjectFactory with an @XmlElementDecl for the element {http://niem.pv/ps/ps-core/2.0}DateRepresentation.


PersonSex and DateRepresentation are the two abstract elements here.


In online i noticed,it may be becuase of a bug in JAXB. (http://markmail.org/message/efueg3vvkxo7ijrl#query:There%27s%20no%20ObjectFactory%20with%20an%20%40XmlElementDecl+page:1+mid:sdfoaxizt5n6ilmq+state:results)



My question are

1. Though the ObjectFactory.java in that package does have both entries, why it is throwing this exception?

2. How come i am not facing this issue in web tier?

3. Somewhere i saw by using @XmlSeeAlso, this issue can be resloved. Appreciate if you could throw some light on it.

4. I also having a doubt that, is it something to do with the creating of JAXBContext class? What is
the proper way of creating the context if i am having 2 or more shema files.

Regards

Sriram.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!