I am trying to convert a java bean object into xml i.e marshalling. However when i run my main program,it gives the error "Exception in thread "main" javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package com" How is this jaxb.properties file generated? my code is as follows.i m able to see the address.xml file i.e being created bit it is empty.
I'm having the same Exception problem, I put in JAXBContext.newInstance("com.abc.ccc", this.getClass().getClassLoader() ) and I still get the same Unable to locate jaxb.properties for package com.abc.ccc exception.
You need to make sure that jaxb.properties and bgm.ser files(which are generated by xjc tool) are under your "com" directory when you used JAXBContext.newInstance("com").
SOLUTION :
Got the soution to my problem...Actually it was required to give the classLoader as the second argument.
Use the overloaded method of newInstance.