dcsimg
jaxb.properties not reached
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ramon_Valdez
Posted On:   Friday, November 18, 2005 01:46 PM

I have a problem reaching the file jaxb.properties inside my generated package. I´m importing my generated package on this way import javax.xml.bind.*; import CoordSuper.*; import CoordSuper.impl.*; and I´m using Jserv as Servlets engine with apache. If can compile and run my program at command line and is there no problem, it works fine; The problem arrives when I try to execute it invoked from a servlet. The error message is : javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package CoordSuper at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:205) at javax.xml.bind.Cont   More>>

I have a problem reaching the file jaxb.properties inside my generated package.

I´m importing my generated package on this way



import javax.xml.bind.*;

import CoordSuper.*;

import CoordSuper.impl.*;



and I´m using Jserv as Servlets engine with apache.

If can compile and run my program at command line and is there no problem, it works fine; The problem arrives when I try to execute it invoked from a servlet.



The error message is :

javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package CoordSuper

at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:205)

at javax.xml.bind.ContextFinder.find(ContextFinder.java:149)

at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)

at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:238)

at CoordSuperParser. (CoordSuperParser.java:27)

at CoordSuperParser.main(CoordSuperParser.java:91)

I´ve reviewed the permissions and are all right.


Has somebody an idea of what other technique can I use to reach my generated package?

Thanks in advance.

   <<Less

Re: jaxb.properties not reached

Posted By:   Steve_Mitchell  
Posted On:   Thursday, December 29, 2005 12:33 PM

Here is link to a Sun FAQ on jaxb.properties not found:
LINK TO SUN FAQ ON JAXB.PROPERTIES NOT FOUND


It is a ClassLoader problem. I'm still working through it myself when called from a Servlet (works fine from JUnit).
First, I got a ClassNotFound on an unmarshaller. I did the following to get around that problem:

JAXBContext.newInstance( "blah.blah.blah", 
ClassLoader.getSystemClassLoader() );



After the CLassNotFound problem was fixed I got the jaxb.properties not found problem. I tried switching ClassLoaders again, but the ClassNotFound problem came back.

JAXBContext.newInstance( "blah.blah.blah", 
Thread.currentThread().getContextClassLoader() );


The FAQ on jaxb.properties not found recommends using

this.getClass().getClassLoader()


I cannot use that from the Servlet because it also gives me the ClassNotFound error.


You might try one of these techniques to see if it fixes your issue. I'll keep looking for the solution to my issue.


Steve Mitchell
http://www.byteworksinc.com
About | Sitemap | Contact