Yogesh Gandhi wrote:This solution worked for the above problem.
But in the same file I need to convert another object to XML
But this solution doesn't works there.
Though the jaxb.properties and bgm.ser file are there in the folder that is specified as the first argument of JAXBContext.newInstance
Still it is not working.
Any body has any clue?
I mean, what are the points one needs to take care, while using JAXBContext.newInstance
What I got to know is that
The FAQ on jaxb.properties not found recommends using
this.getClass().getClassLoader()
Huh !!! It was a mistake on my part, but the error message is also mis-leading.
Actually I generated java classes, and added those java files to my project.
And I was trying to run it..
And it was failing on line
JAXBContext context =
JAXBContext.newInstance("external.rtgs.inquiryXml", RtgsUtil.class.getClassLoader());
However, it should have given a NoClassDefFoundError, but no......it says, Unable to locate jaxb.properties
I am glad, i was able to find the root cause.....After compiling all the classes it worked !!!