3 Replies Latest reply: Aug 2, 2011 6:36 PM by Michal Huniewicz RSS

RuntimeException after upgrading to JBoss 7.0.0: No EjbLookup registry has been provided

Juergen Zimmermann Master

After upgrading from JBossAS 7.0.0.CR1 to 7.0.0.Final I get the stacktrace below. The test class basically looks as follows:

 

@RunWith(Arquillian.class)

public class EineMethodeTest extends AbstractTest {

    @EJB

    private Kundenverwaltung kv; ...

}

 

public abstract class AbstractTest {

    @Deployment

    public static EnterpriseArchive createTestArchive() {...}...

}

 

The referenced session bean:

@Stateless

public class Kundenverwaltung implements Serializable {

...

}

 

ERROR jmx.JMXMethodExecutor - Failed: de.swe.test.EineMethodeTest.addAndRemoveRolle

java.lang.RuntimeException: Could not inject members

    at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.injectClass(CDIInjectionEnricher.java:135)

    at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.enrich(CDIInjectionEnricher.java:78)

    at org.jboss.arquillian.test.impl.TestInstanceEnricher.enrich(TestInstanceEnricher.java:52)

    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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

    at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

    at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:82)

    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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

    at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)

    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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

    at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)

    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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

    at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)

    at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:198)

    at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)

    at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)

    at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:216)

    at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:110)

    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.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:161)

    at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)

    at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)

    at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)

    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

    at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)

    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)

    at org.junit.runner.JUnitCore.run(JUnitCore.java:136)

    at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)

    at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:152)

    at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodRemote(JMXTestRunner.java:112)

    at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethodRemote(ArquillianService.java:205)

    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 com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)

    at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)

    at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)

    at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)

    at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)

    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)

    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)

    at org.jboss.as.jmx.tcl.TcclMBeanServer.invoke(TcclMBeanServer.java:214)

    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)

    at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)

    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)

    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)

    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)

    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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)

    at sun.rmi.transport.Transport$1.run(Transport.java:159)

    at java.security.AccessController.doPrivileged(Native Method)

    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

Caused by: java.lang.RuntimeException: No EjbLookup registry has been provided CDI @EJB injection [field] @EJB private de.swe.test.EineMethodeTest.kv

    at org.jboss.as.weld.services.bootstrap.WeldEjbInjectionServices.resolveEjb(WeldEjbInjectionServices.java:108)

    at org.jboss.weld.util.Beans.injectEEFields(Beans.java:775)

    at org.jboss.weld.manager.SimpleInjectionTarget$1.proceed(SimpleInjectionTarget.java:119)

    at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:54)

    at org.jboss.weld.manager.SimpleInjectionTarget.inject(SimpleInjectionTarget.java:114)

    at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.injectNonContextualInstance(CDIInjectionEnricher.java:145)

    at org.jboss.arquillian.testenricher.cdi.CDIInjectionEnricher.injectClass(CDIInjectionEnricher.java:125)

    ... 89 more

  • 1. Re: RuntimeException after upgrading to JBoss 7.0.0: No EjbLookup registry has been provided
    Stuart Douglas Master

    This is a known regression that ocurred between CR1 and Final, it is fixed upstream.

     

    There are 2 workarounds, either use @EJB(lookup="portable ejb JNDI name"), or use @Inject to inject the ejb.

     

    This should be fixed in a 7.0.1 release

  • 2. Re: RuntimeException after upgrading to JBoss 7.0.0: No EjbLookup registry has been provided
    Juergen Zimmermann Master

    Each workaround throws an exception like this one:

     

    15:26:17,114 ERROR [org.xnio.listener] (XNIO NIO Read 4) A channel event listener threw an exception: java.util.concurrent.RejectedExecutionException
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1768) [:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767) [:1.6.0_26]
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658) [:1.6.0_26]
    at org.jboss.remoting3.remote.RemoteReadListener$1.handleEvent(RemoteReadListener.java:48)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:71)
    at org.xnio.channels.TranslatingSuspendableChannel$5.handleEvent(TranslatingSuspendableChannel.java:132)
    at org.xnio.channels.TranslatingSuspendableChannel$5.handleEvent(TranslatingSuspendableChannel.java:130)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:71)
    at org.xnio.nio.AbstractNioStreamChannel.invokeCloseHandler(AbstractNioStreamChannel.java:234)
    at org.xnio.nio.NioTcpChannel.close(NioTcpChannel.java:141)
    at org.xnio.nio.NioTcpChannel.shutdownReads(NioTcpChannel.java:153)
    at org.xnio.channels.TranslatingSuspendableChannel.shutdownReads(TranslatingSuspendableChannel.java:347)
    at org.xnio.channels.FramedMessageChannel.shutdownReads(FramedMessageChannel.java:199)
    at org.jboss.remoting3.remote.RemoteConnection.handleIncomingCloseRequest(RemoteConnection.java:140)
    at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:83)
    at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:40)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:71)
    at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:173)
    at org.xnio.channels.TranslatingSuspendableChannel$2.handleEvent(TranslatingSuspendableChannel.java:94)
    at org.xnio.channels.TranslatingSuspendableChannel$2.handleEvent(TranslatingSuspendableChannel.java:92)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:71)
    at org.xnio.nio.NioHandle.invoke(NioHandle.java:77)
    at org.xnio.nio.AbstractNioChannelThread$1.run(AbstractNioChannelThread.java:142)
    at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

  • 3. Re: RuntimeException after upgrading to JBoss 7.0.0: No EjbLookup registry has been provided
    Michal Huniewicz Newbie

    I just had that problem and resolved it by referencing the @EJB annotation with @Inject in the test.