com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions XmlElementRef points to a non-existent class. this problem is related to the following location: at java.util.List testing.Target.tasks at testing.Target at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)

Java.net JIRA | robertotyley | 9 years ago
  1. 0

    The standard example given for the use of @XmlElementRef fails with: Exception in thread "main" com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions XmlElementRef points to a non-existent class. this problem is related to the following location: at java.util.List testing.Target.tasks at testing.Target at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211) at javax.xml.bind.ContextFinder.find(ContextFinder.java:372) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522) at com.thisbedisonfire.util.JAXBUtil.marshall(JAXBUtil.java:31) at testing.TestingXmlElementRef.main(TestingXmlElementRef.java:15) The code used is taken from example 1 ('Ant Task Example') given in the docs for XmlElementRef: http://java.sun.com/javase/6/docs/api/javax/xml/bind/annotation/XmlElementRef.html I haven't been able to find a functioning example of XmlElementRef. I'm using Java6u3 with JAXB 2.1.6, and this is the precise code I'm using: import java.io.CharArrayWriter; import java.util.*; import javax.xml.bind.JAXBContext; import javax.xml.bind.annotation.*; public class TestingXmlElementRef { public static void main(String[] args) throws Exception { Target target = new Target(); target.tasks = Arrays.asList(new JarTask(), new JavacTask()); CharArrayWriter caw = new CharArrayWriter(); JAXBContext.newInstance(Target.class).createMarshaller().marshal(target, caw); caw.close(); System.out.println(caw.toString()); } } @XmlRootElement(name = "target") class Target { // The presence of @XmlElementRef indicates that the XML // element name will be derived from the @XmlRootElement // annotation on the type (for e.g. "jar" for JarTask). @XmlElementRef List<Task> tasks; } abstract class Task { } @XmlRootElement(name = "jar") class JarTask extends Task { } @XmlRootElement(name = "javac") class JavacTask extends Task { }

    Java.net JIRA | 9 years ago | robertotyley
    com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions XmlElementRef points to a non-existent class. this problem is related to the following location: at java.util.List testing.Target.tasks at testing.Target at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
  2. 0

    Unable to create JAXBContext: 1 counts of IllegalAnnotationExceptions no-arg default constructor

    Stack Overflow | 2 years ago | Kumar Gautam
    com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions 01:07:12,479 ERROR [stderr] java.lang.StackTraceElement does not have a no-arg default constructor. 01:07:12,481 ERROR [stderr] at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102) 01:07:12,481 ERROR [stderr] at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438) 01:07:12,481 ERROR [stderr] at com.sun.xml.bind.v2.runtime.JAXBContextImpl.&lt;init&gt;(JAXBContextImpl.java:286)
  3. 0

    wsdl2java Two classes have the same XML type name "{http://***.***.***.***/***/***/***}objectFactory"

    Stack Overflow | 1 year ago | mapek
    org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean .camelBlueprint.factory.camelContext
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    各位大侠,我是新人有很多问题!!!

    Google Groups | 9 years ago | zsoftbuilder
    com.sun.xml.bind.v2.runtime.IllegalAnnotationsException
  6. 0

    Re: Using Interfaces as parameter types of SCA service composite operation

    apache.org | 1 year ago
    org.apache.tuscany.sca.databinding.TransformationException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions commonj.sdo.DataObject is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at commonj.sdo.DataObject at protected commonj.sdo.DataObject com.ca.ucf.connector.sca.jaxws.Start.arg1 at com.ca.ucf.connector.sca.jaxws.Start commonj.sdo.DataObject does not have a no-arg default constructor. this problem is related to the following location: at commonj.sdo.DataObject at protected commonj.sdo.DataObject com.ca.ucf.connector.sca.jaxws.Start.arg1 at com.ca.ucf.connector.sca.jaxws.Start com.ca.connector.runtime.OperationListener is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at com.ca.connector.runtime.OperationListener at protected com.ca.connector.runtime.OperationListener com.ca.ucf.connector.sca.jaxws.Start.arg3 at com.ca.ucf.connector.sca.jaxws.Start com.ca.connector.runtime.OperationListener does not have a no-arg default constructor. this problem is related to the following location: at com.ca.connector.runtime.OperationListener at protected com.ca.connector.runtime.OperationListener com.ca.ucf.connector.sca.jaxws.Start.arg3 at com.ca.ucf.connector.sca.jaxws.Start

    5 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.sun.xml.bind.v2.runtime.IllegalAnnotationsException

      1 counts of IllegalAnnotationExceptions XmlElementRef points to a non-existent class. this problem is related to the following location: at java.util.List testing.Target.tasks at testing.Target at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)

      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>()
    2. Old JAXB Runtime
      ContextFactory.createContext
      1. com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
      2. com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
      3. com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
      3 frames
    3. Java RT
      NativeMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2 frames