deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Kildén <karl.kil...@gmail.com>
Subject Re: Problem with Test-Control and openEJB
Date Fri, 18 Apr 2014 13:54:52 GMT
I found the problem.

I now use:

        <dependency>
            <groupId>org.apache.deltaspike.cdictrl</groupId>
            <artifactId>deltaspike-cdictrl-openejb</artifactId>
            <version>${ds.version}</version>
        </dependency>

instead of owb.


I also had to remove my code that manually booted the container because
that caused issues and was no longer needed.


On 18 April 2014 14:58, Karl Kildén <karl.kilden@gmail.com> wrote:

> Hello,
>
> I want to use Test-Control with openEJB embedded. I don't have any
> openwebbeans dependencies in my poms only:
>
>         <dependency>
>             <groupId>org.apache.openejb</groupId>
>             <artifactId>openejb-core</artifactId>
>             <version>4.6.0</version>
>             <scope>test</scope>
>         </dependency>
>
> And it pulls OpenWebBeans in as expected. I don't have any configuration
> done at all and I get the following problem in my HelloWorld test case with
> a very simple CDIBean:
>
> INFO: [finished] com.kildeen.ref.CoreTestTest#testGetHelloWorld
> apr 18, 2014 2:48:01 EM org.apache.webbeans.util.JNDIUtil unbind
> SEVERE: Need to specify class name in environment or system property, or
> as an applet parameter, or in an application resource file:
>  java.naming.factory.initia
>
>
> Project is available here:
> https://github.com/karlkilden/ref/tree/ref-simple (make sure to use
> ref-simple branch) and full stacktrace pasted below:
>
>
>
>
> com.intellij.rt.execution.junit.JUnitStarter -ideVersion5
> com.kildeen.ref.CoreTestTest
> apr 18, 2014 2:47:59 EM org.apache.webbeans.lifecycle.AbstractLifeCycle
> startApplication
> INFO: OpenWebBeans Container is starting...
> apr 18, 2014 2:47:59 EM org.apache.webbeans.plugins.PluginLoader startUp
> INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> file:/C:/projects/ref/core/impl/target/test-classes/META-INF/beans.xml
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> file:/C:/projects/ref/core/impl/target/classes/META-INF/beans.xml
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> file:/C:/projects/ref/core/api/target/classes/META-INF/beans.xml
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> jar:file:/C:/Users/Kalle/.m2/repository/org/apache/deltaspike/core/deltaspike-core-api/0.7-SNAPSHOT/deltaspike-core-api-0.7-SNAPSHOT.jar!/META-INF/beans.xml
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> jar:file:/C:/Users/Kalle/.m2/repository/org/apache/deltaspike/core/deltaspike-core-impl/0.7-SNAPSHOT/deltaspike-core-impl-0.7-SNAPSHOT.jar!/META-INF/beans.xml
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> jar:file:/C:/Users/Kalle/.m2/repository/org/apache/deltaspike/modules/deltaspike-jpa-module-api/0.7-SNAPSHOT/deltaspike-jpa-module-api-0.7-SNAPSHOT.jar!/META-INF/beans.xml
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> jar:file:/C:/Users/Kalle/.m2/repository/org/apache/deltaspike/modules/deltaspike-jpa-module-impl/0.7-SNAPSHOT/deltaspike-jpa-module-impl-0.7-SNAPSHOT.jar!/META-INF/beans.xml
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> jar:file:/C:/Users/Kalle/.m2/repository/org/apache/deltaspike/modules/deltaspike-security-module-api/0.7-SNAPSHOT/deltaspike-security-module-api-0.7-SNAPSHOT.jar!/META-INF/beans.xml
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> jar:file:/C:/Users/Kalle/.m2/repository/org/apache/deltaspike/modules/deltaspike-security-module-impl/0.7-SNAPSHOT/deltaspike-security-module-impl-0.7-SNAPSHOT.jar!/META-INF/beans.xml
> apr 18, 2014 2:47:59 EM
> org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery
> addWebBeansXmlLocation
> INFO: added beans.xml marker:
> jar:file:/C:/Users/Kalle/.m2/repository/org/apache/deltaspike/cdictrl/deltaspike-cdictrl-owb/0.7-SNAPSHOT/deltaspike-cdictrl-owb-0.7-SNAPSHOT.jar!/META-INF/beans.xml
> apr 18, 2014 2:48:00 EM org.apache.webbeans.util.JNDIUtil bind
> SEVERE: Unable to bind object with name : [java:comp/BeanManager]
> javax.naming.NoInitialContextException: Need to specify class name in
> environment or system property, or as an applet parameter, or in an
> application resource file:  java.naming.factory.initial
>  at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
>  at
> javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:344)
> at javax.naming.InitialContext.lookup(InitialContext.java:411)
>  at org.apache.webbeans.util.JNDIUtil.bind(JNDIUtil.java:62)
> at
> org.apache.webbeans.ee.common.services.JNDIServiceEnterpriseImpl.bind(JNDIServiceEnterpriseImpl.java:45)
>  at
> org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:169)
> at
> org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:128)
>  at
> org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:89)
> at
> org.apache.deltaspike.cdise.owb.OpenWebBeansContainerControl.boot(OpenWebBeansContainerControl.java:68)
>  at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareTestContext.applyBeforeClassConfig(CdiTestRunner.java:442)
> at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$BeforeClassStatement.evaluate(CdiTestRunner.java:347)
>  at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$AfterClassStatement.evaluate(CdiTestRunner.java:374)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>  at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.run(CdiTestRunner.java:129)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
>  at
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
> at
> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
>  at
> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:601)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
>
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class:
> org.apache.deltaspike.core.impl.message.MessageBundleExtension
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class:
> org.apache.deltaspike.core.impl.message.NamedMessageBundleInvocationHandler
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class:
> org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class: org.apache.deltaspike.core.impl.jmx.MBeanExtension
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class: org.apache.deltaspike.core.impl.config.ConfigurationExtension
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class:
> org.apache.deltaspike.jpa.impl.transaction.context.TransactionContextExtension
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class:
> org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class:
> org.apache.deltaspike.core.impl.exclude.CustomProjectStageBeanFilter
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class: org.apache.deltaspike.core.impl.exclude.GlobalAlternative
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class:
> org.apache.deltaspike.security.impl.extension.SecurityExtension
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ClassDeactivationUtils cacheResult
> INFO: class:
> org.apache.deltaspike.core.impl.exception.control.extension.ExceptionControlExtension
> activated=true
> apr 18, 2014 2:48:00 EM
> org.apache.deltaspike.core.util.ProjectStageProducer initProjectStage
> INFO: Computed the following DeltaSpike ProjectStage: Production
> apr 18, 2014 2:48:00 EM org.apache.webbeans.config.BeansDeployer
> validateInjectionPoints
> INFO: All injection points were validated successfully.
> apr 18, 2014 2:48:00 EM org.apache.webbeans.lifecycle.AbstractLifeCycle
> startApplication
> INFO: OpenWebBeans Container has started, it took [1213] ms.
>
> org.junit.ComparisonFailure:
> Expected :Hello, World!
> Actual   :hello
>  <Click to see difference>
> at org.junit.Assert.assertEquals(Assert.java:115)
>  at org.junit.Assert.assertEquals(Assert.java:144)
> at com.kildeen.ref.CoreTestTest.testGetHelloWorld(CoreTestTest.java:26)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>  at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>  at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareMethodInvoker.invokeMethod(CdiTestRunner.java:324)
> at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareMethodInvoker.evaluate(CdiTestRunner.java:296)
>  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
>  at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.runChild(CdiTestRunner.java:160)
> at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.runChild(CdiTestRunner.java:64)
>  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$BeforeClassStatement.evaluate(CdiTestRunner.java:348)
>  at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$AfterClassStatement.evaluate(CdiTestRunner.java:374)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>  at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.run(CdiTestRunner.java:129)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
>  at
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
> at
> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
>  at
> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
>
> apr 18, 2014 2:48:01 EM
> org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener
> testStarted
> INFO: [run] com.kildeen.ref.CoreTestTest#testGetHelloWorld
> apr 18, 2014 2:48:01 EM
> org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener
> testFailure
> INFO: [failed] com.kildeen.ref.CoreTestTest#testGetHelloWorld message:
> expected:<[Hello, World!]> but was:<[hello]>
> apr 18, 2014 2:48:01 EM
> org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener
> testFinished
> INFO: [finished] com.kildeen.ref.CoreTestTest#testGetHelloWorld
> apr 18, 2014 2:48:01 EM org.apache.webbeans.util.JNDIUtil unbind
> SEVERE: Need to specify class name in environment or system property, or
> as an applet parameter, or in an application resource file:
>  java.naming.factory.initial
> javax.naming.NoInitialContextException: Need to specify class name in
> environment or system property, or as an applet parameter, or in an
> application resource file:  java.naming.factory.initial
> at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
>  at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
> at
> javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:344)
>  at javax.naming.InitialContext.unbind(InitialContext.java:435)
> at org.apache.webbeans.util.JNDIUtil.unbind(JNDIUtil.java:86)
>  at
> org.apache.webbeans.ee.common.services.JNDIServiceEnterpriseImpl.unbind(JNDIServiceEnterpriseImpl.java:54)
> at
> org.apache.webbeans.lifecycle.AbstractLifeCycle.stopApplication(AbstractLifeCycle.java:159)
>  at
> org.apache.webbeans.web.lifecycle.WebContainerLifecycle.stopApplication(WebContainerLifecycle.java:99)
> at
> org.apache.deltaspike.cdise.owb.OpenWebBeansContainerControl.shutdown(OpenWebBeansContainerControl.java:94)
>  at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareTestContext.applyAfterClassConfig(CdiTestRunner.java:511)
> at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$AfterClassStatement.evaluate(CdiTestRunner.java:378)
>  at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.run(CdiTestRunner.java:129)
>  at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> at
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
>  at
> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
> at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
>  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
>
> apr 18, 2014 2:48:01 EM org.apache.webbeans.lifecycle.AbstractLifeCycle
> stopApplication
> SEVERE: An error occured while stopping the container.
> org.apache.webbeans.exception.WebBeansException: Unable to unbind object
> with name : java:comp/BeanManager
> at org.apache.webbeans.util.JNDIUtil.unbind(JNDIUtil.java:92)
>  at
> org.apache.webbeans.ee.common.services.JNDIServiceEnterpriseImpl.unbind(JNDIServiceEnterpriseImpl.java:54)
> at
> org.apache.webbeans.lifecycle.AbstractLifeCycle.stopApplication(AbstractLifeCycle.java:159)
>  at
> org.apache.webbeans.web.lifecycle.WebContainerLifecycle.stopApplication(WebContainerLifecycle.java:99)
> at
> org.apache.deltaspike.cdise.owb.OpenWebBeansContainerControl.shutdown(OpenWebBeansContainerControl.java:94)
>  at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareTestContext.applyAfterClassConfig(CdiTestRunner.java:511)
> at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$AfterClassStatement.evaluate(CdiTestRunner.java:378)
>  at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at
> org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.run(CdiTestRunner.java:129)
>  at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> at
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
>  at
> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
> at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
>  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: javax.naming.NoInitialContextException: Need to specify class
> name in environment or system property, or as an applet parameter, or in an
> application resource file:  java.naming.factory.initial
>  at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
>  at
> javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:344)
> at javax.naming.InitialContext.unbind(InitialContext.java:435)
>  at org.apache.webbeans.util.JNDIUtil.unbind(JNDIUtil.java:86)
> ... 17 more
>
>
> Process finished with exit code -1
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message