From dev-return-19734-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Wed Nov 30 13:18:07 2011 Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 81CC1944D for ; Wed, 30 Nov 2011 13:18:07 +0000 (UTC) Received: (qmail 6486 invoked by uid 500); 30 Nov 2011 13:18:07 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 6442 invoked by uid 500); 30 Nov 2011 13:18:06 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 6433 invoked by uid 99); 30 Nov 2011 13:18:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2011 13:18:06 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2011 13:18:01 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 296F1A8D86 for ; Wed, 30 Nov 2011 13:17:40 +0000 (UTC) Date: Wed, 30 Nov 2011 13:17:40 +0000 (UTC) From: "Vermeulen (Commented) (JIRA)" To: dev@openjpa.apache.org Message-ID: <1438712769.26001.1322659060171.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1265479679.9652.1319479592113.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (OPENJPA-2063) OpenJPA Maven plugin's enhancer doesn't include test output directory when enhancing during process-test-classes phase MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-2063?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13= 160024#comment-13160024 ]=20 Vermeulen commented on OPENJPA-2063: ------------------------------------ Hello! I compared your plugin configuration with the one we are using. We u= se test-enhance instead of your enhance, maybe th= is is the problem? =20 > OpenJPA Maven plugin's enhancer doesn't include test output directory whe= n enhancing during process-test-classes phase > -------------------------------------------------------------------------= --------------------------------------------- > > Key: OPENJPA-2063 > URL: https://issues.apache.org/jira/browse/OPENJPA-2063 > Project: OpenJPA > Issue Type: Bug > Components: Enhance, tooling > Affects Versions: 2.1.1 > Environment: Win7 64-bit, javac 1.6.0_26, Apache Maven 2.2.1 (r80= 1777; 2009-08-06 14:16:01-0500), openjpa-maven-plugin 1.2 > Reporter: Matthew T. Adams > Labels: enhancement, maven, process-test-classes > Attachments: openjpa-maven-plugin-bug.zip > > > I'm attempting to enhance via the maven plugin entities that are in src/t= est/java & that are compiled to target/test-classes. The persistence.xml f= ile is also located under target/test-classes (since it comes from src/test= /resources/META-INF/persistence.xml). Enhancement is failing because .../t= arget/test-classes is not on the classpath that the enhancer uses (see trac= e below). > Steps to reproduce: > 1. Create a Maven project that includes OpenJPA dependencies & the Maven = OpenJPA plugin. > 2. Create an @Entity class in src/test/java/org/example/entity/Foo.java. = Note this is in src/test/java, not src/main/java. > 3. Put a persistence.xml file in src/test/resources/META-INF/persistence.= xml that names Foo as an entity: > > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation=3D"http://java.sun.com/xml/ns/persistence http://j= ava.sun.com/xml/ns/persistence/persistence_2_0.xsd" > version=3D"2.0"> > transaction-type=3D"RESOURCE_LOCAL"> > org.example.entity.Foo > true > > > 4. Configure the openjpa-maven-plugin as below. Note phase is "process-t= est-classes" & classes argument is "${project.build.testOutputDirectory}". > > org.codehaus.mojo > openjpa-maven-plugin > 1.2 > > > enhancer > process-test-classes > > enhance > > > > > ${project.build.testOutputDirectory}= > > > 5. Issue maven command "mvn -X clean test". > 6. Suspicion of missing classpath element ".../target/test-classes" is fu= rther reinforced if you include the plugin argument an= d set its value to "${project.build.testOutputDirectory}/META-INF/persisten= ce.xml". Plugin then finds persistence.xml, but complains about not findin= g class Foo (which it can't because the plug-in doesn't include .../target/= test-classes on the classpath at enhancement time). > MAVEN OUTPUT TRACE: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > [DEBUG] Configuring mojo 'org.codehaus.mojo:openjpa-maven-plugin:1.2:enha= nce' --> > [DEBUG] (f) addDefaultConstructor =3D true > [DEBUG] (f) classes =3D C:\Perforce\p4serv1.online.ea.com_1999\matthewa= dams_win7\nucleus\SANDBOX\madams\nextgen\shard-test-example\target\test-cla= sses > [DEBUG] (f) compileClasspathElements =3D [C:\Perforce\p4serv1.online.ea= .com_1999\matthewadams_win7\nucleus\SANDBOX\madams\nextgen\shard-test-examp= le\target\classes, C:\Users\madams\.m2\repository\org\eclipse\persistence\j= avax.persistence\2.0.0\javax.persistence-2.0.0.jar, C:\Users\madams\.m2\rep= ository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA.ja= r, C:\Users\madams\.m2\repository\org\hibernate\hibernate-validator\4.1.0.F= inal\hibernate-validator-4.1.0.Final.jar, C:\Users\madams\.m2\repository\or= g\slf4j\slf4j-api\1.6.2\slf4j-api-1.6.2.jar, C:\Users\madams\.m2\repository= \org\springframework\spring-context-support\3.1.0.RC1\spring-context-suppor= t-3.1.0.RC1.jar, C:\Users\madams\.m2\repository\org\springframework\spring-= beans\3.1.0.RC1\spring-beans-3.1.0.RC1.jar, C:\Users\madams\.m2\repository\= org\springframework\spring-core\3.1.0.RC1\spring-core-3.1.0.RC1.jar, C:\Use= rs\madams\.m2\repository\org\springframework\spring-asm\3.1.0.RC1\spring-as= m-3.1.0.RC1.jar, C:\Users\madams\.m2\repository\commons-logging\commons-log= ging\1.1.1\commons-logging-1.1.1.jar, C:\Users\madams\.m2\repository\org\sp= ringframework\spring-context\3.1.0.RC1\spring-context-3.1.0.RC1.jar, C:\Use= rs\madams\.m2\repository\org\springframework\spring-aop\3.1.0.RC1\spring-ao= p-3.1.0.RC1.jar, C:\Users\madams\.m2\repository\aopalliance\aopalliance\1.0= \aopalliance-1.0.jar, C:\Users\madams\.m2\repository\org\springframework\sp= ring-expression\3.1.0.RC1\spring-expression-3.1.0.RC1.jar, C:\Users\madams\= .m2\repository\org\springframework\spring-orm\3.1.0.RC1\spring-orm-3.1.0.RC= 1.jar, C:\Users\madams\.m2\repository\org\springframework\spring-jdbc\3.1.0= .RC1\spring-jdbc-3.1.0.RC1.jar, C:\Users\madams\.m2\repository\org\springfr= amework\spring-tx\3.1.0.RC1\spring-tx-3.1.0.RC1.jar, C:\Users\madams\.m2\re= pository\cglib\cglib\2.2.2\cglib-2.2.2.jar, C:\Users\madams\.m2\repository\= asm\asm\3.3.1\asm-3.3.1.jar, C:\Users\madams\.m2\repository\commons-dbcp\co= mmons-dbcp\1.2.2\commons-dbcp-1.2.2.jar, C:\Users\madams\.m2\repository\com= mons-pool\commons-pool\1.3\commons-pool-1.3.jar, C:\Users\madams\.m2\reposi= tory\log4j\log4j\1.2.16\log4j-1.2.16.jar, C:\Users\madams\.m2\repository\or= g\slf4j\slf4j-log4j12\1.6.2\slf4j-log4j12-1.6.2.jar, C:\Users\madams\.m2\re= pository\org\apache\openjpa\openjpa\2.1.1\openjpa-2.1.1.jar, C:\Users\madam= s\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar, C:\Use= rs\madams\.m2\repository\commons-collections\commons-collections\3.2.1\comm= ons-collections-3.2.1.jar, C:\Users\madams\.m2\repository\net\sourceforge\s= erp\serp\1.13.1\serp-1.13.1.jar, C:\Users\madams\.m2\repository\org\apache\= geronimo\specs\geronimo-jms_1.1_spec\1.1.1\geronimo-jms_1.1_spec-1.1.1.jar,= C:\Users\madams\.m2\repository\org\apache\geronimo\specs\geronimo-jta_1.1_= spec\1.1.1\geronimo-jta_1.1_spec-1.1.1.jar, C:\Users\madams\.m2\repository\= org\apache\derby\derby\10.8.1.2\derby-10.8.1.2.jar] > [DEBUG] (f) enforcePropertyRestrictions =3D false > [DEBUG] (f) forceMojoExecution =3D false > [DEBUG] (f) includes =3D **/*.class > [DEBUG] (f) project =3D MavenProject: org.example:shard-test:1.0.1.CI-S= NAPSHOT @ C:\Perforce\p4serv1.online.ea.com_1999\matthewadams_win7\nucleus\= SANDBOX\madams\nextgen\shard-test-example\pom.xml > [DEBUG] (f) skip =3D false > [DEBUG] (f) tmpClassLoader =3D false > [DEBUG] (f) toolProperties =3D {} > [DEBUG] -- end configuration -- > [INFO] [openjpa:enhance {execution: enhancer}] > [DEBUG] Added classpathElement URL file:/C:/Perforce/p4serv1.online.ea.co= m_1999/matthewadams_win7/nucleus/SANDBOX/madams/nextgen/shard-test-example/= target/classes/ > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/eclipse/persistence/javax.persistence/2.0.0/javax.persistence-2.0.0.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/j= avax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/hibernate/hibernate-validator/4.1.0.Final/hibernate-validator-4.1.0.Fina= l.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/slf4j/slf4j-api/1.6.2/slf4j-api-1.6.2.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-context-support/3.1.0.RC1/spring-context-support-= 3.1.0.RC1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-beans/3.1.0.RC1/spring-beans-3.1.0.RC1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-core/3.1.0.RC1/spring-core-3.1.0.RC1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-asm/3.1.0.RC1/spring-asm-3.1.0.RC1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/c= ommons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-context/3.1.0.RC1/spring-context-3.1.0.RC1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-aop/3.1.0.RC1/spring-aop-3.1.0.RC1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/a= opalliance/aopalliance/1.0/aopalliance-1.0.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-expression/3.1.0.RC1/spring-expression-3.1.0.RC1.= jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-orm/3.1.0.RC1/spring-orm-3.1.0.RC1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-jdbc/3.1.0.RC1/spring-jdbc-3.1.0.RC1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/springframework/spring-tx/3.1.0.RC1/spring-tx-3.1.0.RC1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/c= glib/cglib/2.2.2/cglib-2.2.2.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/a= sm/asm/3.3.1/asm-3.3.1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/c= ommons-dbcp/commons-dbcp/1.2.2/commons-dbcp-1.2.2.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/c= ommons-pool/commons-pool/1.3/commons-pool-1.3.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/l= og4j/log4j/1.2.16/log4j-1.2.16.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/slf4j/slf4j-log4j12/1.6.2/slf4j-log4j12-1.6.2.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/apache/openjpa/openjpa/2.1.1/openjpa-2.1.1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/c= ommons-lang/commons-lang/2.4/commons-lang-2.4.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/c= ommons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/n= et/sourceforge/serp/serp/1.13.1/serp-1.13.1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/apache/geronimo/specs/geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-= 1.1.1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/apache/geronimo/specs/geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-= 1.1.1.jar > [DEBUG] Added classpathElement URL file:/C:/Users/madams/.m2/repository/o= rg/apache/derby/derby/10.8.1.2/derby-10.8.1.2.jar > [INFO] ------------------------------------------------------------------= ------ > [ERROR] FATAL ERROR > [INFO] ------------------------------------------------------------------= ------ > [INFO] MetaDataFactory could not be configured (conf.newMetaDataFactoryIn= stance() returned null). This might mean that no configuration properties w= ere found. Ensure that you have a META-INF/persistence.xml file, that it is= available in your classpath, or that the properties file you are using for= configuration is available. If you are using Ant, please see the or attributes of the task's nested element. T= his can also occur if your OpenJPA distribution jars are corrupt, or if you= r security policy is overly strict. > [INFO] ------------------------------------------------------------------= ------ > [DEBUG] Trace > org.apache.openjpa.util.M= etaDataException: MetaDataFactory could not be configured (conf.newMetaData= FactoryInstance() returned null). This might mean that no configuration pro= perties were found. Ensure that you have a META-INF/persistence.xml file, t= hat it is available in your classpath, or that the properties file you are = using for configuration is available. If you are using Ant, please see the = or attributes of the task's nested e= lement. This can also occur if your OpenJPA distribution jars are corrupt, = or if your security policy is overly strict. > =09at org.apache.openjpa.meta.MetaDataRepository.initializeMetaDataFactor= y(MetaDataRepository.java:1873) > =09at org.apache.openjpa.meta.MetaDataRepository.endConfiguration(MetaDat= aRepository.java:1854) > =09at org.apache.openjpa.lib.conf.Configurations.configureInstance(Config= urations.java:507) > =09at org.apache.openjpa.lib.conf.Configurations.configureInstance(Config= urations.java:432) > =09at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.jav= a:104) > =09at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDat= aRepositoryValue.java:68) > =09at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.jav= a:83) > =09at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataReposit= oryInstance(OpenJPAConfigurationImpl.java:939) > =09at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4618) > =09at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4600) > =09at org.apache.openjpa.enhance.PCEnhancer$1.run(PCEnhancer.java:4570) > =09at org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configura= tions.java:725) > =09at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Con= figurations.java:710) > =09at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4565) > =09at org.codehaus.mojo.openjpa.AbstractOpenJpaEnhancerMojo.enhance(Abstr= actOpenJpaEnhancerMojo.java:136) > =09at org.codehaus.mojo.openjpa.AbstractOpenJpaEnhancerMojo.execute(Abstr= actOpenJpaEnhancerMojo.java:95) > =09at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlu= ginManager.java:490) > =09at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(De= faultLifecycleExecutor.java:694) > =09at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWith= Lifecycle(DefaultLifecycleExecutor.java:556) > =09at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Def= aultLifecycleExecutor.java:535) > =09at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndH= andleFailures(DefaultLifecycleExecutor.java:387) > =09at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegm= ents(DefaultLifecycleExecutor.java:348) > =09at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(Default= LifecycleExecutor.java:180) > =09at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) > =09at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) > =09at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) > =09at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java= :60) > =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp= l.java:39) > =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc= essorImpl.java:25) > =09at java.lang.reflect.Method.invoke(Method.java:597) > =09at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) > =09at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) > =09at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:43= 0) > =09at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > [INFO] ------------------------------------------------------------------= ------ > [INFO] Total time: 4 seconds > [INFO] Finished at: Mon Oct 24 12:42:06 CDT 2011 > [INFO] Final Memory: 32M/265M > [INFO] ------------------------------------------------------------------= ------ -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira