tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
2
ZUGRIFFE
3137
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    naeko naeko ist offline Mitglied Silber
    Registriert seit
    Apr 2006
    Beiträge
    54
    hallo,

    ich wollte paar JAXB-Beispiele ausprobieren(u.a. vom SUN: http://java.sun.com/developer/techni...Services/jaxb/)
    Leider bekomme ich immer folgenden Fehler (bereits bei der Codeumsetzung):

    "The type javax.xml.stream.XMLEventReader cannot be resolved. It is indirectly referenced from required .class files." Der Fehler kommt immer in der Zeile wo ich ein Marshalling (Collection collection= (Collection)
    unmarshaller.unmarshal(new File( "books.xml"))
    oder Unmarshalling
    ( Collection collection= (Collection)
    unmarshaller.unmarshal(new File( "books.xml"))
    mache.
    Hat jemand eine Idee was da fehlt?

    Benutze Eclipse 3.1.0, JDK 1.5.0 und JWSDP 2.0.

    Danke im voraus
     

  2. #2
    Registriert seit
    Jun 2002
    Ort
    Saarbrücken (Saarland)
    Beiträge
    9.886
    Blog-Einträge
    29
    Hallo,

    nimm doch einfach mal das jsr173_api.jar (findet man unter %JWSDP_HOME%\sjsxp\lib) in den Classpath auf.

    Gruß Tom
     
    Java rocks!
    How to become a good Java Programmer?
    Does IT in Java and .Net
    The only valid measurement of code quality: WTFs / minute
    Blog
    Xing
    Twitter

  3. #3
    naeko naeko ist offline Mitglied Silber
    Registriert seit
    Apr 2006
    Beiträge
    54
    danke, scheint keinen Fehler mehr auszugeben, aber jetzt kommt bei Ausführen vom Programm in der allerersten Zeile:

    JAXBContext jaxbContext = JAXBContext.newInstance("test.jaxb");

    eine Excpetion:
    com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    com.sun.xml.bind.DefaultJAXBContextImpl does not have a no-arg default constructor
    this problem is related to the following location:
    at com.sun.xml.bind.DefaultJAXBContextImpl
    at test.jaxb.ObjectFactory

    Meine Java-Klasse befindet sich in einem package test.jaxb.
    wo ist denn da das Problem?
     

Ähnliche Themen

  1. JaxB namespace Problem
    Von Peregrin im Forum Java
    Antworten: 1
    Letzter Beitrag: 07.10.10, 12:40
  2. JAXB Exception Problem
    Von dreamer29 im Forum Enterprise Java (JEE, J2EE, Spring & Co.)
    Antworten: 0
    Letzter Beitrag: 21.06.10, 11:37
  3. Antworten: 22
    Letzter Beitrag: 21.08.08, 10:56
  4. JAXB (Java2XML) -> Problem mit Vererbung
    Von denyo85 im Forum Java
    Antworten: 1
    Letzter Beitrag: 24.08.07, 10:07
  5. JAXB (Java2XML) -> Problem mit Array
    Von denyo85 im Forum Java
    Antworten: 0
    Letzter Beitrag: 23.08.07, 18:26