Skip to main content

IllegalAnnotationsException: "type XY that doesnt have an XmlID property

2 replies [Last post]
Joined: 2005-11-11

Is issue #45 (XmlID not being found) really solved?
Using release jaxb-ri-20051201, i get a similar exception at runtime (when instantiating the JAXBContext):

XmlIDREF property is referencing a type "mytest.Pattern" that doesnt have an XmlID property.
this problem is related to the following location:
at mytest.Pattern mytest.PatternRef.ref
at mytest.PatternRef

at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(
at com.sun.xml.bind.v2.ContextFactory.createContext(
at com.sun.xml.bind.v2.ContextFactory.createContext(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at javax.xml.bind.ContextFinder.newInstance(
at javax.xml.bind.ContextFinder.find(
at javax.xml.bind.JAXBContext.newInstance(
at javax.xml.bind.JAXBContext.newInstance(

My code was initially generated by xjc - i then manually...
- moved the id attribute to the base class (Referencable)
- changed the ref attribute type from Object to Pattern

public class Referencable {
String id;
public class Pattern extends Referencable {
/* more fields */
public class PatternRef {
Pattern ref;

Best regards,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-09

This seems like a bug. Working on it...

Joined: 2003-06-09

The issue is different from #45.
I'm about to commit a fix.