File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Exception while running applets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Exception while running applets" Watch "Exception while running applets" New topic
Author

Exception while running applets

vidhyasagar reddy
Ranch Hand

Joined: Jul 05, 2005
Posts: 40
I was running the game by using the applets

while running it is executing partially and showing the exception shown below. can any body tell why this exception came . did u feel it is becos of code or becos we need to set permissions explicitly for running this

***********************exception*****************************************




Exception in thread "AsyncConnector:10.10.0.37:4561" java.security.AccessControlException: access denied (java.net.SocketPermission 10.10.0.37:4561 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.sun.media.jsdt.http.TCPSocket.<init>(TCPSocket.java:73)
at com.sun.media.jsdt.http.TCPSocketFactory.createSocket(TCPSocketFactory.java:56)
at com.sun.media.jsdt.http.AsyncConnector.run(JSDTMasterSocketFactory.java:350)
at java.lang.Thread.run(Unknown Source)
Exception in thread "AsyncConnector:10.10.0.37:4561" java.security.AccessControlException: access denied (java.net.SocketPermission 10.10.0.37:4561 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.sun.media.jsdt.http.TCPSocket.<init>(TCPSocket.java:73)
at com.sun.media.jsdt.http.TCPSocketFactory.createSocket(TCPSocketFactory.java:56)
at com.sun.media.jsdt.http.AsyncConnector.run(JSDTMasterSocketFactory.java:350)
at java.lang.Thread.run(Unknown Source)
java.security.AccessControlException: access denied (java.net.SocketPermission 10.10.0.37:4561 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at com.sun.media.jsdt.http.HttpSendSocket.writeNotify(HttpSendSocket.java:183)
at com.sun.media.jsdt.http.HttpSendSocket.<init>(HttpSendSocket.java:107)
at com.sun.media.jsdt.http.HttpToPortSocketFactory.createSocket(HttpToPortSocketFactory.java:55)
at com.sun.media.jsdt.http.JSDTMasterSocketFactory.createSocket(JSDTMasterSocketFactory.java:179)
at com.sun.media.jsdt.http.HttpThread.makeNewConnection(HttpThread.java:512)
at com.sun.media.jsdt.http.HttpThread.writeMessageHeader(HttpThread.java:986)
at com.sun.media.jsdt.http.NamingProxy.list(NamingProxy.java:1116)
at com.sun.media.jsdt.Naming.list(Naming.java:353)
at com.sun.media.jsdt.SessionFactory.sessionExists(SessionFactory.java:357)
at chess.ChessCanvas.connect(ChessCanvas.java:299)
at chess.ChessCanvas.setup(ChessCanvas.java:279)
at chess.ChessCanvas.<init>(ChessCanvas.java:1147)
at chess.Chess.start(Chess.java:141)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caught exception in java.security.AccessControlException: access denied (java.net.SocketPermission 10.10.0.37:4561 connect,resolve)JackUser.connect: java.security.AccessControlException: access denied (java.net.SocketPermission 10.10.0.37:4561 connect,resolve)



*************************************************************************



thx in Advance waiting for ur reply
my mail id is vidhyar@netsoftglobal.com
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41494
    
  53
If the applet is not signed or otherwise specifically enabled, it can only connect to the host from where it was served. If it was not served by 10.10.0.37, then the connection is not allowed.


Ping & DNS - my free Android networking tools app
vidhyasagar reddy
Ranch Hand

Joined: Jul 05, 2005
Posts: 40
ip 10.10.0.37 is a local one . do u know how to give permissions becos i was new applets previously i was working on j2ee
Sunil Kumar Gupta
Ranch Hand

Joined: Aug 26, 2005
Posts: 824
Check this link

http://support.sas.com/rnd/appdev/tech/signing/RSASigning.htm


it may solve ur problem


Lack of will power has caused more failure than lack of intelligence or ability.
My Blog | Red5 Resources | Technology Update | Daily Technology Tips
vidhyasagar reddy
Ranch Hand

Joined: Jul 05, 2005
Posts: 40
if it is throwing in network then it is ok but it is not at all working in the local ip it self . that's the problem
Sunil Kumar Gupta
Ranch Hand

Joined: Aug 26, 2005
Posts: 824
The security issue comes when Applet comes, does not matter, ur

applet is in network or running locally...

Ur applet is somehow doing the task , that voilating the

security...Its better to sign the applet and then check

ur problem again...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception while running applets