Topic
10 replies Latest Post - ‏2011-06-08T07:30:10Z by SystemAdmin
SystemAdmin
SystemAdmin
462 Posts
ACCEPTED ANSWER

Pinned topic Unable to lookup a remote EJB running on a WAS 7.0

‏2011-05-25T12:44:18Z |
Hi,

I have tried to invoke a remote EJB running on a WAS 7.0.

The Code to lookup the EJB looks like:
Hashtable env = new HashTable();
env.put("java.naming.provider.url", "corbaloc:iiop:vwas6d.tirol.local:9818");
env.put("java.naming.factory.initial", "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put("java.naming.security.principal", "serviceuser");
env.put("java.naming.security.credentials", "pw");
InitialContext ctx = new InitialContext(env);
ctx.lookup("cell/nodes/vwas6dNode01/servers/JcrServer/ejb/at/gv/tirol/common/jcr/ejb/sessionbeans/JcrSessionFacadeHome");

I get a Exception like:
25.05.11 14:36:17:232 CEST 00000023 SystemOut O ERROR at.gv.tirol.common.web.jsf.apptools.reporting.ReportHandler.javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "corbaloc:iiop:vwas6d.tirol.local:9818". Make sure that any bootstrap address information in the URL is correct and that the target name server is running. A bootstrap address with no port specification defaults to port 2809. Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. Root exception is org.omg.CORBA.TRANSIENT: java.net.SocketTimeoutException: connect timed out:host=vwas6d.tirol.local,port=9818 vmcid: IBM minor code: E06 completed: No

I have enabled the OrbTrace and Diagnostic Trace with following Level:
*=info:ORBRas=all:Naming=all.

I will attach the Trace File.

So what do i make wrong ? This Code works fine if we run the Application on WAS 7.0 but on WAS 8.0 we get the Exception ?

thanks in advice
claus

Attachments

Updated on 2011-06-08T07:30:10Z at 2011-06-08T07:30:10Z by SystemAdmin
  • WillEdwards
    WillEdwards
    6 Posts
    ACCEPTED ANSWER

    Re: Unable to lookup a remote EJB running on a WAS 7.0

    ‏2011-05-26T14:36:26Z  in response to SystemAdmin
    Your provider URL looks suspicious:

    corbaloc:iiop:vwas6d.tirol.local:9818

    Is vwas6d.tirol.local really your hostname?

    Regards,
    Will Edwards
  • WillEdwards
    WillEdwards
    6 Posts
    ACCEPTED ANSWER

    Re: Unable to lookup a remote EJB running on a WAS 7.0

    ‏2011-05-26T20:09:00Z  in response to SystemAdmin
    Sorry, I did not notice that you said this same code works in a 7.0 to 7.0 configuration. You did not say whether the 8.0 client was running on the same host as the 7.0 client. If they are not, then of course you need to make sure you have connectivity to the bootstrap address and other server ports in play. If the 8.0 client is running on the same host or if you are sure your 8.0 host has the required connectivity to the 7.0 server, this is something the ORB team would have to look into.

    Regards,
    Will Edwards
    • SystemAdmin
      SystemAdmin
      462 Posts
      ACCEPTED ANSWER

      Re: Unable to lookup a remote EJB running on a WAS 7.0

      ‏2011-05-27T05:46:03Z  in response to WillEdwards
      Hi William,

      Thank you for your replies.
      Ok more informations about the configuration.

      I run a JSF Application on my localhost in RAD 8.0.2 with RAD 8.0 BetaRefresh March.
      The "simple" Code to lookup a remote EJB works fine in every Application running on WAS 7.0 or 6.1 against that host (vwas6d).

      The remote EJB runs on a WAS 7.0 on the host vwas6d.tirol.local, (tirol.local) is the domain name so the host name alone is vwas6d :-)...

      All ports to this host are open. As described above the same code executed in a Application running on WAS 7.0 or 6.0 works fine.
      If you need more informations or any configuration file please feel free to contact me.

      thanks for any help

      claus
      • WillEdwards
        WillEdwards
        6 Posts
        ACCEPTED ANSWER

        Re: Unable to lookup a remote EJB running on a WAS 7.0

        ‏2011-05-27T15:25:10Z  in response to SystemAdmin
        Hi Claus,

        I will contact the ORB support person and ask her to take a look. There is some problem with your 8.0 client making the connection with the 7.0 server. That's why I was asking about host name resolution and ports.

        Regards,
        Will Edwards
        • ClaudiaB
          ClaudiaB
          1 Post
          ACCEPTED ANSWER

          Re: Unable to lookup a remote EJB running on a WAS 7.0

          ‏2011-05-27T20:51:25Z  in response to WillEdwards
          Hi Claus, The client trace shows the failure is due to a connect timeout when trying to establish a new connection to the server at 10.10.128.115:9818. The connect timeout value is 10 secs. This means that the client sent a SYN packet to the server in attempt to establish a tcp 3-way handshake and the server never responded with a SYN-ACK. Check the connectivity from the client to the server (can you telnet to the 9818 endpoint from the client?) Was the server actually up and listening on the 9818 port when the client was attempting this connection? It's possible that the connectTimeout needs to be increased if the server is under heavy load (and unable to respond immediately) or if the network speed is slow.
          For problems such as these a matching client-server orb/naming trace is needed. And since this is an issue with establishing a new connection, a network trace taken on both the client and server would also confirm if there are network issues.
          Claudia (IBM ORB support)
          • SystemAdmin
            SystemAdmin
            462 Posts
            ACCEPTED ANSWER

            Re: Unable to lookup a remote EJB running on a WAS 7.0

            ‏2011-05-30T07:27:32Z  in response to ClaudiaB
            Hi Claudia,

            I tried a telnet and it works fine to the 10.10.128.115:9818.
            The Server is (was) not under heavy load and the network speed is also very high so i think
            that could not be the problem.

            I will take a network trace on both servers to find out if we have really a problem with the network components.

            JFYI we have the security enabled on both servers and running SSO so maybe the problem has something to do with that ?

            if i can take some traces for you please contact me.

            thanks
            claus
            • SystemAdmin
              SystemAdmin
              462 Posts
              ACCEPTED ANSWER

              Re: Unable to lookup a remote EJB running on a WAS 7.0

              ‏2011-05-31T08:57:43Z  in response to SystemAdmin
              Hi,

              I have made some tests and found the problem. I have looked into the WSTCPTransportConnection Class where the SocketTimeOutException will be thrown.
              The code in the createSocket(InetSocketAddress server, InetSocketAddress client) Method looks like:

              Socket socket = new Socket();
              socket.bind(client);
              socket.connect(server, 10000);

              The client InetSocketAddress hostname is "localHost" and the ip is "127.0.0.1" and this is the Problem.
              If i try a code like this in my Application i get the same Exception on connect.

              InetSocketAddress server = new InetSocketAddress("vwas6d.tirol.local", 9818);
              InetSocketAddress client = new InetSocketAddress("localHost", 0);
              Socket socket = new Socket();
              socket.bind(client);
              socket.connect(server, 10000);

              but if i try this it works fine and i can connect to the remote server.
              The ip in the client InetSocketAddress is with this code "0.0.0.0"

              InetSocketAddress server = new InetSocketAddress("vwas6d.tirol.local", 9818);
              //****** Without a HostName !!!
              InetSocketAddress client = new InetSocketAddress(0);
              Socket socket = new Socket();
              socket.bind(client);
              socket.connect(server, 10000);

              I have read about the hostName parameter and it has something to do where the socket will be bound (networkInterface).
              I don't know why i never had problems since now. Is the code changed in WAS8.0 or what should i do to solve that problem ?

              thanks
              claus
              • SystemAdmin
                SystemAdmin
                462 Posts
                ACCEPTED ANSWER

                Re: Unable to lookup a remote EJB running on a WAS 7.0

                ‏2011-06-06T06:26:54Z  in response to SystemAdmin
                Any news from IBM ?

                thanks
                claus
                • SystemAdmin
                  SystemAdmin
                  462 Posts
                  ACCEPTED ANSWER

                  Re: Unable to lookup a remote EJB running on a WAS 7.0

                  ‏2011-06-07T21:41:52Z  in response to SystemAdmin
                  Hi Claus,
                  thank you for the traces. They show that the server profile was created using the localhost as its host.
                  It can be seen that the hostname at the moment the profile was created was localhost given the localhostNode01Cell, and localhostNode01 names.
                  In the trace details below is where it is obtaining the host from the serverindex.xml file and initializing the server with it.

                  If a host other than the local host is needed, then the host names used in serverindex.xml would need to be set to the actual host name.
                  This can be done by modifying serverindex.xml or by specifying the proper host name during the server profile creation.
                  Another approach is to change the node host name as described in this article,

                  Link: http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-nd-mp&topic=tagt_hostname

                  Trace details,
                  
                  ************ Start Display Current Environment ************ WebSphere Platform 8.0.0.0 [BASE 8.0.0.0 hh1108.14] running with process name localhostNode01Cell\localhostNode01\server1 and process id 1536 ... [25.05.11 14:34:49:813 CEST] 00000000 ConfigInfoBui <  getFromDocument Exit com.ibm.ws.runtime.config.ConfigObjectImpl@3b1aad1[C:\Programme\IBM\WebSphere\AppServer\profiles\TemplateServer\config\cells /localhostNode01Cell/nodes/localhostNode01/serverindex.xml#ServerIndex_1] ... [25.05.11 14:34:49:813 CEST] 00000000 ConfigInfoBui 3   initServers serverName=server1, serverType=APPLICATION_SERVER, genericShortName=null, serverShortName=
                  
                  null [25.05.11 14:34:49:813 CEST] 00000000 ConfigInfoBui 3   initServers host=localhost, port=2809 [25.05.11 14:34:49:813 CEST] 00000000 ConfigInfoBui 3   expandVariables 
                  "localhost" --> 
                  "localhost" [25.05.11 14:34:49:813 CEST] 00000000 ConfigInfoImp >  addServer Entry serverName=server1 nodeName=localhostNode01 bootstrapHost=localhost bootstrapPort=2809 serverType=STANDALONE_APP_SERVER serverShortName=
                  
                  null genericShortName=
                  
                  null
                  


                  Thank you for using the IBM WebSphere Application Server V8.0 Beta
                  and please let us know if there are any other issues after following the provided suggestions.

                  Regards,

                  Teddy J. Torres (IBM WebSphere Application Server Security and ORB extensions)
                  • SystemAdmin
                    SystemAdmin
                    462 Posts
                    ACCEPTED ANSWER

                    Re: Unable to lookup a remote EJB running on a WAS 7.0

                    ‏2011-06-08T07:30:10Z  in response to SystemAdmin
                    Hi IBM (Teddy),

                    Thank you very much for your informations.
                    I tried it and it works fine now !

                    greets
                    claus