Inconsistent behaviour of JAXBContext.newInstance(contextPath) method ...

View: New views
1 Messages — Rating Filter:   Alert me  

Inconsistent behaviour of JAXBContext.newInstance(contextPath) method ...

by metro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

 I am using JAXB bundled with JDK 1.6 on a Windows 7 machine. I am baffled with this inconsistent behaviour. Here's some sample code.

-------------------------------------------------------------
 JAXBContext jc = new JAXBContext.newInstance("org.collabng.jabber.iq.rpc");

This works for one "data set" and fails for another. It throws a JAXBException with the message that it cannot find ObjectFactory.class and/or jaxb.index.  The cass ObjectFactory.class is obviously there and it works with one of the "datasets".

However when I create the JAXBContext using another static method it works consistently.



JAXBContext  jc = JAXBContext.newInstance(Class.forName("org.collabng.jabber.iq.rpc.Query"));


it works.

Strange !!!

It's a part of larger codebase and I have tried to isolate the offending code. Are there any other "environmental" issues that I should be looking into ?.

I am intending to look into the codebase for JAXB also, but it is quite complex and may take a lot of time and effort. Am, I overlooking something basic.

I have read through a large part of the JAXB tutorial and such.

/rk
[Message sent by forum member 'rktumuluri' (rktumuluri@...)]

http://forums.java.net/jive/thread.jspa?messageID=369736

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...