4 Replies Latest reply on Apr 3, 2014 8:34 AM by randahl

    Can't connect to EJBs after migrating to WildFly

    randahl

      In short:

       

      1. Can anyone confirm that they have succesfully migrated their EJBs to WildFly 8 and are still able to connect to them from a remote client?

      2. Are you still connecting to port 4447 or is it now port 8080?

      3. Did you change anything in standalone.xml to make the connection work?

       

      I am asking, because I am having a hard time connecting from my remote client to my EJBs after I migrated to WildFly 8.0.0 Final.

       

      I used to connect to my EJBs on port 4447, but when doing so I simply get a timeout with this exception:

       

      java.lang.RuntimeException: Operation failed with status WAITING

        at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:94)

       

      I did a comparison of the standalone.xml configuration files of JBoss 7.2 and WildFly 8. In the old file the standard sockets section contain this configuration

       

          <socket-binding-group name="standard-sockets" default-interface="any" port-offset="${jboss.socket.binding.port-offset:0}">

              <socket-binding name="remoting" port="4447"/>

       

      This socket binding seems to be used by JBoss's remoting-connector configured here

       

              <subsystem xmlns="urn:jboss:domain:remoting:1.1">

                  <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>

              </subsystem>

       

      Now, when looking for this WildFly 8's standalone.xml it seems this remoting configuration have been replaced by

       

              <subsystem xmlns="urn:jboss:domain:remoting:2.0">

                  <endpoint worker="default"/>

                  <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>

       

      This gave me a clue that the port 4447 has been replaced with port 8080. So now I have tried connecting using this simple test code

       

        properties.put("endpoint.name", "client-endpoint");

        properties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");

        properties.put("remote.connections", "default");

        properties.put("remote.connection.default.host", "127.0.0.1");

        properties.put("remote.connection.default.port", "8080");

        properties.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");

        properties.put("remote.connection.default.username", "test");

        properties.put("remote.connection.default.password", "1234");

        final EJBClientConfiguration configuration =

        new PropertiesBasedEJBClientConfiguration(properties);

        final ContextSelector<EJBClientContext> selector =

        new ConfigBasedEJBClientContextSelector(configuration);

        EJBClientContext.setSelector(selector);

       

      However, with this code I get the following exception

       

      Caused by: java.lang.IllegalStateException: EJBCLIENT000024: No EJB receiver available for handling [appName:wefend-server, moduleName:wefend-ejb, distinctName:] combination

        at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:813)

        at org.jboss.ejb.client.EJBClient.createSessionWithPossibleRetries(EJBClient.java:222)

        at org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:202)

        at org.jboss.ejb.client.naming.ejb.EjbNamingContext.doCreateProxy(EjbNamingContext.java:216)

        at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:193)

        • 1. Re: Can't connect to EJBs after migrating to WildFly
          ctomc

          Hey,

           

          you have two options in WildFly to make remoting working again.

           

          1) upgrade your client libs to newer ones, especially jboss-remoting, this way you will get support for http-remoting aka remoting based on http upgrade.

          2) add <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/> back to remoting subsystem, this way you will again get 4447 port working with remoting protocol.

           

           

          --

          tomaz

          1 of 1 people found this helpful
          • 2. Re: Can't connect to EJBs after migrating to WildFly
            randahl

            My intention is to upgrade. I have already changed my remoting dependency to the following:

             

              <dependency>

              <groupId>org.wildfly</groupId>

              <artifactId>wildfly-ejb-client-bom</artifactId>

              <type>pom</type>

              <version>8.0.0.Final</version>

              </dependency>

             

            This replaces jboss-remoting-3.2.3.GA.jar with jboss-remoting-4.0.0.Final.jar among my dependencies, which should be sufficient right?

            • 3. Re: Can't connect to EJBs after migrating to WildFly
              jaikiran

              The bom should bring in the correct dependencies and version. However, just that snippet won't be enough to confirm that you have the right client jar versions. You'll need the EJB client jar corresponding to 8.0.0.Final too (and of course other dependencies).

              1 of 1 people found this helpful
              • 4. Re: Can't connect to EJBs after migrating to WildFly
                randahl

                I finally solved this by creating a separate, simplified test project and cutting the configuration down to a minimum. So indeed 8080 is the new port, you need the new client jars as others have said, and you need to make sure you are using proper credentials.