• Post Reply Bookmark Topic Watch Topic
  • New Topic

Confused with JAXB, Context path  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I"m new to jaxb and i'm using j2sdk 1.4.2_06, My task is to refer an xsd and use my own java object filled with values to its properties and generate an xml.

I'm confused with the context path param in the below method.

JAXBContext.newInstance( �com.acme.foo:com.acme.bar� );

How am i suppose to generate jaxb.propertise file ? and what am i refering to from the context path ? Please help

Thanks
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In the following code:


the com.acme.foo:com.acme.bar is the name of the Class package. This class package contains the classes generated by the JAXB compiler to handle the objects created during marshalling/unmarshalling.

I guess you are not supposed to generate the jaxb.properties file. If you are seeing a error which says "jaxb.properties file not found", then probably your jaxb related JAR files are not in the system classpath or the application server classpath. I would recommend copy the JAR files to the lib folder of the application server and then restart the application server and try executing your code.

Let me know if it works for you.

Ritesh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!