Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1603

InitialContext instantiation fails with ERROR - CDI Beans module deployment failed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.5.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mac OS X Snow Leopard, Persistence Provider: Eclipselink 2.2.0

      Description

      The latest OpenEJB 4.0-SNAPSHOT cannot start InitialContext with the following properties in JUnit test:

      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
      ctx = new InitialContext(p);

      Following stacktrace:
      java.lang.IllegalStateException: Statement should never be reached
      at org.apache.openejb.cdi.CdiPlugin.isStatefulBean(CdiPlugin.java:218)
      at org.apache.webbeans.config.DefinitionUtil.defineBeanInterceptorStack(DefinitionUtil.java:1207)
      at org.apache.openejb.cdi.BeansDeployer.validate(BeansDeployer.java:255)
      at org.apache.openejb.cdi.BeansDeployer.validateInjectionPoints(BeansDeployer.java:222)
      at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:254)
      at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:59)
      at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:49)
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:691)
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:466)
      at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:376)
      at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:288)
      at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:130)
      at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:63)
      at org.apache.openejb.OpenEJB.init(OpenEJB.java:276)
      at org.apache.openejb.OpenEJB.init(OpenEJB.java:255)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
      at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
      at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
      at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
      at javax.naming.InitialContext.init(InitialContext.java:223)
      at javax.naming.InitialContext.<init>(InitialContext.java:197)
      at fi.samcom.test.ejb.AbstractEJBTest.setUp(AbstractEJBTest.java:125)
      at fi.samcom.test.ejb.AbstractEclipselinkEJBTest.setUp(AbstractEclipselinkEJBTest.java:21)
      at fi.samcom.ptj.service.impl.calendar.CalendarServiceImplTest.setUp(CalendarServiceImplTest.java:35)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
      at $Proxy0.invoke(Unknown Source)
      at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
      at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
      org.apache.openejb.OpenEJBException: Creating application failed: /Users/antti/Documents/workspace/project/core/classpath.ear: couldn't start owb context
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:794)
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:466)
      at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:376)
      at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:288)
      at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:130)
      at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:63)
      at org.apache.openejb.OpenEJB.init(OpenEJB.java:276)
      at org.apache.openejb.OpenEJB.init(OpenEJB.java:255)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
      at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
      at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
      at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
      at javax.naming.InitialContext.init(InitialContext.java:223)
      at javax.naming.InitialContext.<init>(InitialContext.java:197)
      at fi.samcom.test.ejb.AbstractEJBTest.setUp(AbstractEJBTest.java:125)
      at fi.samcom.test.ejb.AbstractEclipselinkEJBTest.setUp(AbstractEclipselinkEJBTest.java:21)
      at fi.samcom.ptj.service.impl.calendar.CalendarServiceImplTest.setUp(CalendarServiceImplTest.java:35)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
      at $Proxy0.invoke(Unknown Source)
      at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
      at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
      Caused by: java.lang.RuntimeException: couldn't start owb context
      at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:61)
      at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:49)
      at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:691)
      ... 52 more
      Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Statement should never be reached
      at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:276)
      at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:59)
      ... 54 more
      Caused by: java.lang.IllegalStateException: Statement should never be reached
      at org.apache.openejb.cdi.CdiPlugin.isStatefulBean(CdiPlugin.java:218)
      at org.apache.webbeans.config.DefinitionUtil.defineBeanInterceptorStack(DefinitionUtil.java:1207)
      at org.apache.openejb.cdi.BeansDeployer.validate(BeansDeployer.java:255)
      at org.apache.openejb.cdi.BeansDeployer.validateInjectionPoints(BeansDeployer.java:222)
      at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:254)
      ... 55 more

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              antionio Antti Kolehmainen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: