-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
EAP_EWP 5.2.0
-
None
-
-
Workaround Exists
-
-
NEW
If a stateful session bean has multiple remote bindings, its proxy client sometimes uses the one that is bound to a different JNDI name.
For example, the following jboss.xml defines Hello EJB that has 2 bindings; "myHello" for usual JNP and "Hello/http" for JNDI over HTTP.
<jboss xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.com/j2ee/schema/jboss_5_0.xsd" version="3.0"> <enterprise-beans> <session> <ejb-name>Hello</ejb-name> <remote-binding> <jndi-name>myHello</jndi-name> </remote-binding> <remote-binding> <jndi-name>Hello/http</jndi-name> <client-bind-url> http://${jboss.bind.address}:8080/unified-invoker/Ejb3ServerInvokerServlet/?return-exception=true </client-bind-url> </remote-binding> </session> </enterprise-beans> </jboss>
And its client looks up "myHello" which doesn't use HTTP.
Hashtable<String, String> env = new Hashtable<String, String>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); env.put(Context.PROVIDER_URL, "localhost:1100,localhost:1200"); env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); InitialContext ctx = new InitialContext(env); Object obj = ctx.lookup("myHello");
This lookup sometimes fails if you haven't set up http-uinvoker on your cluster.
Exception in thread "main" javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1551) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:869) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713) at javax.naming.InitialContext.lookup(InitialContext.java:411) at MyTestClient.main(MyTestClient.java:18) Caused by: java.lang.reflect.UndeclaredThrowableException at com.sun.proxy.$Proxy1.createProxyBusiness(Unknown Source) at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129) at org.jboss.ejb3.proxy.clustered.objectfactory.session.stateful.StatefulSessionClusteredProxyObjectFactory.getProxy(StatefulSessionClusteredProxyObjectFactory.java:65) at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321) at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1526) at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1543) ... 4 more Caused by: org.jboss.remoting.transport.http.WebServerError: <html><head><title>JBoss Web/2.1.13.GA-patch-01 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /unified-invoker/Ejb3ServerInvokerServlet/</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/unified-invoker/Ejb3ServerInvokerServlet/</u></p><p><b>description</b> <u>The requested resource (/unified-invoker/Ejb3ServerInvokerServlet/) is not available.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.13.GA-patch-01</h3></body></html> at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:497) at org.jboss.remoting.transport.http.HTTPClientInvoker.makeInvocation(HTTPClientInvoker.java:253) at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:176) at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:169) at org.jboss.remoting.Client.invoke(Client.java:2084) at org.jboss.remoting.Client.invoke(Client.java:879) at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:122) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:104) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.remoting.ClusteredPojiProxy.invoke(ClusteredPojiProxy.java:79) at com.sun.proxy.$Proxy1.createProxyBusiness(Unknown Source) at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129) at org.jboss.ejb3.proxy.clustered.objectfactory.session.stateful.StatefulSessionClusteredProxyObjectFactory.getProxy(StatefulSessionClusteredProxyObjectFactory.java:65) at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321) at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1526) at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1543) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:869) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713) at javax.naming.InitialContext.lookup(InitialContext.java:411) at MyTestClient.main(MyTestClient.java:18) at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:122) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:104) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.remoting.ClusteredPojiProxy.invoke(ClusteredPojiProxy.java:79) ... 11 more
- is related to
-
EJBTHREE-2174 Clustered session proxies load balance across different bindings on the same server
-
- Open
-