If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

That's because Java 2 has a more complicated security system, and it applies
to RMI. I don't pretend to know all about it, but for a quick solution try
this:

First create a file called "no.policy", containing this code:

grant {
permission java.security.AllPermission;
};

Then change the code that runs your RMI server to look something like this:

java -Djava.security.policy=no.policy WhateverClass

You may need to do the same for the client.

Note that the "no.policy" file I posted there says "anything is allowed".
This is far too permissive for a production application; search out
information on the Java 2 security model, and you will find commands that
allow access to specific sockets only, without opening the doors to anything
else.

PC2

"Hamwira Sakti" <hamwira@pernec.com.my> wrote in message
news:3b11c870$1@news.devx.com...
>
> Hi,
>
> I'd developed Client and Server for RMI, but i got the error as mention in
> the subject. I'm using Java 2 SDK version 1.3.
>
> Before this, I'm using JDK 1.1.7 and it's working fine until I'd updated
> my JDK to 1.3
>
> Appreciate someone could help me with this...
>
> Thanks
>

I am interested to know more about how to specify specific socket..
Can I find it in SocketPermission class documentation??

In that class, I notice a command like this:

p1 = new SocketPermission("localhost", "accept, connect, listen");

Where do I put this command???

Thank you again for the information..

HAMWIRA

"Paul Clapham" <pclapham@core-mark.com> wrote:
>That's because Java 2 has a more complicated security system, and it applies
>to RMI. I don't pretend to know all about it, but for a quick solution
try
>this:
>
>First create a file called "no.policy", containing this code:
>
>grant {
>permission java.security.AllPermission;
>};
>
>Then change the code that runs your RMI server to look something like this:
>
>java -Djava.security.policy=no.policy WhateverClass
>
>You may need to do the same for the client.
>
>Note that the "no.policy" file I posted there says "anything is allowed".
>This is far too permissive for a production application; search out
>information on the Java 2 security model, and you will find commands that
>allow access to specific sockets only, without opening the doors to anything
>else.
>
>PC2
>
>"Hamwira Sakti" <hamwira@pernec.com.my> wrote in message
>news:3b11c870$1@news.devx.com...
>>
>> Hi,
>>
>> I'd developed Client and Server for RMI, but i got the error as mention
in
>> the subject. I'm using Java 2 SDK version 1.3.
>>
>> Before this, I'm using JDK 1.1.7 and it's working fine until I'd updated
>> my JDK to 1.3
>>
>> Appreciate someone could help me with this...
>>
>> Thanks
>>
>
>

"Hamwira, Yaacob" <hamwira@pernec.com.my> wrote in message
news:3b12f93d$1@news.devx.com...
>
> Thank you Paul..
>
> I have tried that method it it was working fine..
>
> I am interested to know more about how to specify specific socket..
> Can I find it in SocketPermission class documentation??
>
> In that class, I notice a command like this:
>
> p1 = new SocketPermission("localhost", "accept, connect, listen");
>
>
> Where do I put this command???

because I didn't want to put "-Djava.security.policy=no.policy" in my command
line to run the java application.

So, what I did, I put the code in "no.policy" to the system java.policy files...
and it works.. I don't have to type "-Djava.security.policy=no.policy" to
run my program.

I hope you got what I was trying to share..

Thank you so much.

HAMWIRA

"Paul Clapham" <pclapham@core-mark.com> wrote:
>No idea, let me just point you at the Sun security tutorial at
>http://java.sun.com/docs/books/tutor....2/index.html.
>
>PC2
>
>"Hamwira, Yaacob" <hamwira@pernec.com.my> wrote in message
>news:3b12f93d$1@news.devx.com...
>>
>> Thank you Paul..
>>
>> I have tried that method it it was working fine..
>>
>> I am interested to know more about how to specify specific socket..
>> Can I find it in SocketPermission class documentation??
>>
>> In that class, I notice a command like this:
>>
>> p1 = new SocketPermission("localhost", "accept, connect, listen");
>>
>>
>> Where do I put this command???
>
>
>

Not very smart to set AllPermission globaly if that is what youīve just described.
Itīs ok if you donīt got anything you care for on the machine but certainly
not a tip to pass on.

/ Johannes
"Hamwira Yaacob" <hamwira@pernec.com.my> wrote:
>
>Paul..
>
>Thank you so much for being supportive..
>
>The reason I asked about command
>
> p1 = new SocketPermission("localhost", "accept, connect, listen");
>
>because I didn't want to put "-Djava.security.policy=no.policy" in my command
>line to run the java application.
>
>So, what I did, I put the code in "no.policy" to the system java.policy
files...
>and it works.. I don't have to type "-Djava.security.policy=no.policy" to
>run my program.
>
>I hope you got what I was trying to share..
>
>Thank you so much.
>
>HAMWIRA
>
>
>
>
>"Paul Clapham" <pclapham@core-mark.com> wrote:
>>No idea, let me just point you at the Sun security tutorial at
>>http://java.sun.com/docs/books/tutor....2/index.html.
>>
>>PC2
>>
>>"Hamwira, Yaacob" <hamwira@pernec.com.my> wrote in message
>>news:3b12f93d$1@news.devx.com...
>>>
>>> Thank you Paul..
>>>
>>> I have tried that method it it was working fine..
>>>
>>> I am interested to know more about how to specify specific socket..
>>> Can I find it in SocketPermission class documentation??
>>>
>>> In that class, I notice a command like this:
>>>
>>> p1 = new SocketPermission("localhost", "accept, connect, listen");
>>>
>>>
>>> Where do I put this command???
>>
>>
>>
>

Ok I am getting this same error. I have an application on one server at port
9999, the applets on a remote server. I am trying to establish a socket
connection to my application at port 9999 and constantly get an "Access denied(java.net.SocketPermission...)"
error. I went so far as to add a new SocketPermission onto the existing
java.policy files specifying the IP and port, to no avail.

Help!

Thanx
Phil

"Johannes" <me@me.now> wrote:
>
>Not very smart to set AllPermission globaly if that is what youīve just
described.
>Itīs ok if you donīt got anything you care for on the machine but certainly
>not a tip to pass on.
>
>/ Johannes
>"Hamwira Yaacob" <hamwira@pernec.com.my> wrote:
>>
>>Paul..
>>
>>Thank you so much for being supportive..
>>
>>The reason I asked about command
>>
>> p1 = new SocketPermission("localhost", "accept, connect, listen");
>>
>>because I didn't want to put "-Djava.security.policy=no.policy" in my command
>>line to run the java application.
>>
>>So, what I did, I put the code in "no.policy" to the system java.policy
>files...
>>and it works.. I don't have to type "-Djava.security.policy=no.policy"
to
>>run my program.
>>
>>I hope you got what I was trying to share..
>>
>>Thank you so much.
>>
>>HAMWIRA
>>
>>
>>
>>
>>"Paul Clapham" <pclapham@core-mark.com> wrote:
>>>No idea, let me just point you at the Sun security tutorial at
>>>http://java.sun.com/docs/books/tutor....2/index.html.
>>>
>>>PC2
>>>
>>>"Hamwira, Yaacob" <hamwira@pernec.com.my> wrote in message
>>>news:3b12f93d$1@news.devx.com...
>>>>
>>>> Thank you Paul..
>>>>
>>>> I have tried that method it it was working fine..
>>>>
>>>> I am interested to know more about how to specify specific socket..
>>>> Can I find it in SocketPermission class documentation??
>>>>
>>>> In that class, I notice a command like this:
>>>>
>>>> p1 = new SocketPermission("localhost", "accept, connect, listen");
>>>>
>>>>
>>>> Where do I put this command???
>>>
>>>
>>>
>>
>