tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Wiesner (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OPENEJB-2136) JUnit tests relying on 'OpenEjbContainer' and 'EJBContainerRule' fail under Java-9
Date Fri, 03 Nov 2017 10:53:01 GMT
Martin Wiesner created OPENEJB-2136:
---------------------------------------

             Summary: 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
         Environment: JUnit 4.12 and JUnit 5.0.1
Java 9.0.1-U11 (Oracle)
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