9 Replies Latest reply on Jul 3, 2017 5:48 PM by jasonglass

    How to Access EJB over HTTP in remote machine?

    ritesh163

      hello everybody,

      I am having problem to access EJB over HTTP in remote machine. I have to access EJB which is running in remote server. In between two EJBs, there is routing IP as these are running in different network connected by radio link. I am given with routing IP to connect with remote EJB by my client, that routing IP will map to remote EJB server.
      Remote EJB server is running in [internal IP] and I have to connect remote EJB with [Routing IP or External IP]. Can I access this remote EJB over HTTP?

      I am using JBoss-4.0.4.GA and Java version: 1.5.0_15. OS: RHEL 4.

      If I access the web page through my server by "http://[routing IP]:[port]" then welcome screen of Jboss is displayed but through application, the connection is not found.

      The code of client's remote machine for http-invoker.sar\META-INF\jboss-service.xml is given below:

      <server>
      
       <!-- The HTTP invoker service configration
       -->
       <mbean code="org.jboss.invocation.http.server.HttpInvoker"
       name="jboss:service=invoker,type=http">
       <!-- Use a URL of the form http://<hostname>:8080/invoker/EJBInvokerServlet
       where <hostname> is InetAddress.getHostname value on which the server
       is running.
      
       -->
      
       <attribute name="InvokerURL">http://[Internal IP]:[port]/invoker/EJBInvokerServlet</attribute>
       <attribute name="InvokerURLPrefix">http://</attribute>
       <attribute name="InvokerURLSuffix">:8080/invoker/EJBInvokerServlet</attribute>
       <attribute name="UseHostName">false</attribute>
       </mbean>
      
       <!-- Expose the Naming service interface via HTTP -->
       <mbean code="org.jboss.invocation.http.server.HttpProxyFactory"
       name="jboss:service=invoker,type=http,target=Naming">
       <!-- The Naming service we are proxying -->
       <attribute name="InvokerName">jboss:service=Naming</attribute>
       <!-- Compose the invoker URL from the cluster node address -->
       <!--
       -->
       <attribute name="InvokerURL">http://[Internal IP]:[port]/invoker/JMXInvokerServlet</attribute>
       <attribute name="InvokerURLPrefix">http://</attribute>
       <attribute name="InvokerURLSuffix">:8080/invoker/JMXInvokerServlet</attribute>
       <attribute name="UseHostName">false</attribute>
      
       <attribute name="ExportedInterface">org.jnp.interfaces.Naming</attribute>
       <attribute name="JndiName"></attribute>
       <attribute name="ClientInterceptors">
       <interceptors>
       <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
       <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
       <interceptor>org.jboss.naming.interceptors.ExceptionInterceptor</interceptor>
       <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
       </interceptors>
       </attribute>
       </mbean>
      
       <!-- Expose the Naming service interface via clustered HTTP. This maps
       to the ReadOnlyJNDIFactory servlet URL
       -->
       <mbean code="org.jboss.invocation.http.server.HttpProxyFactory"
       name="jboss:service=invoker,type=http,target=Naming,readonly=true">
       <attribute name="InvokerURL">http://[Internal IP]:[port]/invoker/JMXInvokerServlet</attribute>
       <attribute name="InvokerName">jboss:service=Naming</attribute>
       <attribute name="InvokerURLPrefix">http://</attribute>
       <attribute name="InvokerURLSuffix">:8080/invoker/readonly/JMXInvokerServlet</attribute>
       <attribute name="UseHostName">false</attribute>
       <attribute name="ExportedInterface">org.jnp.interfaces.Naming</attribute>
       <attribute name="JndiName"></attribute>
       <attribute name="ClientInterceptors">
       <interceptors>
       <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
       <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
       <interceptor>org.jboss.naming.interceptors.ExceptionInterceptor</interceptor>
       <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
       </interceptors>
       </attribute>
       </mbean>
      </server>
      
      


      Also connecting code of my server is given below:
      props.put("java.naming.factory.initial",
      "org.jboss.naming.HttpNamingContextFactory");
      props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      props.put("java.naming.provider.url", "http://" + routingIP + ":"
       + port+ "/invoker/JNDIFactory");
      
      InitialContext ic = new InitialContext(props);
      Object objRef = ic.lookup("ejb/EjbTxn");
      ejbTxnHome home = (ejbTxnHome) PortableRemoteObject.narrow(
       objRef, ejbTxnHome.class);
      ejbTxn = home.create();
      


      Will I have to use invoker in my server also or not? Error that occur during connection is also given below:
      16:45:52,869 INFO [STDOUT] Unable to lookup home: ejbTxnHome Operation failed
      16:45:52,869 ERROR [STDERR] javax.naming.CommunicationException: Operation failed [Root exception is java.rmi.ServerException: IOE; nested exception is:
       java.net.ConnectException: Connection timed out]
      16:45:52,870 ERROR [STDERR] at org.jboss.naming.interceptors.ExceptionInterceptor.invoke(ExceptionInterceptor.java:65)
      16:45:52,870 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
      16:45:52,870 ERROR [STDERR] at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
      16:45:52,870 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
      16:45:52,870 ERROR [STDERR] at $Proxy65.lookup(Unknown Source)
      16:45:52,870 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
      16:45:52,870 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      16:45:52,870 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      16:45:52,870 ERROR [STDERR] at org.apache.jsp.trans_005fdetail_jsp.getNpgTxn(trans_005fdetail_jsp.java:124)
      16:45:52,870 ERROR [STDERR] at org.apache.jsp.trans_005fdetail_jsp._jspService(trans_005fdetail_jsp.java:722)
      16:45:52,870 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      16:45:52,871 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      16:45:52,871 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
      16:45:52,871 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      16:45:52,871 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      16:45:52,871 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      16:45:52,871 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      16:45:52,871 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      16:45:52,871 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      16:45:52,871 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      16:45:52,871 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      16:45:52,871 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      16:45:52,871 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      16:45:52,871 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      16:45:52,872 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
      16:45:52,872 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      16:45:52,872 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      16:45:52,872 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      16:45:52,872 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      16:45:52,872 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      16:45:52,872 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      16:45:52,872 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      16:45:52,872 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      16:45:52,872 ERROR [STDERR] at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      16:45:52,872 ERROR [STDERR] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      16:45:52,872 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
      16:45:52,873 ERROR [STDERR] Caused by: java.rmi.ServerException: IOE; nested exception is:
       java.net.ConnectException: Connection timed out
      16:45:52,873 ERROR [STDERR] at org.jboss.invocation.http.interfaces.HttpInvokerProxy.invoke(HttpInvokerProxy.java:133)
      16:45:52,873 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:331)
      16:45:52,873 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:194)
      16:45:52,873 ERROR [STDERR] at org.jboss.naming.interceptors.ExceptionInterceptor.invoke(ExceptionInterceptor.java:57)
      16:45:52,873 ERROR [STDERR] ... 35 more
      16:45:52,874 ERROR [STDERR] Caused by: java.net.ConnectException: Connection timed out
      16:45:52,874 ERROR [STDERR] at java.net.PlainSocketImpl.socketConnect(Native Method)
      16:45:52,874 ERROR [STDERR] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      16:45:52,874 ERROR [STDERR] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
      16:45:52,874 ERROR [STDERR] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      16:45:52,874 ERROR [STDERR] at java.net.Socket.connect(Socket.java:520)
      16:45:52,874 ERROR [STDERR] at java.net.Socket.connect(Socket.java:470)
      16:45:52,874 ERROR [STDERR] at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
      16:45:52,874 ERROR [STDERR] at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
      16:45:52,874 ERROR [STDERR] at sun.net.www.http.HttpClient.openServer(HttpClient.java:523)
      16:45:52,874 ERROR [STDERR] at sun.net.www.http.HttpClient.<init>(HttpClient.java:231)
      16:45:52,874 ERROR [STDERR] at sun.net.www.http.HttpClient.New(HttpClient.java:304)
      16:45:52,874 ERROR [STDERR] at sun.net.www.http.HttpClient.New(HttpClient.java:321)
      16:45:52,874 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:813)
      16:45:52,875 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:765)
      16:45:52,875 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:690)
      16:45:52,875 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:857)
      16:45:52,875 ERROR [STDERR] at org.jboss.invocation.http.interfaces.Util.invoke(Util.java:163)
      16:45:52,875 ERROR [STDERR] at org.jboss.invocation.http.interfaces.HttpInvokerProxy.invoke(HttpInvokerProxy.java:118)
      16:45:52,875 ERROR [STDERR] ... 38 more
      


      Could anyone tell me how to solve this problem ? If any suggest, please provide it to me.
      Thank you.

        • 1. Re: How to Access EJB over HTTP in remote machine?
          robert.geisler

          hi, ritesh,

          you want to access ejb 2.1 through http, ejbs are deployed on machine A within a lan (internal address) and the clients (machine B) get redirected from external address?
          if this is correct, i did ithe same some weeks ago. here are the steps i had to go through:

          • use HttpNamingContextFactory instead of NamingContextFactory,
          • configure JMXInvokerServlet and EJBInvokerServlet in deploy/http-invoker.sar/META-INF/jboss-service.xml,
          • configure container-configuration in conf/standardjboss.xml.try to get known to these first.

            second... i looked at your deploy/http-invoker.sar/META-INF/jboss-service.xml and i would guess that your InvokerURLs (for JMXInvokerServlet and EJBInvokerServlet) are wrong, because you point to your internal address. i think, you have to configure the external address, because the InvokerURL seems to be the address, JBoss will tell the clients to connect to.
            try to set the external addresses as the InvokerURLs for the servlets.

            and let me know if this solves your problems.
            robert


          • 2. Re: How to Access EJB over HTTP in remote machine?
            ritesh163

             

            "robert.geisler" wrote:

            • use HttpNamingContextFactory instead of NamingContextFactory,
            • configure JMXInvokerServlet and EJBInvokerServlet in deploy/http-invoker.sar/META-INF/jboss-service.xml,
            • configure container-configuration in conf/standardjboss.xml.
              try to get known to these first.

              second... i looked at your deploy/http-invoker.sar/META-INF/jboss-service.xml and i would guess that your InvokerURLs (for JMXInvokerServlet and EJBInvokerServlet) are wrong, because you point to your internal address. i think, you have to configure the external address, because the InvokerURL seems to be the address, JBoss will tell the clients to connect to.
              try to set the external addresses as the InvokerURLs for the servlets.

              robert


            Thank you for your suggestion but I am new to jboss server, so I am confused about following:

            • which container-name or section to change to what in conf/standardjboss.xml.
            • if external addresses are set as the InvokerURLs for the servlets then will I have to set external IP at start of server. I am using below command to start the server: run.sh -c default -b [internal ip] for Jboss. If I replace [internal ip] with [external ip] then the server won't start.
            • Also can I use domain name in place of IPs?

              Waiting for your reply.
              Thank you.


            • 3. Re: How to Access EJB over HTTP in remote machine?
              robert.geisler

               

              "ritesh163" wrote:
              • which container-name or section to change to what in conf/standardjboss.xml.

              it depends on your EJBs. for Stateless SessionBeans for example JBoss defaults to "Standard Stateless SessionBean" if not another container-configuration is declared in the deployment descriptor of your EJBs. every container-configuration uses a invoker-proxy-binding-name to refer to its invoker, "stateless-unified-invoker" is the default for the "Standard Stateless SessionBean" configuration.
              we added a new invoker called "stateless-http-invoker" (see below) and a new container-configuration "Custom Stateless SessionBean" referring to the new invoker. in the deployment descriptors of our EJBs we configured the new container-configuration.

              standardjboss.xml:
              <jboss>
               <container-configurations>
               ...
               <!-- extend default container-configuration, use different invoker --> <container-configuration extends="Standard Stateless SessionBean"> <container-name>Custom Stateless SessionBean</container-name> <invoker-proxy-binding-name>stateless-http-invoker</invoker-proxy-binding-name> </container-configuration>
               </container-configurations>
               ...
               <invoker-proxy-bindings>
               <!-- copy standard-unified-invoker, change type to http -->
               <invoker-proxy-binding> <name>stateful-http-invoker</name>
               <invoker-mbean>jboss:service=invoker,type=http</invoker-mbean> ...
               </invoker-proxy-binding>
               </invoker-proxy-bindings>
               ...
              </jboss>

              jboss.xml (deployment deskriptor):
              <jboss>
               <enterprise-beans>
               <session>
               <ejb-name>MyStatelessSessionBean</ejb-name>
               ... <configuration-name>Custom Stateless SessionBean</configuration-name> ...
               </session>
               ...
               </enterprise-beans>
               ...
              </jboss>




              "ritesh163" wrote:
              • if external addresses are set as the InvokerURLs for the servlets then will I have to set external IP at start of server. I am using below command to start the server: run.sh -c default -b [internal ip] for Jboss. If I replace [internal ip] with [external ip] then the server won't start.

              start option "-b" tells JBoss to which address to bind to, so your internal ip should be the correct parameter. just for the InvokerURLs of the servlets you have to set the external ip, because JBoss sends the InvokerURL back to the clients to let them know where to connect to. nonetheless you have to know the external ip on start of JBoss, because you cannot change the InvokerURL on runtime. if you do not know the external ip, then there is a little trick: instead of an address you can set a simple String for the InvokerURL, "jboss.ejb2.invoker.http" for example. JBoss will interpret this String as a key for a system property (on the client machine). the value of the system property can be set by your client application to set the InvokerURL on runtime.
              we use this trick and set the InvokerURL in the client, because JBoss does not know the address where clients have to connect to. in our client application we just try to connect to the external ip. if the external ip is available we set it as the value of the system property; if it is not available we set the internal ip. doing it this way our client is able to connect to JBoss from LAN (internal address) and over the internet (external address).



              "ritesh163" wrote:
              • Also can I use domain name in place of IPs?

              because you can set system property names as InvokerURLs i would guess domain names are supported, too. but i did not test this. just give it a try.


              kind regards
              robert

              • 4. Re: How to Access EJB over HTTP in remote machine?
                ritesh163

                 

                "robert.geisler" wrote:

                just for the InvokerURLs of the servlets you have to set the external ip, because JBoss sends the InvokerURL back to the clients to let them know where to connect to.
                robert

                I had configured both standardjboss.xml and jboss.xml. I had started client Jboss with command as : run.sh -c default -b [internal ip] and set InvokerURLs of the servlets to the external ip. But following error occures:
                21:05:55,944 INFO [Server] Server Name: default
                21:05:55,944 INFO [Server] Server Home Dir: /home/remit/jboss-4.0.4.GA/server/default
                21:05:55,944 INFO [Server] Server Home URL: file:/home/remit/jboss-4.0.4.GA/server/default/
                21:05:55,944 INFO [Server] Server Log Dir: /home/remit/jboss-4.0.4.GA/server/default/log
                21:05:55,945 INFO [Server] Server Temp Dir: /home/remit/jboss-4.0.4.GA/server/default/tmp
                21:05:55,946 INFO [Server] Root Deployment Filename: jboss-service.xml
                21:05:56,505 INFO [ServerInfo] Java version: 1.5.0_08,Sun Microsystems Inc.
                21:05:56,505 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_08-b03,Sun Microsystems Inc.
                21:05:56,505 INFO [ServerInfo] OS-System: Linux 2.6.18-8.el5,i386
                21:05:57,399 INFO [Server] Core system initialized
                21:06:02,350 INFO [ServiceConfigurator] Problem configuring service jboss:service=Naming
                org.jboss.deployment.DeploymentException: No Attribute found with name: RmiBindAddress
                 at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:318)
                 at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:460)
                 at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
                 at org.jboss.system.ServiceController.install(ServiceController.java:226)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                 at $Proxy4.install(Unknown Source)
                 at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
                 at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                 at $Proxy5.deploy(Unknown Source)
                 at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
                 at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
                 at org.jboss.Main.boot(Main.java:200)
                 at org.jboss.Main$1.run(Main.java:464)
                 at java.lang.Thread.run(Thread.java:595)
                


                Here, I am talking about client side Jboss (machine B). machine A is already in External IP, so it runs on external IP. Will machine A also require invoker? I didn't configure invoker in machine A because it invoke other ejb which is in machine B. Machine B has internal ip and jboss also run on that ip which is redirected by router ip or external ip.

                I am hoping to receive reply ....
                thank you.

                • 5. Re: How to Access EJB over HTTP in remote machine?
                  robert.geisler

                   

                  "ritesh163" wrote:
                  21:06:02,350 INFO [ServiceConfigurator] Problem configuring service jboss:service=Naming
                  org.jboss.deployment.DeploymentException: No Attribute found with name: RmiBindAddress

                  well, i do not exactly know what the reason for this error is, but i would guess it does not depend on the InvokerURLs. ServiceConfigurator says he cannot find "RmiBindAddress". RmiBindAddress is configured in /conf/jboss-service.xml and defaults to "${jboss.bind.address}" which is imho set through the "-b" option.
                  please check whether JBoss starts successfully with your command if you do not have configured standardjboss.xml, jboss.xml and the InvokerURLs. i would except the error to remain...?


                  "ritesh163" wrote:
                  Here, I am talking about client side Jboss (machine B). machine A is already in External IP, so it runs on external IP [...] Machine B has internal ip and jboss also run on that ip which is redirected by router ip or external ip.

                  lets clarify your network topology first. i assume
                  • you have two JBoss instances running (machine A and machine B),
                  • your client (application) connects to machine A over JNDI (http) and uses
                  • an EJB in machine A which has to access an EJB (http, too) in machine B.
                  • machine A do not know the address of machine B, but
                  • machine A knows the address of the router and get redirected.is this correct? if yes then... both machines need to use http invokers, i think.
                    • because your client tries to connect to machine A over http (HttpNamingContextFactory), you have to configure the servlets for machine A. the InvokerURLs should be the address of machine A from the clients point of view, because JBoss will return the InvokerURL to tell your client(s proxies) where to connect to.
                    • and because machine A tries to connect to machine B over http (external address and redirecting), you have to configure the servlets for machine B. the InvokerURLs should again be the address of machine B from machine As point of view, because machine A will recieve proxies which have to connect to the external/ routing address of machine B.and you have to configure standardjboss.xml and jboss.xml for both machines, of course.


                      i hope, this works for you.
                      robert


                  • 6. Re: How to Access EJB over HTTP in remote machine?
                    ritesh163

                     

                    21:06:02,350 INFO [ServiceConfigurator] Problem configuring service jboss:service=Naming
                    org.jboss.deployment.DeploymentException: No Attribute found with name: RmiBindAddress


                    The error may be due to InvokerURLs of the servlets which was set to the router ip and jboss starting on internal IP.
                    And machine A only invokes the EJB of machine B over http. Machine A has external IP and jboss is also starting on that ip. This machine A is connected to machine B through router Ip only. Machine A only knows Router IP of machine B.when message is send through router IP by machine A, this message is redirect to machine B's internal IP by router. Also machine B is starting only in Internal IP.
                    Now I hope you know the topology.
                    Hoping you will reply soon.
                    Thank you.

                    • 7. Re: How to Access EJB over HTTP in remote machine?
                      robert.geisler

                       

                      "ritesh163" wrote:
                      "robert.geisler" wrote:
                      please check whether JBoss starts successfully with your command if you do not have configured standardjboss.xml, jboss.xml and the InvokerURLs.

                      The error may be due to InvokerURLs of the servlets which was set to the router ip and jboss starting on internal IP.

                      did you test that? O: ) imho your bindings seem to be correct, both JBoss instances should bind to their "internal address". anyway i do not know why JBoss cannot find attribute named "RmiBindAddress".

                      if you enable DEBUG-logging in /conf/log4j.xml we can check what the ServiceConfigurator tries to do and what he actually does.


                      "ritesh163" wrote:
                      machine A only invokes the EJB of machine B over http. Machine A has external IP and jboss is also starting on that ip. This machine A is connected to machine B through router Ip only. Machine A only knows Router IP of machine B.when message is send through router IP by machine A, this message is redirect to machine B's internal IP by router. Also machine B is starting only in Internal IP.

                      thank you for clearing it up to me.

                      in my opinion, your machine A do not need servlets and http-invokers. just machine B need these invokers and servlets, because only the EJBs of machine B will get accessed via http. nonetheless, imho the InvokerURL of the servlets have to point to the "router ip", because machine B create proxies which machine A uses to communicate to machine B. and because machine A (and its proxies) just know the "router ip", machine A has (especially its proxies have) to connect to the "router ip". machine B should never complain about setting the "router ip" as InvokerURL, because not machine B, but only machine A, will ever use the InvokerURL. at least this is my understanding.


                      regards
                      robert

                      • 8. Re: How to Access EJB over HTTP in remote machine?
                        ritesh163

                        Thank you for your suggestion and now I am trying on it. If I find any problem I will inform you. Hope you will cooperate with me.

                        • 9. Re: How to Access EJB over HTTP in remote machine?
                          jasonglass

                          Hi robert.geisler

                           

                          I know this is a bit old and things have changed over the years - but with your " instead of an address you can set a simple String for the InvokerURL, "jboss.ejb2.invoker.http" for example. JBoss will interpret this String as a key for a system property (on the client machine). the value of the system property can be set by your client application to set the InvokerURL on runtime." - any idea if this would work with JMS Messaging?  I currently have the exact same issue in JBoss EAP 6.1 - any suggestions would be appreciated, been troubleshooting this for a while

                          Re: JMS HornetQ NAT'ed IP's issue with clustered environment

                           

                          Thank you!

                           

                          Jay