Solved

Problem with applet to connect to the server.

Posted on 2003-12-03
12
294 Views
Last Modified: 2012-05-04
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
Comment
Question by:cicurel
12 Comments
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 9871616
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
 
LVL 2

Expert Comment

by:anthony_castillon
ID: 9871919
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
 
LVL 92

Expert Comment

by:objects
ID: 9871927
RMI will have the same problem making the connection.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 30

Expert Comment

by:Mayank S
ID: 9872371
>> 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
 
LVL 92

Expert Comment

by:objects
ID: 9872418
Applets are allowed to connect to the machine they were loaded from.
So there is no security restriction.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 9872465
But they are not even allowed to open files on the same machine too unless they are signed, isn't it?
0
 
LVL 92

Expert Comment

by:objects
ID: 9872483
I didn't see any mention of it opening files?
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 9872547
No no.... I was just curious to know.
0
 
LVL 92

Expert Comment

by:objects
ID: 9873370
no they cannot access local files by default.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 9873459
0
 

Author Comment

by:cicurel
ID: 9874113
Thank you very much, you have been a real help.

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

Thanks again.
0
 
LVL 92

Expert Comment

by:objects
ID: 9877078
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question