jaxb-facets icon indicating copy to clipboard operation
jaxb-facets copied to clipboard

java.lang.NoClassDefFoundError: com/sun/tools/javac/code/Type$ClassType

Open pellcorp opened this issue 7 years ago • 3 comments

It seems as though the XmlSchemaEnhancer depends on either tools.jar or a JDK to execute correctly. It won't work if running in a JRE unless tools.jar is in the class path.

I am wondering if it was possible to fix this so that jaxb-facets could run without tools.jar dependency?

pellcorp avatar Nov 26 '18 05:11 pellcorp

java.lang.NoClassDefFoundError: com/sun/tools/javac/code/Type$ClassType at at.ac.tuwien.infosys.jaxb.XmlSchemaEnhancer.getAnnotationOfProperty(XmlSchemaEnhancer.java:943) at at.ac.tuwien.infosys.jaxb.XmlSchemaEnhancer.getFacetsAnnotation(XmlSchemaEnhancer.java:871) at at.ac.tuwien.infosys.jaxb.XmlSchemaEnhancer.hasFacets(XmlSchemaEnhancer.java:206) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace$2.write(XmlSchemaGenerator.java:1163) at com.sun.xml.bind.v2.schemagen.TreeWrapper.write(TreeWrapper.java:90) at com.sun.xml.bind.v2.schemagen.Tree$Group.write(Tree.java:255) at com.sun.xml.bind.v2.schemagen.Tree.write(Tree.java:138) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeClass(XmlSchemaGenerator.java:1039) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTo(XmlSchemaGenerator.java:721) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.access$800(XmlSchemaGenerator.java:519) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.write(XmlSchemaGenerator.java:501) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.generateSchema(JAXBContextImpl.java:832) at org.apache.cxf.common.jaxb.JAXBUtils.generateJaxbSchemas(JAXBUtils.java:824) at

pellcorp avatar Nov 26 '18 05:11 pellcorp

Seems to have been introduced as part of: https://github.com/whummer/jaxb-facets/commit/9b83ec423635042828602d68424e6e16f67af9f9

pellcorp avatar Nov 26 '18 06:11 pellcorp

Actually seems this class is contained in the jsr308 jar, but that causes issues for java 8 deployments and for the couple of lines of code where its used and seems to be only relevant to cli schemagen, would be good to make it optional.

pellcorp avatar Nov 26 '18 06:11 pellcorp