2 Replies Latest reply on Oct 1, 2013 7:02 AM by ihatetoregister

    Remote connection of Jboss 7 server fails with Proxy exception

    ihatetoregister

      I have a Jboss 7 server running & accepting secure connections on port 443.

       

      All along i was testing locally which was working fine . However now when i make connection attempts i get a

      "javax.naming.NamingException: Failed to create proxy [Root exception is java.lang.IllegalStateException: ..." .

      I tried to follow what is written @ https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI

       

      I guess my jndi.properties & jboss-ejb-client.properties file need changes . I think i got it right but still no success . Can someone have a look at these files .

      1 ) jndi.properties

      java.naming.factory.url.pkgs=org.jboss.ejb.client.naming

       

      2 ) jboss-ejb-client.properties

       

      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

       

      remote.connections=default

       

      remote.connection.default.host=sinrndvwd200.gem.com

      remote.connection.default.port = 4447

      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false


      I tried using a combination of port 443 4447 but nothing works . Also when i deploy this application locally by changing the remote.connection.default.host=localthost then the application runs correctly . Hence i assume my ejb names,module names , etc are correct .

      Here is my call to the ejb

       

      InitialContext aJNDI = new InitialContext();
        
      Ppi handle = (Ppi) aJNDI
        
      .lookup("ejb:PPIEAR/PService/PConnect!com.gem.p.PConnection?stateful"
      );


      Can anyone please help me here ?

        • 1. Re: Remote connection of Jboss 7 server fails with Proxy exception
          jaikiran

          If it's failing against a remote machine then it's a sign that the authentication against the server during the connection creation is failing. I don't see in the code you posted any username and password that you are passing.

          • 2. Re: Remote connection of Jboss 7 server fails with Proxy exception
            ihatetoregister

            Jai , reading up at the various Jboss 7 documents i realised that due to the increased security I will need to provide a username / password combo . So i updated my code ( no longer using the jndi.properties file ) to send the user name password combo

             

                    final Hashtable jndiProperties = new Hashtable();
                    jndiProperties.put(Context.SECURITY_PRINCIPAL,"fxxxd");
                    jndiProperties.put(Context.SECURITY_CREDENTIALS, "c1795063026432fd040da7a6c73c0321");
                    jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
                   InitialContext annuaireJNDI = new InitialContext(jndiProperties);
              

             

            My question is that is the username /. password the same that is present in the mgmt.user.properties file on the server ?

             

            Also my server is protected by a legitimate SSL certificate which also has a username password combo . Hence I am totally confused which one is the combo that i need to use here on the client side to connect .

             

            Also reading about the properties of the jboss_ejb_client.protperites file @ Overview of Client properties - EJB Client Library (AS7+) - Project Documentation Editor  i think i need to change

            1) remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false to TRUE

            2 ) remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false to TRUE


            However currently i get the following exception :

             

            - Could not register a EJB receiver for connection to remote://10.160.148.61:4447

            java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

             

            However if i set SSL_ENabled = true then I get an error - JBREM000200: Remote connection failed: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

             

            Can you suggest anything . I feel confused regarding this