jQuery in Action, 2nd edition*
The moose likes Other JSE/JEE APIs and the fly likes jaxb.properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "jaxb.properties file" Watch "jaxb.properties file" New topic
Author

jaxb.properties file

itisha jain
Greenhorn

Joined: Oct 04, 2005
Posts: 11
Hi,

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.


package com;

import java.io.FileWriter;
import java.io.Writer;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;

//import com.AddressBean;

public class AddressCreator {

public static void writeAddress(Writer pWriter) throws JAXBException {
// Create the element:

com.AddressBean addr = new com.AddressBean();
addr.setName("jane");
addr.setPostal("chandpur");

JAXBContext context = JAXBContext.newInstance("com");
Marshaller marshaller = context.createMarshaller();
marshaller.marshal(addr, pWriter);
}

public static void main(String[] args) throws Exception {
FileWriter fw = new FileWriter("Address.xml");
writeAddress(fw);
fw.close();
}
}

Please help as I am stuck at this point.
itisha
Tom George
Ranch Hand

Joined: Jan 28, 2004
Posts: 41
Not too familiar with JAXB, but if it is expecting input from some property file, the folder containing the property file should be included in the classpath, right?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jaxb.properties file
 
Similar Threads
Clarification Requested - XML recordset & JAXB classes
can't able to write in file & Path class not found
jaxb.properties file
whats the error!
Reg PrintWriter