-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
7.1.1.Final
-
None
Based on the following arquillian test case:
@RunWith(Arquillian.class)
@RunAsClient
public class RemoteDatabaseIntegratorTest {
@Deployment(testable=false)
public static JavaArchive createTestArchive()
@ArquillianResource
private Context context;
private static final String JNDI_LOC = "java:module/RemoteDatabaseIntegratorImpl";
private static final String[] JNDI_LOCS =
{ //"java:global/myejb/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator", //"java:app/myejb/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator", "java:module/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator", "java:jboss/exported/myejb/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator", //"java:global/myejb/RemoteDatabaseIntegratorImpl", //"java:app/myejb/RemoteDatabaseIntegratorImpl", "java:module/RemoteDatabaseIntegratorImpl" };
@Test
public void testDbServiceInjectionFailure() throws Exception{
//Thread.sleep(1000000);
//context.addToEnvironment(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.as.naming.InitialContextFactory");
Hashtable<String,String> env = new Hashtable<String,String>();
//env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.as.naming.InitialContextFactory");
env.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447");
//env.put(Context.SECURITY_PRINCIPAL, "anon");
//env.put(Context.SECURITY_CREDENTIALS, "anon123");
Context context = new InitialContext(env);
for(String JNDI_LOC : JNDI_LOCS) {
try
catch (Exception e)
{ System.out.println("Failed to lookup by "+JNDI_LOC); e.printStackTrace(); } }
}
}
I can see the JNDI locations populated, but cannot be retrieved, based on the following error:
20:19:02,743 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-7) JNDI bindings for session bean named RemoteDatabaseIntegratorImpl in deployment unit deployment "myejb.jar" are as follows:
java:global/myejb/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator
java:app/myejb/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator
java:module/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator
java:jboss/exported/myejb/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator
java:global/myejb/RemoteDatabaseIntegratorImpl
java:app/myejb/RemoteDatabaseIntegratorImpl
java:module/RemoteDatabaseIntegratorImpl
20:19:02,912 INFO [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "myejb.jar"
Failed to lookup by java:module/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator
javax.naming.NameNotFoundException: java:module/RemoteDatabaseIntegratorImpl!com.tad.arquillian.chp5.remoteejb.RemoteDatabaseIntegrator
at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:117)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at com.tad.arquillian.chp5.ejb.RemoteDatabaseIntegratorTest.testDbServiceInjectionFailure(RemoteDatabaseIntegratorTest.java:62)
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:270)
at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
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.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:53)
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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)