This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes access denied (SocketPermission 127.0.0.1:1099 connect,resolve) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "access denied (SocketPermission 127.0.0.1:1099 connect,resolve)" Watch "access denied (SocketPermission 127.0.0.1:1099 connect,resolve)" New topic
Author

access denied (SocketPermission 127.0.0.1:1099 connect,resolve)

ruilin yang
Ranch Hand

Joined: Feb 25, 2001
Posts: 334
Anybody has experience on the following error message:
access denied(java.net.SocketPermission 127.0.0.1:1099 connect, resolve)
Please help on how to correct the problem.
Thanks with respect.
Ruilin
Lisa Foster
Ranch Hand

Joined: Feb 28, 2001
Posts: 116
Ruilin you need to creat a policy file allowing all permissions
create a file in notepad call it permit.policy
here is the guts grant
{
permission java.net.SocketPermission "*:1024-65535",
"connect,accept,resolve";
permission java.net.SocketPermission "*:1-1023",
"connect,resolve";
};
at the command prompt when starting your server type
C:\>-Djava.security.policy=permit.policy yourserver file then it should work ok
Hope it helps
Lisa
Lisa Foster
Ranch Hand

Joined: Feb 28, 2001
Posts: 116
here is the correct code to put in your permit.policy
make sure you put the double quotes when saving as a policy file
save as "permit.policy"
goodluck
grant
{
permission java.net.SocketPermission "*:1024-65535",
"connect,accept,resolve";
permission java.net.SocketPermission "*:1-1023",
"connect,resolve";
};
ruilin yang
Ranch Hand

Joined: Feb 25, 2001
Posts: 334
Thanks Lisa, I have a policy file, but not exactly as yours. I will try yours. This is mine (client.policy):
grant
{permission java.net.SocketPermission
"*:1024-65535", "connect";
};
It worked for my other applications, in which I put everything in the same directory. But for the present application, I put client codes and server codes in different directories.
Thanks with respects.
Ruilin
denay
Greenhorn

Joined: Jul 31, 2001
Posts: 3
I have got the same problem, How did you solve it?
thanks thanks thanks...
------------------
denay
Greenhorn

Joined: Jul 31, 2001
Posts: 3
I don't understand the value :
"*:1024-65535"
"*:1-1023"
thanks

------------------
Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
All,
I have the same problem. I already have the policy file containing above permissions. I have this file in the same folder as server. I start the server with -d option. Do I need to give this option when I run client ??
Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
I meant -D option not -d.
Rasika Chitnis
Ranch Hand

Joined: Jun 19, 2001
Posts: 131
I copied the same policy file into client folder. now i get following exception
java.rmi.NotBoundException:
Daniel Patrickson
Greenhorn

Joined: Apr 04, 2003
Posts: 2
In order to give you yet another version of a policy file... Here is mine.

/Daniel Patrickson


_ _ _________________________ _ _ <br />Daniel Patrickson
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118
Hi ruilin,
What operating system are you using? Is it Linux by chance?
M


Java Regular Expressions
James Hook
Greenhorn

Joined: Jan 20, 2003
Posts: 18
You get a
java.rmi.NotBoundException
if you try to lookup an object name in the registry before it has been bound. I can get this exception by starting my client before starting my server.
Ramesh Babu Duggudurti
Greenhorn

Joined: Nov 11, 2003
Posts: 2
Dear All,
I have webserver on which my JSPs run and a separate server(on different machine) written in Java socket programming. when i am trying to run the client in my browser(like http://webserver/client.jsp client files on the webserver) i am getting access denied (java.net.SocketPermission ....
If i have the socket server on the same machine as the webserver or if i edit the java.policy file to include socket permissions on the machine from which iam browsing iam not getting this error.
Can anyone explain me how to overcome this problem without modifying the policy file on the clients system.
Ramesh Babu
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
No, this really isn't a good forum for that. Two years ago people here were talking about policy files as part of developer certification, but that topic hasn't been part of developer certification for a long time. People here are specifically talking about Sun's developer certification exam. You'd be much better off posting this qeustion as a new thread in our Sockets forum. Good luck.
[ November 11, 2003: Message edited by: Jim Yingst ]

"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: access denied (SocketPermission 127.0.0.1:1099 connect,resolve)
 
Similar Threads
RMI Error messages.
Help !! rmiregistry
Simple RMI Question ...
java. security. AccessControlException
RemoteException