File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes How to create a JAXB Context from File System Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

How to create a JAXB Context from File System

Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Hi I was writing an unmarshaller for JAXB, but for that first I need to create a JAXB Context.

Here is the sample code I am using

Now if I am trying to run this Main class from c:\temp\doc\testproject and my JAXB Objects are somewhere else, how can I create a JAXB Context for that packge.
If I am doing the same code at the same folder where JAXB objects are kept then it's working fine but with different folder it's not working.Please check at line 28 and 29.

Please let me know if you didn't understand the issue exactly.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

Please continue any discussion in the XML forum.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: How to create a JAXB Context from File System
jQuery in Action, 3rd edition