[
https://issues.apache.org/jira/browse/AIRAVATA-2960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16749298#comment-16749298
]
Marcus Christie commented on AIRAVATA-2960:
-------------------------------------------
I've been able to partially replicate this locally by running
{noformat}
mvn clean test -Dtest=org.apache.airavata.replica.catalog.ReplicaCatalogTest
{noformat}
I think the following error message is particularly relevant:
{noformat}
1502 replicacatalog_data WARN [main] openjpa.Enhance - Unenhanced classes
were detected even though the enhancer has ran. Ensure that the
EntityManagerFactory is created prior to creating any Entities.
{noformat}
For some reason when {{mvn clean test}} is run in registry-core, the RepCatalog
EntityManagerFactory must be created before any replica catalog Entities are
created, but this isn't happening when running just the ReplicaCatalogTest. And
in Travis CI, perhaps the tests are run in a different order and
ReplicaCatalogTest is running before the replica catalog EntityManagerFactory
is created.
In any case, I can fix this by creating the EntityManagerFactory in
ReplicaCatalogTest.setUp (@BeforeClass method).
> Travis failure: ReplicaCatalogTest fails because classes aren't enhanced
> ------------------------------------------------------------------------
>
> Key: AIRAVATA-2960
> URL: https://issues.apache.org/jira/browse/AIRAVATA-2960
> Project: Airavata
> Issue Type: Bug
> Reporter: Marcus Christie
> Assignee: Marcus Christie
> Priority: Major
>
> An example build failure:
> https://travis-ci.org/apache/airavata/builds/467516942
> Relevant bit from the log:
> {noformat}
> 2704 replicacatalog_data WARN [main] openjpa.Enhance - Unenhanced classes
> were detected even though the enhancer has ran. Ensure that the
> EntityManagerFactory is created prior to creating any Entities.
> org.apache.airavata.registry.cpi.ReplicaCatalogException:
> <openjpa-2.4.3-r422266:1833086 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
> org.apache.airavata.registry.core.replica.catalog.model.DataProduct
> org.apache.airavata.registry.core.replica.catalog.model.DataProductMetaData
> org.apache.airavata.registry.core.replica.catalog.model.DataReplicaLocation".
> at
> org.apache.airavata.registry.core.replica.catalog.impl.ReplicaCatalogImpl.createDataProduct(ReplicaCatalogImpl.java:85)
> at
> org.apache.airavata.registry.core.replica.catalog.impl.ReplicaCatalogImpl.registerDataProduct(ReplicaCatalogImpl.java:71)
> at
> org.apache.airavata.replica.catalog.ReplicaCatalogTest.testReplicaCatalog(ReplicaCatalogTest.java:81)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
> at
> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
> at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> Caused by: <openjpa-2.4.3-r422266:1833086 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: This configuration
> disallows runtime optimization, but the following listed types were not
> enhanced at build time or at class load time with a javaagent: "
> org.apache.airavata.registry.core.replica.catalog.model.DataProduct
> org.apache.airavata.registry.core.replica.catalog.model.DataProductMetaData
> org.apache.airavata.registry.core.replica.catalog.model.DataReplicaLocation".
> at
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:115)
> at
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:311)
> at
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:235)
> at
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:211)
> at
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:154)
> at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:226)
> at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:153)
> at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:59)
> at
> org.apache.airavata.registry.core.replica.catalog.utils.ReplicaCatalogJPAUtils.getEntityManager(ReplicaCatalogJPAUtils.java:68)
> at
> org.apache.airavata.registry.core.replica.catalog.impl.ReplicaCatalogImpl.createDataProduct(ReplicaCatalogImpl.java:78)
> ... 28 more
> ********** TEAR DOWN ************
> Thu Dec 13 15:03:59 UTC 2018 : Apache Derby Network Server - 10.13.1.1 -
> (1765088) shutdown
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.701 sec <<<
> FAILURE! - in org.apache.airavata.replica.catalog.ReplicaCatalogTest
> testReplicaCatalog(org.apache.airavata.replica.catalog.ReplicaCatalogTest)
> Time elapsed: 3.296 sec <<< FAILURE!
> java.lang.AssertionError: null
> at org.junit.Assert.fail(Assert.java:86)
> at org.junit.Assert.fail(Assert.java:95)
> at
> org.apache.airavata.replica.catalog.ReplicaCatalogTest.testReplicaCatalog(ReplicaCatalogTest.java:97)
> {noformat}
> I've tried to reproduce this locally:
> * tried {{mvn clean install}}
> * tried deleting {{~/.m2}} and running {{mvn clean install}} in a fresh clone
> of the repo
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)