4 Replies Latest reply on Nov 13, 2009 10:21 AM by versed

    [org.apache.commons.httpclient.HttpMethodDirector] Connectio

      Hello there,

      I'm having a problem regarding JSFUnit. I have 2 JBoss (Version 4.2.3.GA); one is local on Windows XP, one is on a server with Linux. Both have the same configuration.

      I have an EAR-File in which I put a WAR file. In this WAR are the JSFUnit-Configs and Libs and so on. On my local JBoss the JSFUnit-Tests works fine, but when I try to start the JSFUnit-Tests on the server, I'm getting the following exception, one per testcase:

      [org.apache.commons.httpclient.HttpMethodDirector] Connection refused
      java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      at java.net.Socket.connect(Socket.java:519)
      at java.net.Socket.connect(Socket.java:469)
      at java.net.Socket.(Socket.java:366)
      at java.net.Socket.(Socket.java:240)
      at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
      at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
      at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
      at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
      at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
      at org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.connect_aroundBody0(HttpClientConnectionHelper.java:142)
      at org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.connect_aroundBody1$advice(HttpClientConnectionHelper.java:288)
      at org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.connect(HttpClientConnectionHelper.java)
      at org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:162)
      at org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:80)
      at org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:288)
      at org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
      at org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runWebTest(HttpProtocolHandler.java:159)
      at org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody0(HttpProtocolHandler.java:80)
      at org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody1$advice(HttpProtocolHandler.java:288)
      at org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest(HttpProtocolHandler.java)
      at org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCaseCaller.java:144)
      at org.apache.cactus.internal.AbstractCactusTestCase.runBareClient(AbstractCactusTestCase.java:215)
      at org.apache.cactus.internal.AbstractCactusTestCase.runBare(AbstractCactusTestCase.java:133)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:308)
      at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:186)
      at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:217)
      at org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:119)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:619)


      Could anyone help me please?
      Do you need more information?

      Thanks for any advise.
      Greetings, Versed

        • 1. Re: [org.apache.commons.httpclient.HttpMethodDirector] Conne
          ssilvert

          Are you bundling a cactus.properties file in your WAR? If so, you may have values in there that correspond to your local machine.

          Where did this stack trace come from? Are there other errors in the server log?

          Stan

          • 2. Re: [org.apache.commons.httpclient.HttpMethodDirector] Conne

            No, I'm not bundling a cactus.properties file in my WAR.

            The stack trace came from my JBoss-Server.log.

            The only other error is this:

            2009-11-12 16:18:48,108 INFO [org.apache.commons.httpclient.HttpMethodDirector] Retrying request
            2009-11-12 16:18:48,109 DEBUG [org.apache.commons.httpclient.HttpConnection] Open connection to some-server:8080
            2009-11-12 16:18:48,109 DEBUG [org.apache.commons.httpclient.HttpMethodDirector] Closing the connection.
            2009-11-12 16:18:48,109 INFO [org.apache.commons.httpclient.HttpMethodDirector] I/O exception (java.net.ConnectException) caught when processing request: Connection refused

            (and then the code from my original posting)

            • 3. Re: [org.apache.commons.httpclient.HttpMethodDirector] Conne
              ssilvert

              How are you connecting to the server? Is it through a proxy and/or firewall?

              When your test starts, it creates a real HTTP request that goes out of the server and back in.

              The basic problem is that the connection to some-server:8080 is refused. Your system probably doesn't expect a request to originate from the server. So whatever is handling connections to some-server:8080 is refusing that request.

              Stan

              • 4. Re: [org.apache.commons.httpclient.HttpMethodDirector] Conne

                The configuration is the following:

                a Linux-Server with JBoss 4.2.3.GA with one EAR (my application) and JSFUnit inside the EAR (more specific: inside the WAR that is inside the EAR)

                my local computer (Windows XP) with a proxy to go in the internet

                I treid to run
                http://some-server:8080/AppName/ServletTestRunner?suite=package.of.my.test.TestName&xsl=cactus-report.xsl
                from Firefox 3.5.

                I tried to shutdown my proxy, but it didn't help. (Both: system and firefox)