Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

access denied (SocketPermission 127.0.0.1:1099 connect,resolve)  RSS feed

 
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have got the same problem, How did you solve it?
thanks thanks thanks...
------------------
 
denay
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand the value :
"*:1024-65535"
"*:1-1023"
thanks

------------------
 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I meant -D option not -d.
 
Rasika Chitnis
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I copied the same policy file into client folder. now i get following exception
java.rmi.NotBoundException:
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order to give you yet another version of a policy file... Here is mine.

/Daniel Patrickson
 
town drunk
( and author)
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ruilin,
What operating system are you using? Is it Linux by chance?
M
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!