tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENEJB-2136) JUnit tests relying on 'OpenEjbContainer' and 'EJBContainerRule' fail under Java-9
Date Fri, 03 Nov 2017 12:33:00 GMT

    [ https://issues.apache.org/jira/browse/OPENEJB-2136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16237549#comment-16237549
] 

Romain Manni-Bucau commented on OPENEJB-2136:
---------------------------------------------

This is not that trivial but here is the story:

- upgrading to asm6 has no blocker (= doable)
- upgrading tomee to asm6 doesnt solve this issue, you need to upgrade all the stack (openjpa,
cxf, openejb, ....)
- xbean-asm6 support of java 9 is minimal (see the dev@geronimo thread where I explained what
I did on it)
- java 9 breaks all standalone (apploader) cases "by design" and java didnt provide any solution
to it so upgrade is not smooth + module handling will break with each versions the dependency
handling since it will require mjar releases
- previous point imply that tomee will need to move to toolchain plugin to be able to be compiled
to support libraries already moved to java 9 (like log ones)


> JUnit tests relying on 'OpenEjbContainer' and 'EJBContainerRule' fail under Java-9
> ----------------------------------------------------------------------------------
>
>                 Key: OPENEJB-2136
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-2136
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 7.0.4
>         Environment: OpenEJB: 7.0.4
> Java 9.0.1-U11 (Oracle)
> JUnit 4.12 and JUnit 5.0.1
> --
> IntelliJ 2017.2
> Maven 3.5.0, Surefire-Plugin 2.19.1
> MacOS 10.13
>            Reporter: Martin Wiesner
>            Priority: Major
>
> In a Java 9 environment, running a JUnit Test which is starting up an OpenEjbContainer
like so:
> {code:java}
> @Properties(
>         @Property(
>                 key = OpenEjbContainer.OPENEJB_EJBCONTAINER_CLOSE,
>                 value = OpenEjbContainer.OPENEJB_EJBCONTAINER_CLOSE_SINGLE))
> public class SomeJUnitTest {
>     static {
>         System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
>     }
>     @ClassRule
>     public static final EJBContainerRule CONTAINER_RULE = new EJBContainerRule();
>     @Rule
>     public final InjectRule injectRule = new InjectRule(this, CONTAINER_RULE);
>     @TestResource
>     private Context ctx;
>     // test methods skipped for better readability...
> }
> {code}
> I encounter the following stacktrace which causes the test class to fail immediately:
> {code:java}
> org.apache.openejb.OpenEjbContainer$InitializationException: java.lang.IllegalArgumentException
> 	at org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:377)
> 	at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
> 	at org.apache.openejb.junit.jee.statement.StartingStatement.before(StartingStatement.java:96)
> 	at org.apache.openejb.junit.jee.statement.DecoratingStatement.evaluate(DecoratingStatement.java:30)
> 	at org.apache.openejb.junit.jee.statement.DecoratingStatement.evaluate(DecoratingStatement.java:32)
> 	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> 	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
> 	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
> 	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
> 	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
> 	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
> Caused by: java.lang.IllegalArgumentException
> 	at org.apache.xbean.asm5.ClassReader.<init>(Unknown Source)
> 	at org.apache.xbean.asm5.ClassReader.<init>(Unknown Source)
> 	at org.apache.xbean.asm5.ClassReader.<init>(Unknown Source)
> 	at org.apache.openejb.util.AnnotationFinder.readClassDef(AnnotationFinder.java:299)
> 	at org.apache.openejb.util.AnnotationFinder.find(AnnotationFinder.java:164)
> 	at org.apache.openejb.config.DeploymentLoader.checkAnnotations(DeploymentLoader.java:2088)
> 	at org.apache.openejb.config.DeploymentLoader.discoverModuleType(DeploymentLoader.java:1971)
> 	at org.apache.openejb.config.DeploymentsResolver.processUrls(DeploymentsResolver.java:361)
> 	at org.apache.openejb.config.DeploymentsResolver.loadFromClasspath(DeploymentsResolver.java:257)
> 	at org.apache.openejb.config.ConfigurationFactory.getModulesFromClassPath(ConfigurationFactory.java:705)
> 	at org.apache.openejb.OpenEjbContainer$Provider.load(OpenEjbContainer.java:471)
> 	at org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:277)
> 	... 11 more
> {code}
> Reproducible in several runtime environments: _IntelliJ Idea 2017_ and _Maven 3.3.9_
or _Maven 3.5.0_ 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message