Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-2174

Clustered session proxies load balance across different bindings on the same server

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • Clustering
    • None

    Description

      With a bean config like this:

      <session>
      <ejb-name>HelloBean</ejb-name>
      <remote-binding>
      <jndi-name>HelloBean/http</jndi-name>
      <client-bind-url>
                http://${jboss.bind.address}:8080/unified-invoker/Ejb3ServerInvokerServlet/?return-exception=true
      </client-bind-url>
      </remote-binding>
      <remote-binding>
      <jndi-name>HelloBean/https</jndi-name>
      <client-bind-url>
                https://${jboss.bind.address}:8443/unified-invoker/SSLEjb3ServerInvokerServlet/?return-exception=true
      </client-bind-url>
      </remote-binding>
      </session> 
      

      and client code like this:

           51     Properties p = new Properties();
           52     p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
           53     p.put(Context.PROVIDER_URL, "http://localhost:8080/unified-invoker/JNDIFactory/?return-exception=true");
           54     p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
           55     Context ctx = new InitialContext(p);
           56 
           57     //Hello bean = (Hello) ctx.lookup("ProxyFactory/helloWorld/HelloBean/HelloBean/http");
           58     Object o = ctx.lookup("HelloBean/http");
      

      there is sometimes an attempt to connect via the HTTPS URL, which indicates the clustered proxy sees the https binding as a 2nd target.

      Stack trace showing the attempt to use HTTPS:

      test:
           [java] 17:20:02,578 ERROR [HTTPClientInvoker] Error creating SSL Socket Factory for client invoker: Error initializing socket factory SSL context: Can not find truststore url.
      Leads to:    
           [java] javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: cluster invocation failed, last exception was: ]
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1504)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
           [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
           [java]     at com.jboss.examples.ejb3.client.Client.testHTTPHA(Client.java:58)
           [java]     at com.jboss.examples.ejb3.client.Client.main(Client.java:25)
           [java] Caused by: java.lang.RuntimeException: cluster invocation failed, last exception was:
           [java]     at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:173)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:104)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.aspects.remoting.ClusteredPojiProxy.invoke(ClusteredPojiProxy.java:79)
           [java]     at $Proxy1.createProxyBusiness(Unknown Source)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129)
           [java]     at org.jboss.ejb3.proxy.clustered.objectfactory.session.SessionClusteredProxyObjectFactory.getProxy(SessionClusteredProxyObjectFactory.java:89)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)
           [java]     at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
           [java]     ... 5 more
           [java] Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker after 1 attempt(s)
           [java]     at org.jboss.remoting.transport.http.HTTPClientInvoker.makeInvocation(HTTPClientInvoker.java:250)
           [java]     at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:162)
           [java]     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:167)
           [java]     at org.jboss.remoting.Client.invoke(Client.java:1927)
           [java]     at org.jboss.remoting.Client.invoke(Client.java:770)
           [java]     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:84)
           [java]     ... 16 more
           [java] Caused by: java.net.ConnectException: Connection refused
           [java]     at java.net.PlainSocketImpl.socketConnect(Native Method)
           [java]     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
           [java]     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
           [java]     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
           [java]     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
           [java]     at java.net.Socket.connect(Socket.java:529)
           [java]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
           [java]     at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
           [java]     at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
           [java]     at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
           [java]     at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:272)
           [java]     at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
           [java]     at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
           [java]     at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
           [java]     at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
           [java]     at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:904)
           [java]     at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
           [java]     at org.jboss.remoting.transport.http.HTTPClientInvoker.getOutputStream(HTTPClientInvoker.java:1245)
           [java]     at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:346)
           [java]     at org.jboss.remoting.transport.http.HTTPClientInvoker.makeInvocation(HTTPClientInvoker.java:232)
           [java]     at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:162)
           [java]     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:167)
           [java]     at org.jboss.remoting.Client.invoke(Client.java:1927)
           [java]     at org.jboss.remoting.Client.invoke(Client.java:770)
           [java]     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.aspects.remoting.ClusterChooserInterceptor.invoke(ClusterChooserInterceptor.java:84)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:104)
           [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           [java]     at org.jboss.aspects.remoting.ClusteredPojiProxy.invoke(ClusteredPojiProxy.java:79)
           [java]     at $Proxy1.createProxyBusiness(Unknown Source)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129)
           [java]     at org.jboss.ejb3.proxy.clustered.objectfactory.session.SessionClusteredProxyObjectFactory.getProxy(SessionClusteredProxyObjectFactory.java:89)
           [java]     at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)
           [java]     at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
           [java]     at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
           [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
           [java]     at com.jboss.examples.ejb3.client.Client.testHTTPHA(Client.java:58)
           [java]     at com.jboss.examples.ejb3.client.Client.main(Client.java:25)
           [java]     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
           [java]     ... 18 more
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: