Announcement

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

    nullpointer using rules on HttpProxy

    Hi,

    I'm setting up an RSS feed example from this url
    Code:
    http://us.lrd.yahoo.com/_ylt=AnMLMAdiyYixYgiTu_TlRFFA4gEA;_ylu=X3oDMTE4aWdhZmEzBHBvcwMzMgRzZWMDeW5fcHJvbW9zX2ZyZWVfaHRtbARzbGsDaW1hZ2U-/SIG=11997d1q0/**http%3A//rss.news.yahoo.com/rss/europe

    I configure HttpProxy like this:
    Code:
        <servlet>
            <servlet-name>HttpProxy</servlet-name>
            <servlet-class>com.isomorphic.servlet.HttpProxyServlet</servlet-class>
            <init-param>
           		<param-name>proxyHost</param-name>
           		<param-value>wwwproxy</param-value>
       	</init-param>
       	 <init-param>
           		<param-name>proxyPort</param-name>
           		<param-value>8080</param-value>
       	</init-param>
        </servlet>
    and it works OK: I get the RSS feed in the ListGrid.



    I add a rule for the domain, like this: (also tried with the newlines)

    Code:
        <servlet>
            <servlet-name>HttpProxy</servlet-name>
            <servlet-class>com.isomorphic.servlet.HttpProxyServlet</servlet-class>
            <init-param>
           		<param-name>proxyHost</param-name>
           		<param-value>wwwproxy</param-value>
       	</init-param>
       	 <init-param>
           		<param-name>proxyPort</param-name>
           		<param-value>8080</param-value>
       	</init-param>
       	<init-param>
           		<param-name>rules</param-name>
           		<param-value>match:|http://us.lrd.yahoo.com/|</param-value>
       	</init-param>
        </servlet>
    which results in nullpointer here:

    Code:
    === 2010-09-08 11:19:24,890 [l0-4] DEBUG HttpProxyServlet - HttpProxy - ProxyData is: {
        xsi:"http://www.w3.org/2000/10/XMLSchema-instance",
        url:"http://us.lrd.yahoo.com/_ylt=AnMLMAdiyYixYgiTu_TlRFFA4gEA;_ylu=X3oDMTE4aWdhZmEzBHBvcwMzMgRzZWMDeW5fcHJvbW9zX2ZyZWVfaHRtbARzbGsDaW1hZ2U-/SIG=11997d1q0/**http%3A//rss.news.yahoo.com/rss/europe",
        httpMethod:"GET",
        params:{
            __gwt_ObjectId:1084
        },
        requestBody:null
    }
    === 2010-09-08 11:19:24,890 [l0-4] ERROR HttpProxyServlet - HttpProxy - Top-level servlet error: 
    java.lang.NullPointerException
    	at com.isomorphic.servlet.HttpProxyServlet.doPost(HttpProxyServlet.java:356)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
    	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)

    What syntax can I use in the rules?
    like wildcards? e.g. match:|http://*.yahoo.com/| ?
    How can I ignore localhost and *.ourdomain.com to go to the proxy?


    thanks

    SmartGWT EE 2.3
    SmartClient Version: SC_SNAPSHOT-2010-08-03/EVAL Deployment (expires 2010.10.02_09.35.33)

    #2
    This was caused by a bug which has now been fixed - thanks for the report. We've also changed the documentation slightly to make it clearer what the syntax is (basically, we do a regex match), and how you specify exclusion filters.

    As for how you exclude certain domains from going via the proxy, this is not something that would make sense for user code to do. The proxy is there to work around the browser same origin policy. SmartGWT is able to work out if a request is cross-domain or not: if it is, then you need the proxy, and if it isn't then you don't. The proxy is only used when necessary, and then it is used automatically.

    Comment

    Working...
    X