Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    HttpProxyServlet Error in Weblogic

    Hi

    I am getting errors when i have deployed web application in weblogic, which uses HttpProxyServlet to communicate with webservice. This error is occuring when The HttpProxyServlet is trying to access webservice.
    Code:
    === 2008-06-26 12:28:43,112 [ng)'] WARN  HttpProxyServlet - HttpProxy - Method failed: HTTP/1.1 500 Server Error
    === 2008-06-26 12:28:43,174 [ng)'] ERROR HttpProxyServlet - HttpProxy - Top-level servlet error: 
    java.lang.IllegalArgumentException: Header:Content-Type Cannot contain CRLF Charcters
    	at weblogic.servlet.internal.ServletResponseImpl.checkForCRLFChars(ServletResponseImpl.java:1531)
    	at weblogic.servlet.internal.ServletResponseImpl.addHeader(ServletResponseImpl.java:536)
    	at com.isomorphic.servlet.HttpProxyServlet.doPost(HttpProxyServlet.java:477)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
    	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3395)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
    	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
    	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    It seems The servlet is adding /n in SOAP Message or Servlet header.
    Any suggestions please?
    Last edited by gurugubelli; 26 Jun 2008, 12:19.

    #2
    Hi gurugubelli,

    This stack trace indicates that the proxy has received an invalid Content-Type header (containing a CRLF) from the web service that the proxy is contacting. The proxy does not process the Content-Type header in any way, it merely passes it through. We'd recommend looking directly at the output of the web service to find the problem.

    Comment


      #3
      Hi Isomorphic

      When I am using local deployed webservice I am not getting above error but If i am using same deployed webservice in different machine, I am getting this error.
      Do we need to have anu other configuration to connect remote server webservice?

      Comment


        #4
        Do you have any indication that the response being returned by the web service is valid at all in this case? You really need to look at that response. Again, the proxy is just a relay and does no processing of any kind on the Content-Type header. The most likely explanation is that your web service is actually returning some kind of invalid or error response in this scenario.

        Comment


          #5
          HTTPProxyServlet in Local Tomcat and Remote Webservice developed using JAX-WS deployed in Weblogic is working fine.

          HTTPProxyServlet in Local Weblogic and Local Webservice deployed in Weblogic is working fine.

          HTTPProxySevlet in Local Weblogic and Remote Webservice deployed in Weblogic is not working, The service is generating response but internally weblogic is checking CRLF in headers of servlet response(Content-Length).

          I am able to test remote Webservice using standard tools(SOAP UI) and its working fine. Only the case like its not wroking with HTTPProxyServlet in Local Weblogc and Service in Remote. Please find below complete log for an operation .... I am getting same kind of errors for all operations.....

          Code:
          === 2008-06-30 09:15:09,777 [ng)'] DEBUG XML - Parsed XML from (in memory stream): 0ms
          === 2008-06-30 09:15:09,777 [ng)'] DEBUG HttpProxyServlet - HttpProxy - ProxyData is: {
              xsi:"http://www.w3.org/2000/10/XMLSchema-instance",
              url:"REMOTE_URL",
              httpMethod:"POST",
              contentType:"text/xml",
              requestBody:"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' \n          xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n          xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Header></soap:Header><soap:Body>\n<ns0:getRegulatoryMarkets \n         xmlns:ns0=\"SCHEMA_NAMESPACE"/>\n</soap:Body></soap:Envelope>",
              httpHeaders:{SOAPAction:"\"\""}
          }
          === 2008-06-30 09:15:09,793 [ng)'] INFO  HttpProxyServlet - HttpProxy - writing body: <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' 
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header></soap:Header><soap:Body>
          <ns0:getRegulatoryMarkets 
                   xmlns:ns0="SCHEMA_NAMESPACE"/>
          </soap:Body></soap:Envelope>
          === 2008-06-30 09:15:09,980 [ng)'] INFO  HttpProxyServlet - HttpProxy - Method succeeded: : HTTP/1.1 200 OK
          === 2008-06-30 09:15:09,980 [ng)'] ERROR HttpProxyServlet - HttpProxy - Top-level servlet error: 
          java.lang.IllegalArgumentException: Header:Content-Length Cannot contain CRLF Charcters
          	at weblogic.servlet.internal.ServletResponseImpl.checkForCRLFChars(ServletResponseImpl.java:1531)
          	at weblogic.servlet.internal.ServletResponseImpl.addHeader(ServletResponseImpl.java:536)
          	at com.isomorphic.servlet.HttpProxyServlet.doPost(HttpProxyServlet.java:471)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
          	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
          	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
          	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
          	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
          	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
          	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3395)
          	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
          	at weblogic.security.service.SecurityManager.runAs(Unknown Source)
          	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
          	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
          	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
          	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
          	at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

          Comment


            #6
            Hi gurugubelli,

            Sorry your having trouble, but the thing you need to look at is still the same as the first time you posted. You need to be able to inspect the response that the remote web service is sending to SmartClient's HTTPProxy.

            The fact that you can directly connect to the remote web service with SOAP UI indicates nothing - the web service may be sending a different response to the HTTPProxy from what SOAP UI is receiving, or SOAP UI may be tolerating malformed responses that WebLogic does not allow.

            There is no substitute for inspecting the response returned by the remote web service to the HTTPProxy.

            Comment


              #7
              Please let us know if you have any information/suggestions on this.....
              Thanks
              Sravan

              Comment


                #8
                Hi Sravan,

                The SmartClient HttpProxy simply takes the Content-Type header from the web service and attempts to send it to the browser. It is not processed or inspected in any way.

                This is almost certainly a WebLogic bug. If you are desparate and can't get a response from WebLogic support, Isomorphic could build you a custom version of the HttpProxy that tries to work around the WebLogic bug - contact us here to discuss a possible engagement.

                Comment


                  #9
                  Is it something to do with Weblogic server version? SmartClient compatibility claim is up until 9.x of weblogic? Just a thought

                  Comment


                    #10
                    Hi guys,

                    Just for context, here is the actual code that processes the Content-Type header within HttpProxyServlet.java:

                    Code:
                    Header contentLengthHeader = httpMethod.getResponseHeader("Content-Length");
                    if(contentLengthHeader != null)
                        response.addHeader("Content-Length", contentLengthHeader.toExternalForm());
                    So, not a lot of room for us to introduce a CRLF :)

                    The classes involved are from the Apache HttpClient project. Maybe these classes, or the versions you have deployed, have a problem with Weblogic 9?

                    Comment


                      #11
                      Upon further inspection it appears that this is actually our bug - toExternalForm() isn't the right thing to be calling here. This will be fixed in 6.5.2.

                      Comment


                        #12
                        CRLF character HttpProxyServlet exception

                        Hello,

                        Did the fix referred to, in the blog, move in to the 6.5.2 version?

                        Will the replacement of just one class(HttpProxy) inside isomorphic_core_rpc.jar, solve the CRLF bug.

                        Thanks
                        Chandrashekhar

                        Comment


                          #13
                          The fix is in 7.0 beta, available on the Isomorphic blog. Don't try to mix the .jars.

                          Comment

                          Working...
                          X