openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: ClassCastException on maven enhancing
Date Wed, 17 Dec 2014 02:22:52 GMT
Trenton -

Sorry I'm not much help, but I have no idea what's going on. Please let us
know if/when you figure out what is causing this problem.

Thanks,
Rick

On Tue, Dec 16, 2014 at 8:07 PM, Trenton D. Adams <trent@trentonadams.ca>
wrote:
>
> Hi Rick,
>
> I'm using Java 1.7 and tomcat 6.
>
> I'm really not sure what is wrong.  I checked out old revisions, which I
> know could at least deploy to tomcat, and they do not work either now.
> That makes me wonder about my environment, but I don't know what it could
> be.  I did review the xerces libraries coming in using the maven -X
> parameter, and they are all 2.4.0.
>
> It's just all very strange.  I did, unfortunately, have open ended
> versions on some of my plugins in my poms, which I fixed yesterday, but I'm
> wondering if it's possible that something was released, which messed it up
> on me.  I'm going to go find out which plugins those were, and see if I can
> push back the versions used and see what happens.
>
> The full stack trace is below...
> [ERROR] Failed to execute goal org.codehaus.mojo:openjpa-maven-plugin:1.1:enhance
> (enhancer) on project webdirectory: Execution enhancer of goal
> org.codehaus.mojo:openjpa-maven-plugin:1.1:enhance failed:
> org.apache.openjpa.persistence.PersistenceProductDerivation:java.lang.ClassCastException:
> org.apache.xerces.parsers.XML11Configuration cannot be cast to
> org.apache.xerces.xni.parser.XMLParserConfiguration -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
> goal org.codehaus.mojo:openjpa-maven-plugin:1.1:enhance (enhancer) on
> project webdirectory: Execution enhancer of goal org.codehaus.mojo:openjpa-maven-plugin:1.1:enhance
> failed: org.apache.openjpa.persistence.PersistenceProductDerivation:java.lang.ClassCastException:
> org.apache.xerces.parsers.XML11Configuration cannot be cast to
> org.apache.xerces.xni.parser.XMLParserConfiguration
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:224)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:153)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:145)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.
> executeForkedExecutions(MojoExecutor.java:364)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:198)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:153)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:145)
>     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.
> buildProject(LifecycleModuleBuilder.java:116)
>     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.
> buildProject(LifecycleModuleBuilder.java:80)
>     at org.apache.maven.lifecycle.internal.builder.singlethreaded.
> SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.
> execute(LifecycleStarter.java:120)
>     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
>     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
>     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
>     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
>     at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:57)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.
> launchEnhanced(Launcher.java:289)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.
> launch(Launcher.java:229)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.
> mainWithExitCode(Launcher.java:415)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.
> main(Launcher.java:356)
> Caused by: org.apache.maven.plugin.PluginExecutionException: Execution
> enhancer of goal org.codehaus.mojo:openjpa-maven-plugin:1.1:enhance
> failed: org.apache.openjpa.persistence.PersistenceProductDerivation:java.lang.ClassCastException:
> org.apache.xerces.parsers.XML11Configuration cannot be cast to
> org.apache.xerces.xni.parser.XMLParserConfiguration
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(
> DefaultBuildPluginManager.java:143)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:208)
>     ... 23 more
> Caused by: java.util.MissingResourceException: org.apache.openjpa.
> persistence.PersistenceProductDerivation:java.lang.ClassCastException:
> org.apache.xerces.parsers.XML11Configuration cannot be cast to
> org.apache.xerces.xni.parser.XMLParserConfiguration
>     at org.apache.openjpa.lib.conf.ProductDerivations.reportErrors(
> ProductDerivations.java:381)
>     at org.apache.openjpa.lib.conf.ProductDerivations.
> getFullyQualifiedAnchorsInPropertiesLocation(ProductDerivations.java:434)
>     at org.apache.openjpa.lib.conf.Configurations.
> getFullyQualifiedAnchorsInPropertiesLocation(Configurations.java:326)
>     at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(
> Configurations.java:738)
>     at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4795)
>     at org.codehaus.mojo.openjpa.AbstractOpenJpaEnhancerMojo.enhance(
> AbstractOpenJpaEnhancerMojo.java:136)
>     at org.codehaus.mojo.openjpa.AbstractOpenJpaEnhancerMojo.execute(
> AbstractOpenJpaEnhancerMojo.java:95)
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(
> DefaultBuildPluginManager.java:132)
>     ... 24 more
> Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration
> cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
>     at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
>     at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
>     at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
>     at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown
> Source)
>     at org.apache.openjpa.lib.xml.XMLFactory.getSAXParser(
> XMLFactory.java:81)
>     at org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(
> XMLMetaDataParser.java:400)
>     at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(
> XMLMetaDataParser.java:347)
>     at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(
> XMLMetaDataParser.java:324)
>     at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(
> XMLMetaDataParser.java:297)
>     at org.apache.openjpa.persistence.PersistenceProductDerivation$
> ConfigurationParser.parse(PersistenceProductDerivation.java:811)
>     at org.apache.openjpa.persistence.PersistenceProductDerivation.
> getAnchorsInResource(PersistenceProductDerivation.java:423)
>     at org.apache.openjpa.lib.conf.ProductDerivations.
> getFullyQualifiedAnchorsInPropertiesLocation(ProductDerivations.java:405)
>     ... 30 more
>
>
> On 2014-12-16 6:46 PM, Rick Curtis wrote:
>
>> What jvm/version are you using? Have you tried to debug to see where the
>> multiple versions of Xerces are coming from?
>>
>> On Tue, Dec 16, 2014 at 6:21 PM, Trenton D. Adams <trent@trentonadams.ca>
>> wrote:
>>
>>> Good day,
>>>
>>> I have a maven build.  When I run "mvn install" my unit tests run just
>>> fine, as does the enhancer...
>>> [INFO] --- openjpa-maven-plugin:1.1:enhance (enhancer) @ webdirectory
>>> ---
>>> 66  athome  INFO   [main] openjpa.Tool - Enhancer running on type
>>> "ca.tnt.athome.Town".
>>> 190  athome  INFO   [main] openjpa.Tool - Enhancer running on type
>>> "ca.tnt.athome.HouseListing".
>>>
>>> But, when I run "mvn install tomcat:deploy", the enhancer plugin tries to
>>> run again, and this...
>>>
>>> [INFO] --- openjpa-maven-plugin:1.1:enhance (enhancer) @ webdirectory
>>> ---
>>> An error occurred while attempting to determine the version of
>>> "file:/home/trenta/LocalDocuments/development/java/athome/web-directory/
>>> target/classes/META-INF/persistence.xml".
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [INFO] BUILD FAILURE
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [INFO] Total time: 9.535 s
>>> [INFO] Finished at: 2014-12-16T17:18:11-07:00
>>> [INFO] Final Memory: 13M/218M
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [ERROR] Failed to execute goal org.codehaus.mojo:openjpa-
>>> maven-plugin:1.1:enhance
>>> (enhancer) on project webdirectory: Execution enhancer of goal
>>> org.codehaus.mojo:openjpa-maven-plugin:1.1:enhance failed:
>>> org.apache.openjpa.persistence.PersistenceProductDerivation:
>>> java.lang.ClassCastException:
>>> org.apache.xerces.parsers.XML11Configuration cannot be cast to
>>> org.apache.xerces.xni.parser.XMLParserConfiguration -> [Help 1]
>>>
>>> I've been googling, and trying to debug this for awhile, and just don't
>>> know what it is.  Any ideas?
>>>
>>> Maven plugin configuration below.
>>>
>>>        <plugin>
>>>          <groupId>org.codehaus.mojo</groupId>
>>>          <artifactId>openjpa-maven-plugin</artifactId>
>>>          <version>1.1</version>
>>>          <configuration>
>>>            <includes>**/entities/*.class</includes>
>>>            <excludes>**/entities/XML*.class</excludes>
>>> <addDefaultConstructor>true</addDefaultConstructor>
>>> <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
>>>          </configuration>
>>>          <executions>
>>>            <execution>
>>>              <id>enhancer</id>
>>>              <phase>process-classes</phase>
>>>              <goals>
>>>                <goal>enhance</goal>
>>>              </goals>
>>>            </execution>
>>>          </executions>
>>>          <dependencies>
>>>            <dependency>
>>>              <groupId>org.apache.openjpa</groupId>
>>>              <artifactId>openjpa-all</artifactId>
>>>              <version>2.3.0</version>
>>>            </dependency>
>>>          </dependencies>
>>>        </plugin>
>>>
>>>
>>
>

-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message