[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

java.security.AccessControlException: access denied

Posted on 2006-11-10
4
Medium Priority
?
645 Views
Last Modified: 2008-01-09
Hi Experts,

I am trying to run Chat sample program and have this “java.security.AccessControlException: access denied “ error.

After searching for the cause, it looks like I need to modify one of the java security files, but I don’t have much clue. Can somebody help me on this?

Thanks,

+++++++++
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:1099 connect,resolve)
        at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:269)
        at java.security.AccessController.checkPermission(AccessController.java:
401)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
        at java.lang.SecurityManager.checkConnect(SecurityManager.java:1026)
        at java.net.Socket.connect(Socket.java:446)
        at java.net.Socket.connect(Socket.java:402)
        at java.net.Socket.<init>(Socket.java:309)
        at java.net.Socket.<init>(Socket.java:124)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
SocketFactory.java:22)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
SocketFactory.java:128)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
        at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
        at java.rmi.Naming.rebind(Naming.java:160)
        at RemoteModel.setOnline(RemoteModel.java:155)
        at RemoteModel.setModelName(RemoteModel.java:136)
        at ChatRoom.setSubject(ChatRoom.java:119)
        at ChatRoom.<init>(ChatRoom.java:54)
        at ChatRoom.main(ChatRoom.java:194)
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
Peter Kwan earned 1400 total points
ID: 17919791
Please see if the following suits your need:

http://archives.java.sun.com/cgi-bin/wa?A2=ind0006&L=rmi-users&P=29236
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17919917
you can't connect/resolve from the applet. if you want to do so, you need to sign the applet and distribute
0
 

Author Comment

by:dkim18
ID: 17922100
pkwan,

I added these line in java.policy file:

permission java.net.SocketPermission "localhost:1099","accept,connect,resolve,listen";
permission java.net.SocketPermission "*:1099","connect,accept,resolve";

but still having error:

C:\P3_1>java ChatRoom Nutrition Vicki
java.security.policy: error parsing file:/C:/Java/j2sdk1.4.2_09/jre/lib/security
/java.policy:
        line 1: expected [;], found [permission]
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:1099 connect,resolve)
        at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:269)
        at java.security.AccessController.checkPermission(AccessController.java:
401)
...
...
...
0
 
LVL 16

Expert Comment

by:Peter Kwan
ID: 17923968
You should put the lines into grant block:

example:

grant {
permission java.net.SocketPermission "localhost:1099","accept,connect,resolve,listen";
permission java.net.SocketPermission "*:1099","connect,accept,resolve";

}
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question