-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
-
Workaround Exists
-
The embedded GlassFish container uses the default HTTP bind port of 8181, even though the user-supplied domain configuration XML file may specify a different HTTP port. This results in the following exception being thrown when the Arquillian client attempts to execute a test:
... INFO: WELD-000900 SNAPSHOT 9 Apr, 2012 11:06:12 AM com.sun.enterprise.web.WebApplication start INFO: WEB0671: Loading application [test] at [/test] 9 Apr, 2012 11:06:13 AM org.glassfish.deployment.admin.DeployCommand execute INFO: test was successfully deployed in 18,014 milliseconds. java.net.SocketException: Unexpected end of file from server at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:766) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.execute(ServletMethodExecutor.java:206) at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.access$000(ServletMethodExecutor.java:43) at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor$1.run(ServletMethodExecutor.java:99) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462)
Note that the deployment is successful, but the HTTPContext returned by the embedded GlassFish adapter contains the wrong port information. In this case, the http-listener-1/http-listener-2 combo was registered in domain.xml to listen on 8080/8181. When Arquillian established a connection to port 8181, the container obviously did not respond to plain text HTTP traffic, and quite obviously the client errored out.