This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

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

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.


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. (

My question are

1. Though the 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.


It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!