9 Replies Latest reply on Mar 6, 2013 10:17 AM by robert.w

    Changing default remote port 4447 doesn't work

    robert.w Newbie

      Hi,

       

      On my Jboss 7.1.1 instance, I tried to change the default remote port 4447 by changing the standalone-full.xml:

      (...)

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

              <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

              <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

              <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>

              <socket-binding name="ajp" port="8009"/>

              <socket-binding name="http" port="56080"/>

              <socket-binding name="https" port="8443"/>

              <socket-binding name="jacorb" interface="unsecure" port="3528"/>

              <socket-binding name="jacorb-ssl" interface="unsecure" port="3529"/>

              <socket-binding name="messaging" port="5445"/>

              <socket-binding name="messaging-throughput" port="5455"/>

              <socket-binding name="osgi-http" interface="management" port="8090"/>

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

              <socket-binding name="txn-recovery-environment" port="4712"/>

              <socket-binding name="txn-status-manager" port="4713"/>

              <outbound-socket-binding name="mail-smtp">

                  <remote-destination host="localhost" port="25"/>

              </outbound-socket-binding>

          </socket-binding-group>

      (...)

       

      and the domain.xml:

      (...)

              <socket-binding-group name="full-sockets" default-interface="public">

                  <!-- Needed for server groups using the 'full' profile  -->

                  <socket-binding name="ajp" port="8009"/>

                  <socket-binding name="http" port="56080"/>

                  <socket-binding name="https" port="8443"/>

                  <socket-binding name="jacorb" interface="unsecure" port="3528"/>

                  <socket-binding name="jacorb-ssl" interface="unsecure" port="3529"/>

                  <socket-binding name="messaging" port="5445"/>

                  <socket-binding name="messaging-throughput" port="5455"/>

                  <socket-binding name="osgi-http" interface="management" port="8090"/>

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

                  <socket-binding name="txn-recovery-environment" port="4712"/>

                  <socket-binding name="txn-status-manager" port="4713"/>

                  <outbound-socket-binding name="mail-smtp">

                      <remote-destination host="localhost" port="25"/>

                  </outbound-socket-binding>

              </socket-binding-group>

      (...)

       

      My Java code to connect is like this:

         Hashtable jndiProps = new Hashtable();
         jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
         jndiProps.put(InitialContext.PROVIDER_URL, "remote://localhost:56099");
         jndiProps.put(Context.SECURITY_PRINCIPAL, "guest");
         jndiProps.put(Context.SECURITY_CREDENTIALS, "blank");

         Context ic = new InitialContext(jndiProps);

         cf = (ConnectionFactory) ic.lookup("jms/RemoteConnectionFactory");
         Queue queue = (Queue) ic.lookup(destinationName);

         connection = cf.createConnection();

       

      I get following error logging:

       

      10:20:32,682 ERROR [stderr] (http-localhost-127.0.0.1-56080-1) javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "deployment.helloworld.war:main" from Service Module Loader

      10:20:32,683 ERROR [stderr] (http-localhost-127.0.0.1-56080-1)  at org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:64)

      10:20:32,683 ERROR [stderr] (http-localhost-127.0.0.1-56080-1)  at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

      10:20:32,683 ERROR [stderr] (http-localhost-127.0.0.1-56080-1)  at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

      10:20:32,684 ERROR [stderr] (http-localhost-127.0.0.1-56080-1)  at javax.naming.InitialContext.init(Unknown Source)

      10:20:32,685 ERROR [stderr] (http-localhost-127.0.0.1-56080-1)  at javax.naming.InitialContext.<init>(Unknown Source)

       

      If I change the port back to 4447, the Java code works. Is there some other config file I have to change or isn't it possible to change the remote port?

       

      Thanks, Robert