[ http://jira.codehaus.org/browse/MPCHECKSTYLE-53?page=comments#action_58083 ]
Bernard Durfee commented on MPCHECKSTYLE-53: -------------------------------------------- Actually, I think there is a change that should be made in the plugin.jelly file, before executing the Ant 'style' task (line 235), there should be a line line... {code} ${systemScope.setProperty('javax.xml.transform.TransformerFactory','org.apache.xalan.processor.TransformerFactoryImpl')} {code} ...which will change the system property to make sure JAXP returns the Xalan transformer factory to Ant, because the "style" tag requires Xalan specifically. I made the change locally and it works fine. Also, maybe you'll need to add Xalan as a dependency for the plugin, since it uses the Ant "style" tag, which requires Xalan. Really this is an Ant problem, since it should use only standard JAXP methods. But since it requires Xalan, now so does the CheckStyle Plugin. > ClassCastException when moving from 2.5 to 3.0 > ---------------------------------------------- > > Key: MPCHECKSTYLE-53 > URL: http://jira.codehaus.org/browse/MPCHECKSTYLE-53 > Project: maven-checkstyle-plugin > Type: Bug > Versions: 3.0 > Environment: Windows/Linux > Java 5.0 > Maven 1.x > Reporter: Bernard Durfee > Fix For: 3.0.1 > > > The error I get... > BUILD FAILED > File...... > /home/cruisecontrol/.maven/cache/maven-checkstyle-plugin-3.0/plugin.jelly > Element... style > Line...... 238 > Column.... 59 > java.lang.ClassCastException: > org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser > ...is usually caused when an application is specifically looking for Xerces > classes, instead of always going through JAXP interfaces and factories. > My application uses XSLT 2.0 features, which are not supported by > Xerces/Xalan. So I have a file in my JDK lib directory named > "jaxp.properties"... > {code} > # JAXP Factories > javax.xml.parsers.SAXParserFactory = oracle.xml.jaxp.JXSAXParserFactory > javax.xml.parsers.DocumentBuilderFactory = > oracle.xml.jaxp.JXDocumentBuilderFactory > javax.xml.transform.TransformerFactory = > oracle.xml.jaxp.JXSAXTransformerFactory > {code} > ...which causes the JDK to default to the Oracle parser, which supports XSLT > 2.0. > My hunch is that somewhere in the code the JAXP TransformerFactory is called, > which returns the Oracle object, but someone is assuming that the Xerces > object will be returned and are casting the object to get at some Xerces > specific feature. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]