Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10389

Application client ignores remote host address in ejb-client-properties file passed to it in argument

    XMLWordPrintable

Details

    • Hide

      1. Start an EAP instance binding to non-default loopback address:

      ${JBOSS_HOME}/bin/standalone.sh -b 127.0.0.8 -bmanagement 127.0.0.8

      2. Add users:

      ${JBOSS_HOME}/bin/add-user.sh -u admin -p admin-123
      ${JBOSS_HOME}/bin/add-user.sh -a -u quickuser -p quick-123

      3. Deploy app-client quickstart to EAP:

      mvn clean install wildfly:deploy -Dwildfly.hostname=127.0.0.8

      4. Create the properties file:

      ejb-client.properties
      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
      remote.connections=default
      remote.connection.default.host=127.0.0.8
      remote.connection.default.port=8080
      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
      remote.connection.default.username=quickuser
      remote.connection.default.password=quick-123

      5. Run the application client with the properties file:

      ${JBOSS_HOME}/bin/appclient.sh --ejb-client-properties=jboss-ejb-client.properties ear/target/app-client.ear#simpleClient.jar Hello from command line

      The error is produced.

      Show
      1. Start an EAP instance binding to non-default loopback address: ${JBOSS_HOME}/bin/standalone.sh -b 127.0.0.8 -bmanagement 127.0.0.8 2. Add users: ${JBOSS_HOME}/bin/add-user.sh -u admin -p admin-123 ${JBOSS_HOME}/bin/add-user.sh -a -u quickuser -p quick-123 3. Deploy app-client quickstart to EAP: mvn clean install wildfly:deploy -Dwildfly.hostname=127.0.0.8 4. Create the properties file: ejb-client.properties remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED= false remote.connections= default remote.connection. default .host=127.0.0.8 remote.connection. default .port=8080 remote.connection. default .connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS= false remote.connection. default .username=quickuser remote.connection. default .password=quick-123 5. Run the application client with the properties file: ${JBOSS_HOME}/bin/appclient.sh --ejb-client-properties=jboss-ejb-client.properties ear/target/app-client.ear#simpleClient.jar Hello from command line The error is produced.

    Description

      Application client provides an option to define client properties through --ejb-client-properties=<url> command line argument. When trying to connect to remote server with its address defined by file from the argument, the remote.connection.default.host property gets ignored with the following error being produced in the application client:

      ${JBOSS_HOME}/bin/appclient.sh --ejb-client-properties=ejb-client.properties ear/target/app-client.ear#simpleClient.jar Hello from command line
      13:07:12,287 ERROR [org.jboss.as.appclient] (Thread-45) WFLYAC0002: InvocationTargetException running app client main: java.lang.reflect.InvocationTargetException
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_121]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_121]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_121]
      	at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_121]
      	at org.jboss.as.appclient.service.ApplicationClientStartService$1.run(ApplicationClientStartService.java:109)
      	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_121]
      Caused by: java.lang.IllegalStateException: EJBCLIENT000024: Not able to find EJB matching "StatelessEJBLocator for "app-client/ejb/StatelessSessionBean", view is interface org.jboss.as.quickstarts.appclient.server.ejb.StatelessSession, affinity is None"
      	at org.jboss.ejb.client.EJBClientContext.discoverAffinityNone(EJBClientContext.java:716) [jboss-ejb-client-4.0.0.Beta24-redhat-1.jar:4.0.0.Beta24-redhat-1]
      	at org.jboss.ejb.client.EJBClientContext.performLocatedAction(EJBClientContext.java:698) [jboss-ejb-client-4.0.0.Beta24-redhat-1.jar:4.0.0.Beta24-redhat-1]
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146) [jboss-ejb-client-4.0.0.Beta24-redhat-1.jar:4.0.0.Beta24-redhat-1]
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:96) [jboss-ejb-client-4.0.0.Beta24-redhat-1.jar:4.0.0.Beta24-redhat-1]
      	at com.sun.proxy.$Proxy12.getGreeting(Unknown Source)
      	at org.jboss.as.quickstarts.appclient.acc.client.Main.main(Main.java:59) [simpleClient.jar:7.1.0.Beta]
      	... 6 more
      	Suppressed: java.net.ConnectException: Connection refused
      		at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) [rt.jar:1.8.0_121]
      		at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) [rt.jar:1.8.0_121]
      		at org.xnio.nio.WorkerThread$ConnectHandle.handleReady(WorkerThread.java:323)
      		at org.xnio.nio.WorkerThread.run(WorkerThread.java:569)
      		at ...asynchronous invocation...(Unknown Source)
      		at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:465)
      		at org.jboss.remoting3.FutureConnection.getConnection(FutureConnection.java:117)
      		at org.jboss.remoting3.FutureConnection.init(FutureConnection.java:77)
      		at org.jboss.remoting3.FutureConnection.get(FutureConnection.java:152)
      		at org.jboss.remoting3.EndpointImpl.doGetConnection(EndpointImpl.java:407)
      		at org.jboss.remoting3.EndpointImpl.getConnection(EndpointImpl.java:341)
      		at org.jboss.remoting3.UncloseableEndpoint.getConnection(UncloseableEndpoint.java:55)
      		at org.jboss.remoting3.Endpoint.getConnection(Endpoint.java:135)
      		at org.jboss.ejb.protocol.remote.RemotingEJBDiscoveryProvider.lambda$discover$0(RemotingEJBDiscoveryProvider.java:101) [jboss-ejb-client-4.0.0.Beta24-redhat-1.jar:4.0.0.Beta24-redhat-1]
      		at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_121]
      		at org.jboss.ejb.protocol.remote.RemotingEJBDiscoveryProvider.discover(RemotingEJBDiscoveryProvider.java:101) [jboss-ejb-client-4.0.0.Beta24-redhat-1.jar:4.0.0.Beta24-redhat-1]
      		at org.wildfly.discovery.Discovery.discover(Discovery.java:94)
      		at org.jboss.ejb.client.EJBClientContext.discover(EJBClientContext.java:440) [jboss-ejb-client-4.0.0.Beta24-redhat-1.jar:4.0.0.Beta24-redhat-1]
      		at org.jboss.ejb.client.EJBClientContext.discoverAffinityNone(EJBClientContext.java:711) [jboss-ejb-client-4.0.0.Beta24-redhat-1.jar:4.0.0.Beta24-redhat-1]
      		... 11 more
      

      Attachments

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              mjurc@redhat.com Michal Jurc
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: