14 Replies Latest reply on Jul 22, 2015 3:04 AM by Subbu K

    Cannot connect from EJB Client to remote MDM

    New Member

      Hello,

       

      I am trying to implement remote EJB call to MDM in order to execute some MDM jobs. For this I am using example from resourcekit/samples/CleanTable

       

      I fail to connect with jboss server on which MDM is installed with following error:

       

      Exception in thread "main" com.siperian.sif.client.SiperianCommunicationException: SIP-14012: Problem reaching the Hub Server EJB. The server might have JNDI configuration problems, mrmclient principal/credential problems, or problems with other EJB-related properties for connecting to the application server. Nested exception: Could not obtain connection to any of these urls: <server_ip>:4447 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]

        Could not obtain connection to any of these urls: <server_ip>:4447 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]

        at com.siperian.sif.client.EjbSiperianClient.createEjb(EjbSiperianClient.java:211)

        at com.siperian.sif.client.EjbSiperianClient.<init>(EjbSiperianClient.java:135)

        at com.siperian.sif.client.SiperianClient.newSiperianClient(SiperianClient.java:130)

        at com.informatica.mdm.api.misc.CleanTableSample.<init>(CleanTableSample.java:78)

        at com.informatica.mdm.api.misc.CleanTableSample.main(CleanTableSample.java:55)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

      Caused by: javax.naming.CommunicationException: Could not obtain connection to any of these urls: <server_ip>:4447 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server <server_ip>:4447 [Root exception is java.io.StreamCorruptedException: invalid stream header: 0000000E]]

        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)

        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)

        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)

        at javax.naming.InitialContext.lookup(InitialContext.java:411)

        at com.siperian.client.util.Ejb2Lookup.lookup(Ejb2Lookup.java:23)

        at com.siperian.sif.client.EjbSiperianClient.createEjb(EjbSiperianClient.java:204)

        ... 9 more

      Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server <server_ip>:4447 [Root exception is java.io.StreamCorruptedException: invalid stream header: 0000000E]

        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:263)

        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)

        ... 14 more

      Caused by: java.io.StreamCorruptedException: invalid stream header: 0000000E

        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:804)

        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)

        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:250)

        ... 15 more

       

      My parameters are:

      ---


      siperian-client.protocol=ejb


      siperian-client.orsId=<ors_id>

      siperian-client.username=******

      siperian-client.password=******

       

      java.naming.provider.url=jnp://<server_ip>:4447

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

      jnp.socketFactory=org.jnp.interfaces.TimedSocketFactory

       

      ---

      My client EJB  class is under SDK 1.7.0_76

      Jboss server is: Jboss-eap-6.2

      MDM Hub is: 9.7.1.0.0.0.110236

       

      I would appreciate any help with finding this strange error.

        • 1. Re: Cannot connect from EJB Client to remote MDM
          Subbu K Guru

          Is your RMI port 4447? Can you double check that?

          • 2. Re: Cannot connect from EJB Client to remote MDM
            gopi kolla Guru

            As Subbu said you can check that from JBoss UI console under Profile --> General Configuration --> Socket Binding --> remoting port OR from standalone-full.xml in jboss-eap-6.2/standalone/configuration directory

            • 3. Re: Cannot connect from EJB Client to remote MDM
              New Member

              I have checked that already. I also run my request on port 1099 with the same (error) result. Here is socket-binding-group from 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="8080"/>

                      <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-group" port="0" multicast-address="${jboss.messaging.group.address:231.7.7.7}" multicast-port="${jboss.messaging.group.port:9876}"/>

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

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

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

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

                      <socket-binding name="jndi" port="1099" fixed-port="false"/>

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

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

                      </outbound-socket-binding>

                  </socket-binding-group>

               

              Anyone has idea what this error can mean?

              • 4. Re: Cannot connect from EJB Client to remote MDM
                New Member

                When I run request on port 1099 I get error:

                 

                Caused by: java.net.ConnectException: Connection refused: connect

                  at java.net.DualStackPlainSocketImpl.connect0(Native Method)

                  at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

                  at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)

                  at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)

                  at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)

                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

                  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

                  at java.net.Socket.connect(Socket.java:579)

                  at java.net.Socket.connect(Socket.java:528)

                  at java.net.Socket.<init>(Socket.java:425)

                  at java.net.Socket.<init>(Socket.java:319)

                  at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)

                  at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)

                  at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)

                  ... 15 more

                • 5. Re: Cannot connect from EJB Client to remote MDM
                  gopi kolla Guru

                  Roman, can you try the below way (instead of jnp it would be remoting)

                   

                  siperian-client.protocol=ejb

                  siperian-client.orsId=<ors_id>

                  siperian-client.username=******

                  siperian-client.password=******

                  java.naming.provider.url=remote://<server_ip>:4447

                  java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory

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

                  • 6. Re: Cannot connect from EJB Client to remote MDM
                    New Member

                    I tried this setting but now I get

                     

                    Exception in thread "main" java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V

                      at org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:242)

                      at org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.parseProperties(PropertiesBasedEJBClientConfiguration.java:186)

                      at org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.<init>(PropertiesBasedEJBClientConfiguration.java:129)

                      at com.siperian.client.util.Jboss7InitialContextFactory.create(Jboss7InitialContextFactory.java:69)

                      at com.siperian.sif.client.Jboss7.createInitialContext(Jboss7.java:75)

                      at com.siperian.sif.client.EjbSiperianClient.createInitialContext(EjbSiperianClient.java:192)

                      at com.siperian.sif.client.EjbSiperianClient.<init>(EjbSiperianClient.java:132)

                      at com.siperian.sif.client.SiperianClient.newSiperianClient(SiperianClient.java:130)

                      at com.informatica.mdm.api.misc.CleanTableSample.<init>(CleanTableSample.java:78)

                      at com.informatica.mdm.api.misc.CleanTableSample.main(CleanTableSample.java:55)

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                      at java.lang.reflect.Method.invoke(Method.java:606)

                      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

                     

                    I checked jars for

                    jboss-ejb-client-2.1.1.Final.jar

                    jboss-logging-3.3.0.Final.jar

                     

                    Both are newest versions taken from:

                    http://mvnrepository.com/artifact/org.jboss/jboss-ejb-client/2.1.1.Final

                    http://mvnrepository.com/artifact/org.jboss.logging/jboss-logging/3.3.0.Final

                    • 7. Re: Cannot connect from EJB Client to remote MDM
                      Subbu K Guru

                      siperian-client.orsId=localhost-orcl-MDM_SAMPLE

                      siperian-client.username=admin

                      siperian-client.password=admin

                      siperian-client.protocol=ejb
                      java.naming.factory.url.pkgs=org.jboss.ejb.client.naming
                      java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory

                      jboss.naming.client.ejb.context=true

                      java.naming.provider.url=remote://localhost:4447/

                       

                       

                      Use the above and try, where you can replace the localhost with your IP

                      • 8. Re: Cannot connect from EJB Client to remote MDM
                        New Member

                        Subbu,

                         

                        I tried your settings:

                         

                        siperian-client.orsId=<ncdm_base_id>
                        siperian-client.username=admin
                        siperian-client.password=admin

                        siperian-client.protocol=ejb

                        java.naming.provider.url=remote://<server_ip>:4447/
                        java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
                        java.naming.factory.url.pkgs=org.jboss.ejb.client.naming

                         

                        But for it I get error:

                         

                        Exception in thread "main" java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V

                        • 9. Re: Cannot connect from EJB Client to remote MDM
                          Subbu K Guru

                          Can you paste the full stack trace here?

                          • 10. Re: Cannot connect from EJB Client to remote MDM
                            New Member

                            Exception in thread "main" java.lang.NoSuchMethodError: org.jboss.logging.Logger.debugf(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V

                              at org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.getOptionMapFromProperties(PropertiesBasedEJBClientConfiguration.java:242)

                              at org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.parseProperties(PropertiesBasedEJBClientConfiguration.java:186)

                              at org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.<init>(PropertiesBasedEJBClientConfiguration.java:129)

                              at com.siperian.client.util.Jboss7InitialContextFactory.create(Jboss7InitialContextFactory.java:69)

                              at com.siperian.sif.client.Jboss7.createInitialContext(Jboss7.java:75)

                              at com.siperian.sif.client.EjbSiperianClient.createInitialContext(EjbSiperianClient.java:192)

                              at com.siperian.sif.client.EjbSiperianClient.<init>(EjbSiperianClient.java:132)

                              at com.siperian.sif.client.SiperianClient.newSiperianClient(SiperianClient.java:130)

                              at com.informatica.mdm.api.misc.CleanTableSample.<init>(CleanTableSample.java:78)

                              at com.informatica.mdm.api.misc.CleanTableSample.main(CleanTableSample.java:55)

                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                              at java.lang.reflect.Method.invoke(Method.java:606)

                              at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

                            • 12. Re: Cannot connect from EJB Client to remote MDM
                              gopi kolla Guru

                              Roman, you don't need jboss-logging jar. Copy the jboss-client.jar from the JBOSS where MDM is installed (under jboss-eap-6.2/bin/client/jboss-client.jar) and you can use log4j.jar ( i am using log4j-1.2.16.jar). List of jars i had under my lib folder

                              MDMExecuteBatch.jar

                              siperian-api.jar

                              siperian-common.jar

                              log4j-1.2.16.jar

                              jboss-client.jar

                              picketbox-4.0.19.SP2-redhat-1.jar

                              1 of 1 people found this helpful
                              • 13. Re: Cannot connect from EJB Client to remote MDM
                                New Member

                                Subbu, gobi,

                                 

                                Thank you very much for your help! I have managed to get working example based on project I obtained from Informatica Support. It has following libraries:

                                commons-cli-1.1.jar (for parsing command line arguments)

                                jboss-client.jar

                                log4j-1.2.16.jar

                                picketbox-4.0.17.Final-redhat-1.jar

                                siperian-api.jar

                                siperian-common.jar

                                siperian-server.jar

                                 

                                My config file is:

                                jboss.naming.client.ejb.context=true
                                java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
                                jboss.node.name=<node_name>
                                siperian-client.orsId=<ors_id>
                                siperian-client.username=admin
                                java.naming.provider.url=remote\://<mdm_server_ip>\:4447/
                                java.naming.factory.url.pkgs=org.jboss.ejb.client.naming
                                siperian-client.password=admin
                                siperian-client.protocol=ejb


                                Core method is as follows:

                                // main class constructor (class is SIFStub)

                                public SIFStub(CommandLine cmdLine) {

                                   this.cmdLine = cmdLine;
                                   props = loadProperties(cmdLine);
                                   siperianClient = SiperianClient.newSiperianClient(props);
                                }

                                 

                                // MDM method (Clean Table) call:

                                public int cleanTable() {

                                  CleanTableRequest request = new CleanTableRequest();
                                  if (askPassword) {

                                  request.setPassword(new Password(promptPassword()));
                                   }

                                  request.setOrsId(sourceOrsId);
                                   request.setSiperianObjectUid(SiperianObjectType.BASE_OBJECT.makeUid(boName));
                                   request.setCleanStaging(cleanStaging);
                                   request.setUseTruncate(useTruncate);
                                   CleanTableResponse response = (CleanTableResponse) siperianClient.process(request);
                                   System.out.println(response.getMessage());
                                  return 0;
                                }

                                • 14. Re: Cannot connect from EJB Client to remote MDM
                                  Subbu K Guru

                                  Roman - Thanks for sharing the solution