Web Logic 8.1 proxy servlet - Weblogic

This is a discussion on Web Logic 8.1 proxy servlet - Weblogic ; Hi all, I am trying to get the proxy server to work on WebLogic 8.1. All I want to do is redirect certain requests received by WebLogic to another web server. I referred to the following instructions: http://e-docs.bea.com/wls/docs81/plu...ttp_proxy.html . My ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Web Logic 8.1 proxy servlet

  1. Web Logic 8.1 proxy servlet


    Hi all,
    I am trying to get the proxy server to work on WebLogic 8.1. All I want to do
    is redirect certain requests received by WebLogic to another web server. I referred
    to the following instructions: http://e-docs.bea.com/wls/docs81/plu...ttp_proxy.html.
    My attempt at setting up weblogic to proxy requests failed.

    Here is what I did.
    1. I made my web application (DefaultWebApp) the default web application of the
    server instance by adding the following line to weblogic.xml:
    /

    2. Then I added the following to web.xml:

    myTestProxyServlet
    weblogic.servlet.proxy.HttpProxyServlet

    Debug
    ON


    redirectURL
    http://shark:6909


    PathTrim
    /proxies/mytest/




    myTestProxyServlet
    /proxies/mytest/*.html


    To test I did the following - dolphin is my weblogic server:
    Using my browser I went to the following address:
    http://dolphin:7001/proxies/mytest/index.html

    I expected to be redirected to http://shark:6090, however instead I got the 404
    error code. What am I doing wrong? Any help you can give me will be greatly appreciated.

    Thanks

    Manish

  2. Re: Web Logic 8.1 proxy servlet

    I'm not sure if there are other problems but you can only have url-patterns that
    are like:

    1) /proxies/mytest/*
    or
    2) *.html

    Sam

    Manish Ghayalod wrote:

    > Hi all,
    > I am trying to get the proxy server to work on WebLogic 8.1. All I want to do
    > is redirect certain requests received by WebLogic to another web server. I referred
    > to the following instructions: http://e-docs.bea.com/wls/docs81/plu...ttp_proxy.html.
    > My attempt at setting up weblogic to proxy requests failed.
    >
    > Here is what I did.
    > 1. I made my web application (DefaultWebApp) the default web application of the
    > server instance by adding the following line to weblogic.xml:
    > /
    >
    > 2. Then I added the following to web.xml:
    >
    > myTestProxyServlet
    > weblogic.servlet.proxy.HttpProxyServlet
    >
    > Debug
    > ON
    >

    >
    > redirectURL
    > http://shark:6909
    >
    >
    > PathTrim
    > /proxies/mytest/
    >

    >

    >
    >
    > myTestProxyServlet
    > /proxies/mytest/*.html
    >

    >
    > To test I did the following - dolphin is my weblogic server:
    > Using my browser I went to the following address:
    > http://dolphin:7001/proxies/mytest/index.html
    >
    > I expected to be redirected to http://shark:6090, however instead I got the 404
    > error code. What am I doing wrong? Any help you can give me will be greatly appreciated.
    >
    > Thanks
    >
    > Manish



  3. Re: Web Logic 8.1 proxy servlet - ignore previous post


    Hi Sam,
    Thank you for your response. I changed my web.xml file. Now it looks as follows:

    myTestProxyServlet
    weblogic.servlet.proxy.HttpProxyServlet

    Debug
    ON


    redirectURL
    http://shark.db.com:6909


    PathTrim
    /proxies/mytest/




    myTestProxyServlet
    /proxies/mytest/*


    If I try going to shark.db.com:6909 directly from my browser it works. However,
    if I trying going
    through the weblogic proxy (http://dolphin.db.com:7001/proxies/mytest), it fails.
    This is the
    error message I get:
    : Start connection timeout scheduler
    : GenericProxyServelt: init()
    : Create connection: ProxyConnection(isSecureProxy=false):
    shark.db.com:6909, keep-alive='30'secs
    : ===New Request===GET /proxies/mytest HTTP/1.1


    : In-bound headers:
    : Accept: image/gif, image/x-xbitmap, image/jpeg,
    image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
    application/x-shockwave-flash, */*
    : Accept-Language: en-us
    : Accept-Encoding: gzip, deflate
    : User-Agent: Mozilla/4.0 (compatible; MSIE 5.5;
    Windows NT 4.0; H010818)
    : Host: dolphin.db.com:7001
    : Connection: Keep-Alive
    : HTTP/1.1 404 Not Found
    : Out-bound headers:
    : Date: Fri, 05 Sep 2003 15:38:49 GMT
    : Server: Apache/1.3.9 (Unix)
    : Keep-Alive: timeout=360, max=100
    : Connection: Keep-Alive
    : Transfer-Encoding: chunked
    : Content-Type: text/html
    : Requeue connection: ProxyConnection(isSecureProxy=false):
    shark.db.com:6909, keep-alive='30'secs
    : Trigger remove idle for '44' secs: ProxyConnection(isSecureProxy=false):
    shark.db.com:6909, keep-alive='30'secs

    Thanks for your help...

    Manish



  4. Re: Web Logic 8.1 proxy servlet - ignore previous post

    Looks like we are getting somewhere. What happens if you try the original
    request that ended with a file? What does the access log of the server on
    shark.db.com say?

    I would also change the path trim so as not to include the trailing /, you will
    need a slash as the first part of the requested URL in general.



    PathTrim
    /proxies/mytest



    I'll test this locally as well. Can you send me the result of trying:

    http://dolphin:7001/proxies/mytest/index.html

    after you make the path trim change?

    Sam

    Manish Ghayalod wrote:

    > Hi Sam,
    > Thank you for your response. I changed my web.xml file. Now it looks as follows:
    >
    > myTestProxyServlet
    > weblogic.servlet.proxy.HttpProxyServlet
    >
    > Debug
    > ON
    >

    >
    > redirectURL
    > http://shark.db.com:6909
    >
    >
    > PathTrim
    > /proxies/mytest/
    >

    >

    >
    >
    > myTestProxyServlet
    > /proxies/mytest/*
    >

    >
    > If I try going to shark.db.com:6909 directly from my browser it works. However,
    > if I trying going
    > through the weblogic proxy (http://dolphin.db.com:7001/proxies/mytest), it fails.
    > This is the
    > error message I get:
    > : Start connection timeout scheduler
    > : GenericProxyServelt: init()
    > : Create connection: ProxyConnection(isSecureProxy=false):
    > shark.db.com:6909, keep-alive='30'secs
    > : ===New Request===GET /proxies/mytest HTTP/1.1
    >
    >
    > : In-bound headers:
    > : Accept: image/gif, image/x-xbitmap, image/jpeg,
    > image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
    > application/x-shockwave-flash, */*
    > : Accept-Language: en-us
    > : Accept-Encoding: gzip, deflate
    > : User-Agent: Mozilla/4.0 (compatible; MSIE 5.5;
    > Windows NT 4.0; H010818)
    > : Host: dolphin.db.com:7001
    > : Connection: Keep-Alive
    > : HTTP/1.1 404 Not Found
    > : Out-bound headers:
    > : Date: Fri, 05 Sep 2003 15:38:49 GMT
    > : Server: Apache/1.3.9 (Unix)
    > : Keep-Alive: timeout=360, max=100
    > : Connection: Keep-Alive
    > : Transfer-Encoding: chunked
    > : Content-Type: text/html
    > : Requeue connection: ProxyConnection(isSecureProxy=false):
    > shark.db.com:6909, keep-alive='30'secs
    > : Trigger remove idle for '44' secs: ProxyConnection(isSecureProxy=false):
    > shark.db.com:6909, keep-alive='30'secs
    >
    > Thanks for your help...
    >
    > Manish
    >
    >



  5. Re: Web Logic 8.1 proxy servlet - ignore previous post


    Hi Sam,
    Thanks for your response. I updated web.xml and removed the trailing / from
    PathTrim.

    Then I went to http://dolphin.db.com:7001/proxies/mytest/banner.html. That
    worked - weblogic proxied it to shark and banner.html appeared in my browser.

    I then tried going to http://dolphin.db.com:7001/proxies/mytest. That failed.
    The weblogic error I got was:
    : Start connection timeout scheduler
    : GenericProxyServelt: init()
    : Create connection: ProxyConnection(isSecureProxy=false):
    shark.db.com:6909, keep-alive='30'secs
    : ===New Request===GET HTTP/1.1

    : In-bound headers:
    : Accept: image/gif, image/x-xbitmap, image/jpeg,
    image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
    application/x-shockwave-flash, */*
    : Accept-Language: en-us
    : Accept-Encoding: gzip, deflate
    : User-Agent: Mozilla/4.0 (compatible; MSIE 5.5;
    Windows NT 4.0; H010818)
    : Host: dolphin.db.com:7001
    : Connection: Keep-Alive
    : Cookie: ADMINCONSOLESESSION=1Y9l7erX6JaDYJRNOYfA6GaxLLFID1 qDREoHZgLmgKB76b2e1gBD!1696045128;
    SignOnDefault=
    : Bad request
    <[ServletContext(id=23714420,name=defaultWebApp,cont ext-path=)]
    Servlet failed with Exception
    java.lang.NumberFormatException: For input string: "request"
    at java.lang.NumberFormatException.forInputString(Num berFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:426)
    at java.lang.Integer.parseInt(Integer.java:476)
    at weblogic.servlet.proxy.GenericProxyServlet.readSta tus(GenericProxyServlet.java:548)
    at weblogic.servlet.proxy.GenericProxyServlet.sendRes ponse(GenericProxyServlet.java:575)
    at weblogic.servlet.proxy.GenericProxyServlet.service (GenericProxyServlet.java:280)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :6310)
    at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)


    The access log on the weblogic server (dolphin) showed the following:
    10.124.172.196 - - [05/Sep/2003:17:18:05 -0400] "GET /proxies/mytest HTTP/1.1"
    500 2019

    The access log on the shark was:
    10.163.85.82 - - [05/Sep/2003:17:19:04 +0100] "GET " 400 147 "-" "-" "-"

    FYI - I was experimenting with the following web.xml configuration and went to

    http://dolphin.db.com:7001/. The proxy worked. The following web.xml worked
    (this configuration is not what we want though)

    myTestProxyServlet
    weblogic.servlet.proxy.HttpProxyServlet

    Debug
    ON



    redirectURL
    http://shark.db.com:6909





    myTestProxyServlet
    /*



    Thanks again for your help..

    Manish




    Sam Pullara wrote:
    >Looks like we are getting somewhere. What happens if you try the original
    >
    >request that ended with a file? What does the access log of the server
    >on
    >shark.db.com say?
    >
    >I would also change the path trim so as not to include the trailing /,
    >you will
    >need a slash as the first part of the requested URL in general.
    >
    >
    >
    > PathTrim
    > /proxies/mytest
    >

    >
    >
    >I'll test this locally as well. Can you send me the result of trying:
    >
    >http://dolphin:7001/proxies/mytest/index.html
    >
    >after you make the path trim change?
    >
    >Sam
    >
    >Manish Ghayalod wrote:
    >
    >> Hi Sam,
    >> Thank you for your response. I changed my web.xml file. Now it looks

    >as follows:
    >>
    >> myTestProxyServlet
    >> weblogic.servlet.proxy.HttpProxyServlet
    >>
    >> Debug
    >> ON
    >>

    >>
    >> redirectURL
    >> http://shark.db.com:6909
    >>
    >>
    >> PathTrim
    >> /proxies/mytest/
    >>

    >>

    >>
    >>
    >> myTestProxyServlet
    >> /proxies/mytest/*
    >>

    >>
    >> If I try going to shark.db.com:6909 directly from my browser it works.

    >However,
    >> if I trying going
    >> through the weblogic proxy (http://dolphin.db.com:7001/proxies/mytest),

    >it fails.
    >> This is the
    >> error message I get:
    >> : Start connection timeout scheduler
    >> : GenericProxyServelt: init()
    >> : Create connection: ProxyConnection(isSecureProxy=false):
    >> shark.db.com:6909, keep-alive='30'secs
    >> : ===New Request===GET /proxies/mytest

    >HTTP/1.1
    >>
    >>
    >> : In-bound headers:
    >> : Accept: image/gif, image/x-xbitmap,

    >image/jpeg,
    >> image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
    >> application/x-shockwave-flash, */*
    >> : Accept-Language: en-us
    >> : Accept-Encoding: gzip, deflate
    >> : User-Agent: Mozilla/4.0 (compatible;

    >MSIE 5.5;
    >> Windows NT 4.0; H010818)
    >> : Host: dolphin.db.com:7001
    >> : Connection: Keep-Alive
    >> : HTTP/1.1 404 Not Found
    >> : Out-bound headers:
    >> : Date: Fri, 05 Sep 2003 15:38:49 GMT
    >> : Server: Apache/1.3.9 (Unix)
    >> : Keep-Alive: timeout=360, max=100
    >> : Connection: Keep-Alive
    >> : Transfer-Encoding: chunked
    >> : Content-Type: text/html
    >> : Requeue connection: ProxyConnection(isSecureProxy=false):
    >> shark.db.com:6909, keep-alive='30'secs
    >> : Trigger remove idle for '44' secs:

    >ProxyConnection(isSecureProxy=false):
    >> shark.db.com:6909, keep-alive='30'secs
    >>
    >> Thanks for your help...
    >>
    >> Manish
    >>
    >>

    >



  6. Re: Web Logic 8.1 proxy servlet


    Hi Sam,
    One confusion I still have is as follows:
    The proxy to shark works if I have "/*" as the url-pattern. In this case, I can
    go
    to "http://dolphin.db.com:7001" and I get redirected to shark.db.com. Shouldn't
    this
    fail as well?

    If I have the url-pattern be anything else like: "/proxies/mytest/*"; I get a
    failure when
    I go to "http://dolphin.db.com:7001/proxies/mytest". I need to proxy different
    paths to different web-servers, so I cannot work at the root level (meaning I
    cannot
    remove "/proxies/mytest" from the URL.

    Do you see any other problem with my current web.xml:

    myTestProxyServlet
    weblogic.servlet.proxy.HttpProxyServlet

    Debug
    ON


    redirectURL
    http://shark.db.com:6909


    PathTrim
    /proxies/mytest




    myTestProxyServlet
    /proxies/mytest/*



    The weblogic error I get is:
    : Start connection timeout scheduler
    : GenericProxyServelt: init()
    : Create connection: ProxyConnection(isSecureProxy=false):
    shark.db.com:6909, keep-alive='30'secs
    : ===New Request===GET HTTP/1.1

    : In-bound headers:
    : Accept: image/gif, image/x-xbitmap,
    image/jpeg,
    image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
    application/x-shockwave-flash, */*
    : Accept-Language: en-us
    : Accept-Encoding: gzip, deflate
    : User-Agent: Mozilla/4.0 (compatible;
    MSIE 5.5;
    Windows NT 4.0; H010818)
    : Host: dolphin.db.com:7001
    : Connection: Keep-Alive
    : Cookie: ADMINCONSOLESESSION=1Y9l7erX6JaDYJRNOYfA6GaxLLFID1 qDREoHZgLmgKB76b2e1gBD!1696045128;
    SignOnDefault=
    : Bad request
    <[ServletContext(id=23714420,name=defaultWebApp,cont ext-path=)]
    Servlet failed with Exception
    java.lang.NumberFormatException: For input string: "request"
    at java.lang.NumberFormatException.forInputString(Num berFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:426)
    at java.lang.Integer.parseInt(Integer.java:476)
    at weblogic.servlet.proxy.GenericProxyServlet.readSta tus(GenericProxyServlet.java:548)
    at weblogic.servlet.proxy.GenericProxyServlet.sendRes ponse(GenericProxyServlet.java:575)
    at weblogic.servlet.proxy.GenericProxyServlet.service (GenericProxyServlet.java:280)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :6310)
    at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)


    The access log on the weblogic server (dolphin) shows the following:
    10.124.172.196 - - [05/Sep/2003:17:18:05 -0400] "GET /proxies/mytest HTTP/1.1"
    500 2019

    The access log on the shark was:
    10.163.85.82 - - [05/Sep/2003:17:19:04 +0100] "GET " 400 147 "-" "-" "-"

    Please let me know if you think this is the weblogic 8.1 bug that you mentioned
    in your
    previous post. If it is, please let me know how I file a bug report. Is this problem
    new as of weblogic 8.1? My proxying works well with weblogic 6.1. Can you also
    point me to any
    other documentation that explains weblogic proxy server configuration in greater
    detail
    than http://e-docs.bea.com/wls/docs81/plu...ttp_proxy.html.

    I appreciate all your help...

    Thanks

    Manish

  7. Re: Web Logic 8.1 proxy servlet

    I think in 6.1 we used a different strategy to determine the URL. 8.1 is
    probably more compliant with the specification and that is causing problems. I
    would though file a bug with support against the proxy servlet as it should have
    been updated to properly resolve the URL to a valid one. Right now it is trying
    to proxy to the empty string "" and thats not going to work well. It should
    never proxy to an invalid URL.

    Sam

    Manish Ghayalod wrote:

    > Hi Sam,
    > One confusion I still have is as follows:
    > The proxy to shark works if I have "/*" as the url-pattern. In this case, I can
    > go
    > to "http://dolphin.db.com:7001" and I get redirected to shark.db.com. Shouldn't
    > this
    > fail as well?
    >
    > If I have the url-pattern be anything else like: "/proxies/mytest/*"; I get a
    > failure when
    > I go to "http://dolphin.db.com:7001/proxies/mytest". I need to proxy different
    > paths to different web-servers, so I cannot work at the root level (meaning I
    > cannot
    > remove "/proxies/mytest" from the URL.
    >
    > Do you see any other problem with my current web.xml:
    >
    > myTestProxyServlet
    > weblogic.servlet.proxy.HttpProxyServlet
    >
    > Debug
    > ON
    >

    >
    > redirectURL
    > http://shark.db.com:6909
    >
    >
    > PathTrim
    > /proxies/mytest
    >

    >

    >
    >
    > myTestProxyServlet
    > /proxies/mytest/*
    >

    >
    >
    > The weblogic error I get is:
    > : Start connection timeout scheduler
    > : GenericProxyServelt: init()
    > : Create connection: ProxyConnection(isSecureProxy=false):
    > shark.db.com:6909, keep-alive='30'secs
    > : ===New Request===GET HTTP/1.1
    >
    > : In-bound headers:
    > : Accept: image/gif, image/x-xbitmap,
    > image/jpeg,
    > image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
    > application/x-shockwave-flash, */*
    > : Accept-Language: en-us
    > : Accept-Encoding: gzip, deflate
    > : User-Agent: Mozilla/4.0 (compatible;
    > MSIE 5.5;
    > Windows NT 4.0; H010818)
    > : Host: dolphin.db.com:7001
    > : Connection: Keep-Alive
    > : Cookie: ADMINCONSOLESESSION=1Y9l7erX6JaDYJRNOYfA6GaxLLFID1 qDREoHZgLmgKB76b2e1gBD!1696045128;
    > SignOnDefault=
    > : Bad request
    > <[ServletContext(id=23714420,name=defaultWebApp,cont ext-path=)]
    > Servlet failed with Exception
    > java.lang.NumberFormatException: For input string: "request "
    > at java.lang.NumberFormatException.forInputString(Num berFormatException.java:48)
    > at java.lang.Integer.parseInt(Integer.java:426)
    > at java.lang.Integer.parseInt(Integer.java:476)
    > at weblogic.servlet.proxy.GenericProxyServlet.readSta tus(GenericProxyServlet.java:548)
    > at weblogic.servlet.proxy.GenericProxyServlet.sendRes ponse(GenericProxyServlet.java:575)
    > at weblogic.servlet.proxy.GenericProxyServlet.service (GenericProxyServlet.java:280)
    > at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    > at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.java:1053)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:387)
    > at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:305)
    > at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :6310)
    > at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:317)
    > at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
    > at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3622)
    > at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2569)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    >
    >
    > The access log on the weblogic server (dolphin) shows the following:
    > 10.124.172.196 - - [05/Sep/2003:17:18:05 -0400] "GET /proxies/mytest HTTP/1.1"
    > 500 2019
    >
    > The access log on the shark was:
    > 10.163.85.82 - - [05/Sep/2003:17:19:04 +0100] "GET " 400 147 "-" "-" "-"
    >
    > Please let me know if you think this is the weblogic 8.1 bug that you mentioned
    > in your
    > previous post. If it is, please let me know how I file a bug report. Is this problem
    > new as of weblogic 8.1? My proxying works well with weblogic 6.1. Can you also
    > point me to any
    > other documentation that explains weblogic proxy server configuration in greater
    > detail
    > than http://e-docs.bea.com/wls/docs81/plu...ttp_proxy.html.
    >
    > I appreciate all your help...
    >
    > Thanks
    >
    > Manish



+ Reply to Thread