File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to set JAXBContext within the file system Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to set JAXBContext within the file system" Watch "How to set JAXBContext within the file system" New topic
Author

How to set JAXBContext within the file system

Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Hi I am trying to create JAXBObject creation with a tool. But it's not working due to following error.

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

Here is my code which I tried.



Above program just works fine if I am in the folder which contains primer.po package. But if I am trying to access this package somewhere else("C:\\Documents\\Desktop\\XML\\tmp\\") it's not working. That's why I thought to create a context for this file system.

If I run this tool within the same directory then it will work without creating any context.

Any help would be highly appreciated.

Thanks
Ankur
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set JAXBContext within the file system