Uploaded image for project: 'WildFly EJB HTTP Client'
  1. WildFly EJB HTTP Client
  2. WEJBHTTP-20

EJB over HTTP using Apache httpd via AJP does not work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.0.13.Final
    • 1.0.12.Final
    • None
    • Hide
      1. Start a WildFly 15.0.0.Final with the standalone-ha.xml profile and an application containing a session bean
      2. Start an Apache httpd with the following mod_proxy configuration:
        ProxyPass "/wildfly-services" "ajp://localhost:8009/wildfly-services" keepalive=on
      3. Invoke the session bean from a standalone Java client using the following configuration in the wildfly-config.xml:
        <configuration>
        	<authentication-client xmlns="urn:elytron:1.0">
        		<authentication-rules>
        			<rule use-configuration="all" />
        		</authentication-rules>
        		<authentication-configurations>
        			<configuration name="all">
        				<set-user-name name="{username}" />
        				<credentials>
        					<clear-password password="{password}" />
        				</credentials>
        			</configuration>
        		</authentication-configurations>
        	</authentication-client>
        	<discovery xmlns="urn:wildfly-discovery:1.0">
        		<discovery-provider>
        			<static>
        				<service uri="http://{host-on-httpd}:{port-on-httpd}/wildfly-services" abstract-type="ejb" abstract-type-authority="jboss">
        					<attribute name="ejb-module" value="{application-name}/{ejb-jar-name}" />
        				</service>
        			</static>
        		</discovery-provider>
        	</discovery>
        	<jboss-ejb-client
        		xmlns="urn:jboss:wildfly-client-ejb:3.0">
        		<invocation-timeout seconds="10" />
        	</jboss-ejb-client>
        </configuration>
        
      Show
      Start a WildFly 15.0.0.Final with the standalone-ha.xml profile and an application containing a session bean Start an Apache httpd with the following mod_proxy configuration: ProxyPass "/wildfly-services" "ajp://localhost:8009/wildfly-services" keepalive=on Invoke the session bean from a standalone Java client using the following configuration in the wildfly-config.xml : <configuration> <authentication-client xmlns= "urn:elytron:1.0" > <authentication-rules> <rule use-configuration= "all" /> </authentication-rules> <authentication-configurations> <configuration name= "all" > <set-user-name name= "{username}" /> <credentials> <clear-password password= "{password}" /> </credentials> </configuration> </authentication-configurations> </authentication-client> <discovery xmlns= "urn:wildfly-discovery:1.0" > <discovery-provider> < static > <service uri= "http: //{host-on-httpd}:{port-on-httpd}/wildfly-services" abstract -type= "ejb" abstract -type-authority= "jboss" > <attribute name= "ejb-module" value= "{application-name}/{ejb-jar-name}" /> </service> </ static > </discovery-provider> </discovery> <jboss-ejb-client xmlns= "urn:jboss:wildfly-client-ejb:3.0" > <invocation-timeout seconds= "10" /> </jboss-ejb-client> </configuration>

    Description

      An EJB over HTTP invocation from a standalone Java client to a WildFly server through an Apache httpd connected to WildFly via AJP does not work and result in the following Exception:

      Exception in thread "main" javax.ejb.EJBException: java.io.IOException: UT001033: Invalid connection state
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:207)
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:112)
      	at com.sun.proxy.$Proxy0.logMessageAndReturnJBossNodeNameWithDelay(Unknown Source)
      	at org.jboss.playground.client.CommonClient.invokeSimpleRemote(CommonClient.java:52)
      	at org.jboss.playground.client.EjbOverHttpWithWildflyConfigXmlEjbClient.main(EjbOverHttpWithWildflyConfigXmlEjbClient.java:54)
      Caused by: java.io.IOException: UT001033: Invalid connection state
      	at io.undertow.client.http.HttpClientConnection.sendRequest(HttpClientConnection.java:336)
      	at org.wildfly.httpclient.common.HttpTargetContext.sendRequestInternal(HttpTargetContext.java:165)
      	at org.wildfly.httpclient.common.HttpTargetContext$1$1.lambda$null$0(HttpTargetContext.java:183)
      	at org.wildfly.httpclient.common.HttpConnectionPool$1.completed(HttpConnectionPool.java:157)
      	at org.wildfly.httpclient.common.HttpConnectionPool$1.completed(HttpConnectionPool.java:151)
      	at io.undertow.client.http.HttpClientProvider.handleConnected(HttpClientProvider.java:156)
      	at io.undertow.client.http.HttpClientProvider.access$000(HttpClientProvider.java:51)
      	at io.undertow.client.http.HttpClientProvider$2.handleEvent(HttpClientProvider.java:127)
      	at io.undertow.client.http.HttpClientProvider$2.handleEvent(HttpClientProvider.java:124)
      	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      	at org.xnio.nio.WorkerThread$ConnectHandle.handleReady(WorkerThread.java:333)
      	at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
      

      Attachments

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              rhn-support-jbaesner Joerg Baesner
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: