Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

applet servlet communication - security problem

Status
Not open for further replies.

plingwood

Programmer
May 24, 2000
1
0
0
IE
when i try to open a URLCOnnection to a servlet i keep getting the below error message.<br>This worked not so long ago .. and no code has been changed<br>any one know why ... thanks.<br>Included below is the troublesome snippet of code :<br><br><br>ERROR MESSAGE :<br>com.ms.security.SecurityExceptionEx[Unknown]: cannot access &quot;server_name&quot; at com/ms/security/permissions/NetIOPermission.check (NetIOPermission.java)<br><br> at com/ms/security/PolicyEngine.deepCheck (PolicyEngine.java)<br><br> at com/ms/security/PolicyEngine.checkPermission (PolicyEngine.java)<br><br> at com/ms/security/StandardSecurityManager.chk (StandardSecurityManager.java)<br><br> at com/ms/security/StandardSecurityManager.chkex (StandardSecurityManager.java)<br><br> at com/ms/security/StandardSecurityManager.checkConnect <br>(StandardSecurityManager.java)<br><br> at com/ms/net/wininet/WininetURLConnection.connect (WininetURLConnection.java)<br><br> at com/ms/net/wininet/http/HttpURLConnection.getOutputStream (HttpURLConnection.java)<br> at TEApplet.sendPostObject (TEApplet.java:156)<br> at TEApplet.sendObject (TEApplet.java:122)<br> at TEApplet.sendData (TEApplet.java:102)<br><br><br>#########################################################<br>CODE SNIPPET :<br>public InputStream sendPostObject(Serializable obj) <br> throws IOException {<br>&nbsp;&nbsp;&nbsp;URL servlet = new URL(&quot;/servlets/TheServlet&quot;);<br>&nbsp;&nbsp;&nbsp;URLConnection con = servlet.openConnection();<br>&nbsp;&nbsp;&nbsp;if (con == null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;con.setDoInput(true);<br>&nbsp;&nbsp;&nbsp;con.setDoOutput(true);<br>&nbsp;&nbsp;&nbsp;con.setUseCaches(false);<br> <br>&nbsp;&nbsp;&nbsp;// the error occurs at this line<br>&nbsp;&nbsp;&nbsp;ObjectOutputStream out = new <br>&nbsp;&nbsp;&nbsp;ObjectOutputStream(con.getOutputStream());<br>&nbsp;&nbsp;&nbsp;out.writeObject(obj);<br>&nbsp;&nbsp;&nbsp;out.flush();<br>&nbsp;&nbsp;&nbsp;out.close();<br>&nbsp;&nbsp;&nbsp;InputStream i = con.getInputStream();<br>&nbsp;&nbsp;&nbsp;return i;<br>}
 
I believe that your firewall policy is not allowing your applet to communicate with the server.

Try changing the policy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top