We help IT Professionals succeed at work.
Get Started

Java application through proxy Charles

duncanb7
duncanb7 asked
on
4,147 Views
Last Modified: 2012-07-10
Dear Experts,


I get one applet java application  and I am using it in IE every day.
Now I would like to save the data I want from the application through
the proxy , now I am using Charles debugger proxy.
From the Sun document,http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html, it mention set the java for proxy  at command line.
I tried it at my PC at C:/program files/java/jre7/bin/java -D http.proxyHost=127.0.0.1 -D
http.proxyPort=8888, but it doesn't work, just error Can't find the variable

And I try to use javascript,
<html>
<head>
</head>
<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
java.lang.System.getProperties().put("http.proxyHost", "127.0.0.1");
java.lang.System.getProperties().put("http.proxyPort", "8888");
 
   var javaVersion = java.lang.System.getProperty("java.version");  
   alert(javaVersion);
//--></SCRIPT></COMMENT>
<body>
</body>
</html>

Firefox reports,
Error: uncaught exception: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "*" "read,write")
and only alert(javaVersion) is working.

I already open or run Charles proxy software and its client adress is set 127.0.0.1:8888
before I do the previous action and  Charles running is fine from IE and Firefox.
But it doesn't show any information data  I want  from my applet application that is
probably related to those proxy setting for Java proxy is not correct.
And my PC I login in as  adminstrative manager mode  already
Any advise to solve the issue, I am not familar with java code  and if provide
the simple code for setting system proxy property for Java that is
strongly welcome.

Please advise
Duncan
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 3 Answers and 41 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE