• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

JAXB 2 - InvocationTargetException creating JAXB context

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy,

I've created a package of classes from an existing schema and I've built a Struts 2 action to test the unmarshalling, which is throwing a java.lang.reflect.InvocationTargetException. Here is the unmarshal code:



The com.company.persistence.foo.IssueResponse package contains the following classes (generated using XJC):
SO000902.java
ObjectFactory.java

I've been searching for a solution and trying different "hacks" for hours now and I fear that I'll end up over at Experts Exchange - Noooooo!

Any suggestions are greatly appreciated.

Thank you.
 
Sheriff
Posts: 22841
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Other Open Source Projects forum.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Full Stacktrace? Also I'm not a JAXB expert, but is setting your context to be a 'package' the right thing to do?
 
Cornelius Reckinger
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy folks,

I found the solution. It turns out that when using JAXB 2.0 in your project that you not only need to include the JAXB jar files (jaxb-api, jaxb-impl, and jaxb-xjc) to your classpath, but you also need jsr-173_1.0_api.jar from the XMLBeans package.

Thanks
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for sharing, that's a good one to know alright!
 
reply
    Bookmark Topic Watch Topic
  • New Topic