-
RMI : Access denied (java.net.SocketPermission 127.0.0.1:1099 connect, resolve)
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
-
Re: Access denied (java.net.SocketPermission 127.0.0.1:1099 connect, resolve)
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
>
-
Re: Access denied (java.net.SocketPermission 127.0.0.1:1099 connect, resolve)
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???
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
>>
>
>
-
Re: Access denied (java.net.SocketPermission 127.0.0.1:1099 connect, resolve)
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???
-
Re: Access denied (java.net.SocketPermission 127.0.0.1:1099 connect, resolve)
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???
>
>
>
-
Re: Access denied (java.net.SocketPermission 127.0.0.1:1099 connect, resolve)
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???
>>
>>
>>
>
-
Re: Access denied (java.net.SocketPermission 127.0.0.1:1099 connect, resolve)
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???
>>>
>>>
>>>
>>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|