lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Serebrennikov <dmit...@earthlink.net>
Subject Re: Proxy Con. Problem in Weblogic.
Date Wed, 22 Sep 2004 02:17:21 GMT
This, of course, isn't the right forum for this question...
Not to encourage off-topic posts, but I just happened to know at least 
part of the answer since we just went through the same issue.

First thing to do is to make sure you are setting these properties 
before the first URLStreamHandler for "http" is created. In WebLogic, 
this means you really must specify them on the command line with -D 
options, because by the time your code starts to run, WebLogic has 
already initialized the stream handler. This may or may not help, 
depending on which JVM is being used.

Also, WebLogic supplies its own http stack, they don't use Sun's stack 
that ships with the JVM. Tomcat does, so the behavior will be different. 
As long as you are using WebLogic's http stack, be aware that it has 
different configuration options than the standard Sun's stack. I think 
the proxy settings use the same -D options, but I may be wrong.

You can control which stack is used in various ways. WebLogic recognizes 
a -D option called: weblogic.net.http.URLStreamHandlerFactory. Google 
for it and you will find out how it is supposed to work. I know it works 
at least some of the time, but I wasn't able to get it to work for me.

Another way that does work is to set a URLStreamHandler on the URL 
object when you create it (see java.net.URL constructors). You can 
create a URLStreamHandler object explicitly and this way force the use 
of Sun's stack. Sun's handler is called sun.net.www.protocol.http.Handler.

Hope this helps.
Good luck!

Dmitry.


Natarajan.T wrote:

>Hi FYI,
>
> 
>
>I am doing web crawling in my application using proxy setting. like the
>below code..
>
> 
>
>Properties systemSettings = System.getProperties();
>
>systemSettings.put("http.proxySet", "true");
>
>systemSettings.put("http.proxyHost",
>profileBean.getProfileParamBean().getProxyHost().trim());
>
>systemSettings.put("http.proxyPort",
>profileBean.getProfileParamBean().getProxyPort().trim());
>
>System.setProperties(systemSettings);
>
> 
>
> 
>
>This code working fine in Tomcat5.0 but I am getting runtime error in
>Weblogic8.
>
> 
>
>How can I handle this problem???
>
> 
>
>Advance Thanks.
>
> 
>
> 
>
>Regards,
>
>Natarajan.
>
> 
>
> 
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message