java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:51258" "connect,resolve")

634 views
Skip to first unread message

Ildoo Kim

unread,
Jan 16, 2015, 5:07:49 AM1/16/15
to robocode-...@googlegroups.com


I want to make my robot communicating with another machine

but i always get 

java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:51258" "connect,resolve")



How can I change policy?

Flemming Larsen

unread,
Jan 16, 2015, 4:12:29 PM1/16/15
to robocode-...@googlegroups.com
Hi Ildoo,

Have you tried to disable the security in Robocode? (Read more about console usage here)

You need to change the file robocode.bat, robocode.sh, robocode.cmd depending on your system with the line starting Robocode:

 java -Xmx512M -DNOSECURITY=true -Dsun.io.useCanonCaches=false -cp libs/robocode.jar robocode.Robocode

That is, the '-DNOSECURITY=true' disables the internal/additional security management introduced in Robocode.

I hope this helps?

Cheers,
- Flemming

Ildoo Kim

unread,
Jan 16, 2015, 10:59:08 PM1/16/15
to robocode-...@googlegroups.com
Hello

DNOSECURITY=true is solving my problem! 

Thanks a lot!

Mauro lesto

unread,
Jan 18, 2015, 7:22:25 PM1/18/15
to robocode-...@googlegroups.com

You have to edit robocode's code, as far as I know it use the standard java sandbox, so it would be easy to grep the code and add the required policy.

This is by default because downloaded robot may be malicious. Maybe a special flat to deactivate this enforcing on robot may be implemented, it would be useful for many debugging purpose.


--

---
You received this message because you are subscribed to the Google Groups "robocode-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode-develo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages