Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve the name 'xjc:globalJavaType' in jaxb-xjc-2.2.5-2.jar

Tags:

java

maven

jaxb

Maven project, after transfer to another PC gives error. Why?

[INFO] [jaxb2:generate {execution: default-cli}]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org.xml.sax.SAXParseException; systemId: jar:file:/.m2/repository/com/sun/xml/bind/jaxb-xjc/2.2.5-2/jaxb-xjc-2.2.5-2.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd; lineNumber: 86; columnNumber: 48; src-resolve: Cannot resolve the name 'xjc:globalJavaType' to a(n) 'group' component.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.AssertionError: org.xml.sax.SAXParseException; systemId: jar:file:/.m2/repository/com/sun/xml/bind/jaxb-xjc/2.2.5-2/jaxb-xjc-2.2.5-2.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd; lineNumber: 86; columnNumber: 48; src-resolve: Cannot resolve the name 'xjc:globalJavaType' to a(n) 'group' component.
    at com.sun.tools.xjc.SchemaCache.newValidator(SchemaCache.java:78)
    at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserFactoryImpl$1$1.startElement(AnnotationParserFactoryImpl.java:118)
    at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:253)
    ... 
like image 588
Didoo Avatar asked Jan 17 '13 07:01

Didoo


3 Answers

I had the similar problem. In my case path to local maven repository contained cyrillic symbols.
I changed my settings.xml and put <localRepository> element there to specify new repository path with latin symbols only. And that worked for me.

like image 154
aleksa.dp Avatar answered Nov 10 '22 00:11

aleksa.dp


I also had a similar issue. As it turned out, windows user home path contained a character with accent, caused an error. It was: c:\Users\Géza.m2 We changed to other user, everything was good.

like image 22
naan Avatar answered Nov 10 '22 00:11

naan


Well, I found the solution. (based on http://docs.oracle.com/javase/7/docs/api/javax/xml/XMLConstants.html#ACCESS_EXTERNAL_SCHEMA)

Create a file named jaxp.properties (if it doesn't exist) under /path/to/jdk1.8.0/jre/lib and then write this line in it:

javax.xml.accessExternalSchema = all That's all. Enjoy JDK 8.

like image 1
mapjaha Avatar answered Nov 09 '22 23:11

mapjaha