Java – convert dtmmanagerdefault to ClassCastException of dtmmanager during maven JAXB CodeGen
I encountered a strange problem when trying to run a maven build of JAXB CodeGen using the jaxb2 plug-in (see stacktrace below) The best I can think of is some implementations of dtmmanager, which is from xalan-2.7 The jars in 1 are loaded by different jars However, I have verified that the classpath used to run the JAXB: generate target has only one xalan-2.7.0 containing dtmmanager or dtmmanagerdefault 1. Jar - so I don't know what else I might encounter
Last data point: our build specifies a 'snapshot' configuration file, which is actually only used for jar up sources (using Maven source plugin) and publishes them as artifacts In addition to the default, the above failure condition occurs only when this profile is specified
I use sun's 64 bit JDK 1.6 on Linux x64 (Fedora 13) 0_ Maven 2.2. Running on 21 1 - see stack trace for 'MVN - V' information below
Any ideas about what the problem might be and / or how to debug? This has saddened me over the past few days and has now prevented progress:(
java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault cannot be cast to org.apache.xml.dtm.DTMManager at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:137) at org.apache.xpath.XPathContext.<init>(XPathContext.java:102) at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:207) at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:281) at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalizer.java:224) at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalizer.java:289) at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:134) at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:96) at com.sun.tools.xjc.reader.internalizer.DOMForest.transform(DOMForest.java:448) at com.sun.tools.xjc.ModelLoader.buildDOMForest(ModelLoader.java:342) at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:374) at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:167) at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:113) at org.jvnet.jaxb2.maven2.XJC2Mojo.runXJC(XJC2Mojo.java:1119) at org.jvnet.jaxb2.maven2.XJC2Mojo.execute(XJC2Mojo.java:720) ...
mvn -v:
# mvn -v Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500) Java version: 1.6.0_21 Java home: /usr/java/jdk1.6.0_21/jre Default locale: en_US,platform encoding: UTF-8 OS name: "linux" version: "2.6.33.3-85.fc13.x86_64" arch: "amd64" Family: "unix"
resolvent
Solution
The solution is to search the classpath for all the dependencies of xalan and xercesimpl These dependencies should be excluded
to update
I found the answer – see http://www.mail-archive.com/dev @qpid. apache. org/msg07295. html
Had a look at this closely and figured it was due to a classpath class due to Sun bundling an older version of Xalan jar. I have disabled this test until we come up with a decent solution. Rajith
The above is all the contents of the Java collected and sorted out by the programming house for you - converting dtmmanagerdefault into dtmmanager's ClassCastException during maven JAXB CodeGen. I hope this article can help you solve the program development problems encountered by Java - converting dtmmanagerdefault into dtmmanager's ClassCastException during maven JAXB CodeGen.
If you think the content of the programming home website is good, you are welcome to recommend the programming home website to programmers and friends.