hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Brown" <chris92...@hotmail.com>
Subject RE: Auto-detecting proxy settings in a standalone Java app
Date Fri, 22 Oct 2004 14:34:42 GMT

I can get this to work within an applet, but not standalone.  When running 
standalone, I have the "plugin.jar" file in the classpath (it was also 
obviously in the classpath at compile time)...  However, when standalone, it 
fails to load a dependent DLL..

Here's the code:

package sandbox;
import sun.plugin.net.proxy.*;
public class Test
public static void main(String[] args)
  WIExplorerProxyConfig wiExplorerProxyConfig = new WIExplorerProxyConfig();
  BrowserProxyInfo browserProxyInfo = 

And here's the stack trace:

java.lang.UnsatisfiedLinkError: initIDs
at sun.plugin.services.WinRegistry.initIDs(Native Method)
at sun.plugin.services.WinRegistry.init(WinRegistry.java:113)
at sandbox.Test.main(Test.java:18)

And (going over the top), here's the launch command:
C:\java\jdk1.4.2\bin\java -Didea.launcher.port=7533 
-Dfile.encoding=windows-1252 -classpath 


com.intellij.rt.execution.application.AppMain sandbox.Test

Any thoughts?


I obviously need some other file in the path, but I don't know which...

>From: Bruce McHaffie <bruce.mchaffie@entrust.com>
>Reply-To: "Commons HttpClient Project" 
>To: "'Commons HttpClient Project'" 
>Subject: RE: Auto-detecting proxy settings in a standalone Java app
>Date: Fri, 22 Oct 2004 09:41:57 -0400
>Hi Chris,
>You may also want to take a look at the plugin.jar that ships with the JRE.
>You'll find some good stuff in sun.plugin.net.proxy.WIExplorerProxyConfig.
>Here are the registry entries that Sun looks for in that class.
>     private static final String REGSTR_PATH_INTERNET_SETTINGS =
>"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";
>     private static final String REGSTR_VAL_PROXYENABLE = "ProxyEnable";
>     private static final String REGSTR_VAL_PROXYSERVER = "ProxyServer";
>     private static final String REGSTR_VAL_PROXYOVERRIDE = 
>     private static final String REGSTR_VAL_AUTOCONFIGURL = 
>There are also proxy detection classes for other browsers in the same
>-----Original Message-----
>From: Roland Weber [mailto:ROLWEBER@de.ibm.com]
>Sent: October 22, 2004 7:16 AM
>To: Commons HttpClient Project
>Subject: Re: Auto-detecting proxy settings in a standalone Java app
>Hello Chris,
>setting a fantasy proxy server in IE and searching for it in the registry
>-> ProxyServer
>-> ProxyEnable
>a quick search on Google for "Java Windows Registry" yields:
>A public domain solution to access the Windows registry.
>An LGPL-licensed solution to access the Windows registry.
>hope that helps,
>   Roland
>"Chris Brown" <chris92250@hotmail.com>
>22.10.2004 12:45
>Please respond to
>"Commons HttpClient Project"
>Re: Auto-detecting proxy settings in a standalone Java app
>Thanks for all the rapid feedback so far.
>I don't have VB or the VB runtime, although perhaps I could use the
>JNIWrapper software to access this information (if I knew where it
>   Pity the Webstart proxy detection stuff isn't available for all to see,
>it returns (I think) appropriate params, whether you use IE or Mozilla or
>On the other hand, given that JNIWrapper is commercial software, perhaps
>someone would know how to write a simple C program with "mingw" or
>(easy to compile).  It could detect params and return them on STDOUT, to
>picked up either by a startup.bat or even through Runtime.exec() (solving
>the "restart the JVM" problem discussed earlier in this thread).
>First thing's first though... does anyone know where this information is
>stored in Windows ?  IE and Mozilla/Firefox seem good targets for
>Hey, why not even a little optional subproject for HTTPClient (requiring
>and a compiler, preferably not *requiring* the MS tool chain), with a
>ProxyDetector interface, and a series of platform-specific implementations
>(to go further than my current Windows-only need) ?
>Any thoughts on these big ideas, or at least as far as solving the
>problem (where are these settings stored and how can I get at them?)
>Thanks to all,
>To unsubscribe, e-mail: 
>For additional commands, e-mail: 

Hotmail : bientôt 250 Mo de stockage ! 

To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

View raw message