Community
Participate
Working Groups
Start with a schema that has a namespace - the orm.xsd for example and a project that does not have EclipseLink on its classpath. Generate JAXB classes from the schema. Notice that a class package-info.java is created. Now choose New->JAXB->Schema from JAXB Classes and select that generated package including the package-info.java file. You get the below exception. Using EclipseLink MOXy does not result in this exception. Uncheck the package-info.java file and both the JDK and EclipseLink MOXy implementations appear to find the package-info.java and use it in the generation. com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions jdk.package-info is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at jdk.package-info jdk.package-info does not have a no-arg default constructor. this problem is related to the following location: at jdk.package-info at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302) at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121) 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:202) at javax.xml.bind.ContextFinder.find(ContextFinder.java:363) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
It appears we need to filter these files out of selection list if possible, and if not ignore them when configuring generation.
Created attachment 172664 [details] proposed patch
Patch committed to 2.3.1 and head.
verified fixed in build wtp-sdk-M-3.2.1-20100717062943