Forums Register Login

How to set JAXBContext within the file system

+Pie Number of slices to send: Send
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
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1128 times.
Similar Threads
How to create JAXB Context from File System
How to create a JAXB Context from File System
UnmarshalException
Problem with JAXB Unmarshaller
Jax-B
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:19:27.