• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

Problem with applet to connect to the server.

Hi.

I have created an application that is running on my computer, and i wanted to create an applet to connect to it and i will be able to view the program information from any computer on the net.

but i have got a problem i keep receiving:
java.security.AccessControlException access denied java.net.SocketPermission

and it is not connecting to the program.
i know that java can connect only to the server on the same computer.
and i dont want to change the java.policy in the J2RE for every computer trying to view the info.

And it is a program i created so i would not like to perchuse a certificate for it.

Any idea how to solve this problem?
i hope i made myself clear with my question.
0
cicurel
Asked:
cicurel
1 Solution
 
objectsCommented:
you can sign your applet with a test certificate.
http://personal.vsnl.com/sureshms/javasign1.html

Or run your server on the same box as the applet is being loaded from.

Or use an application instead of an applet.
0
 
anthony_castillonCommented:
Why not use RMI to invoke your application residing in the separate computer?  The J2EE tutorial in java.sun.com should be able to help you.
0
 
objectsCommented:
RMI will have the same problem making the connection.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Mayank SAssociate Director - Product EngineeringCommented:
>> Or run your server on the same box as the applet is being loaded from.

Mick, can you please comment a little more on that. Also, how does that help in removing the security restrictions?
0
 
objectsCommented:
Applets are allowed to connect to the machine they were loaded from.
So there is no security restriction.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
But they are not even allowed to open files on the same machine too unless they are signed, isn't it?
0
 
objectsCommented:
I didn't see any mention of it opening files?
0
 
Mayank SAssociate Director - Product EngineeringCommented:
No no.... I was just curious to know.
0
 
objectsCommented:
no they cannot access local files by default.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
0
 
cicurelAuthor Commented:
Thank you very much, you have been a real help.

I have created a test certificate and it works just fine.

Thanks again.
0
 
objectsCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now