You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Bernard Durfee (JIRA)" <ji...@codehaus.org> on 2006/02/07 16:23:48 UTC

[jira] Created: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

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


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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MPCHECKSTYLE-53?page=comments#action_58093 ] 

Lukas Theussl commented on MPCHECKSTYLE-53:
-------------------------------------------

I used this version for compatibility with other plugins.
We are considering upgrading xalan (see the comments at MPPDF-51), but we need to do a lot more testing.

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

Posted by "Bernard Durfee (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MPCHECKSTYLE-53?page=comments#action_58064 ] 

Bernard Durfee commented on MPCHECKSTYLE-53:
--------------------------------------------

{code}
checkstyle:report-internal:
    [mkdir] Created dir: c:\eclipse-workspace\CAT\target\generated-xdocs\checkstyle
    [style] Processing c:\eclipse-workspace\CAT\target\checkstyle\checkstyle-raw-report.xml to C:\eclipse-workspace\CAT\target\checkstyle\checkstyle-summary-report.xml
    [style] Loading stylesheet c:\Documents and Settings\home\.maven\cache\maven-checkstyle-plugin-3.0\plugin-resources\checkstyle-summary.xsl
    [style] Failed to process C:\eclipse-workspace\CAT\target\checkstyle\checkstyle-raw-report.xml

BUILD FAILED
java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser
	at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:534)
	at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:239)
	at org.apache.tools.ant.Task.perform(Task.java:341)
	at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:185)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
	at com.werken.werkz.Goal.fire(Goal.java:639)
	at com.werken.werkz.Goal.attain(Goal.java:575)
	at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
	at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:127)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
	at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
	at com.werken.werkz.Goal.fire(Goal.java:639)
	at com.werken.werkz.Goal.attain(Goal.java:575)
	at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
	at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:127)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
	at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
	at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:145)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
	at com.werken.werkz.Goal.fire(Goal.java:639)
	at com.werken.werkz.Goal.attain(Goal.java:575)
	at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
	at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:127)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
	at com.werken.werkz.Goal.fire(Goal.java:639)
	at com.werken.werkz.Goal.attain(Goal.java:575)
	at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:671)
	at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263)
	at org.apache.maven.cli.App.doMain(App.java:488)
	at org.apache.maven.cli.App.main(App.java:1239)
	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:585)
	at com.werken.forehead.Forehead.run(Forehead.java:551)
	at com.werken.forehead.Forehead.main(Forehead.java:581)
Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser
	at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:208)
	at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:193)
	at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:527)
	... 55 more
--- Nested Exception ---
java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser
	at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:208)
	at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:193)
	at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:527)
	at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:239)
	at org.apache.tools.ant.Task.perform(Task.java:341)
	at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:185)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
	at com.werken.werkz.Goal.fire(Goal.java:639)
	at com.werken.werkz.Goal.attain(Goal.java:575)
	at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
	at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:127)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
	at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
	at com.werken.werkz.Goal.fire(Goal.java:639)
	at com.werken.werkz.Goal.attain(Goal.java:575)
	at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
	at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:127)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
	at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
	at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:145)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
	at com.werken.werkz.Goal.fire(Goal.java:639)
	at com.werken.werkz.Goal.attain(Goal.java:575)
	at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
	at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:127)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
	at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
	at com.werken.werkz.Goal.fire(Goal.java:639)
	at com.werken.werkz.Goal.attain(Goal.java:575)
	at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:671)
	at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263)
	at org.apache.maven.cli.App.doMain(App.java:488)
	at org.apache.maven.cli.App.main(App.java:1239)
	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:585)
	at com.werken.forehead.Forehead.run(Forehead.java:551)
	at com.werken.forehead.Forehead.main(Forehead.java:581)
File...... c:\home\.maven\cache\maven-checkstyle-plugin-3.0\plugin.jelly
Element... style
Line...... 238
Column.... 59
java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser
{code}

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

Posted by "Bernard Durfee (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MPCHECKSTYLE-53?page=comments#action_58092 ] 

Bernard Durfee commented on MPCHECKSTYLE-53:
--------------------------------------------

Yep, that worked. Although my personal preference is to use the latest version of stuff like Xalan, which is 2.7.0. I don't know if it matters much though.

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Updated: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPCHECKSTYLE-53?page=all ]

Arnaud Heritier updated MPCHECKSTYLE-53:
----------------------------------------

    Fix Version: 3.0.1

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MPCHECKSTYLE-53?page=comments#action_58086 ] 

Lukas Theussl commented on MPCHECKSTYLE-53:
-------------------------------------------

I have deployed a new snapshot, please test:

maven plugin:download -Dmaven.repo.remote=http://www.ibiblio.org/maven,http://cvs.apache.org/repository/ -DgroupId=maven -DartifactId=maven-checkstyle-plugin -Dversion=3.0.1-SNAPSHOT

Thanks!

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPCHECKSTYLE-53?page=all ]
     
Lukas Theussl closed MPCHECKSTYLE-53:
-------------------------------------

    Resolution: Fixed

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

Posted by "Bernard Durfee (JIRA)" <ji...@codehaus.org>.
    [ 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MPCHECKSTYLE-53?page=comments#action_58077 ] 

Lukas Theussl commented on MPCHECKSTYLE-53:
-------------------------------------------

It's not a problem with checkstyle itself but with ant's style task that is used to transform the results. Did you load the oracle dependency in the root classloader? See http://maven.apache.org/maven-1.x/faq.html#BadXSLT



> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MPCHECKSTYLE-53) ClassCastException when moving from 2.5 to 3.0

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MPCHECKSTYLE-53?page=comments#action_58061 ] 

Arnaud Heritier commented on MPCHECKSTYLE-53:
---------------------------------------------

Can you give us the full stacktrace with the -e option. Thanks

> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org