Hallo,
hab grad ein für mich größeres Problem.
Ich hab JAXB eingebunden, aber das läuft nur, wenn ich als Vorgabe Java 1.6 wähle.
Der Kunde hat aber java 1.5 laufen.
Nun habe ich jetzt alles schon so abgeändert, dass es wenigsten unter Java 1.5 kompiliert.
Wenn nun aber mein XML-code geladen werden soll, bekomme ich folgende Ausschrift :
“data.TestData” doesnt contain ObjectFactory.class or jaxb.index
hier mal mein Code :
http://nopaste.byte-welt.net/view.php?id=671
public Object toObject(InputStream input, Object ob) throws Exception
{
if(input != null)
{
JAXBContext jc = JAXBContext.newInstance(ob.getClass().getCanonicalName());
Unmarshaller unmarshaller = jc.createUnmarshaller();
return (ob = unmarshaller.unmarshal(input));
}
return null;
}
import java.io.*;
import javax.xml.bind.annotation.*;
/**
*
* @author root
*/
@XmlRootElement( namespace = "http://tutego.com/" )
public class TestData
{
private String name = null;
public void setDriverName(String name) { this.name = name; }
public String getDriverName() { return this.name; }
}