Hello, I have troubles with using proxy from java-agent.
I develop simple Java-agent and I faced with the fact, that connection through proxy doesn’t work from domino 8.5.2 or, maybe, I do something wrong.
I tried 2 methods
- set system properties
System.setProperty(“http.proxySet”, “True”);
System.setProperty(“http.proxyHost”, “proxy-server-address”);
System.setProperty(“http.proxyPort”, “3128”);
and I changed file “java.policy” (located at notes\jvm\lib\security )
permission java.util.PropertyPermission "http.proxySet", "write";
permission java.util.PropertyPermission "http.proxyHost", "write";
permission java.util.PropertyPermission "http.proxyPort", "write";
I don’t know why, but this method doesn’t work - java agent ignores proxy-settings (I rebooted LOtus and OS).
-
In J2SE 1.5 was implemented new class java.net.Proxy and method in java.net.URL-class to support it (URL.openConnection(Proxy proxy)).
SocketAddress pa = new InetSocketAddress(proxyAddress, proxyPort); Proxy proxy = new Proxy(Proxy.Type.HTTP, pa); URL url = null; InputStream inputStream = null; HttpURLConnection http_conn = null; try { url = new URL("http://www.site.ru/simpledata.zip"); http_conn = (HttpURLConnection)url.openConnection(proxy); } catch (MalformedURLException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); }
This code work in eclipse with Lotus jvm, but doesn’t working from java-agent with exception
java.lang.UnsupportedOperationException: Method not implemented.
at java.net.URLStreamHandler.openConnection(URLStreamHandler
I think that is because in IBM URLStreamHandler implementation ( COM.ibm.JEmpower.applet.http.Handler and COM.ibm.JEmpower.applet.http.HttpURLConnection) doesn’t implemented method openConnection with proxy.
But, why first method doesn’t work I can’t understand
p.s. sorry for my English, thanks for reading and help