Link to home
Create AccountLog in
Avatar of Waponi
Waponi

asked on

JAXBContext. Marshaller method not found

I have code which works ok on a local eclipse w apache;

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

JAXBContext jc = JAXBContext.newInstance(JobList.class);
Marshaller m = jc.createMarshaller();
m.marshal(jobList, new File(JOBFILE));
AND....
Compiles in Production, but throws
a method not found exception on
m.marshal(jobList, new File(JOBFILE));

Is this a java version issue between prod and dev envs ?
I do see some APIs for the javax.xml.bind Interface Marshaller that do not include the version accepting a file and not a output stream.

http://download.oracle.com/javase/6/docs/api/javax/xml/bind/Marshaller.html
http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/api/javax/xml/bind/Marshaller.html

Thanks for the help
 
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Waponi
Waponi

ASKER

Thanks,
Is it safe to , "assume" , that since
public void marshal(Object jaxbElement, File output) is only available since JAXB2.1,
that
public void marshal(Object jaxbElement, OutputStream os) should work for older versions ?

regards....

yes thats been available since 1.0 from memory
Avatar of Waponi

ASKER

Thanks all,
This solved a prod release issue !