473,387 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

RMI first step

Hello,

For testing purpose, I'm trying to use RMI...
Here is the exception when I run Main.java :
Exception in thread "main" java.security.AccessControlException: access
denied (java.net.SocketPermission 192.168.0.1:1099 connect,resolve)
at
java.security.AccessControlContext.checkPermission (AccessControlContext.java
:264)
at
java.security.AccessController.checkPermission(Acc essController.java:427)
at java.lang.SecurityManager.checkPermission(Security Manager.java:532)
at java.lang.SecurityManager.checkConnect(SecurityMan ager.java:1034)
at java.net.Socket.connect(Socket.java:501)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.<init>(Socket.java:365)
at java.net.Socket.<init>(Socket.java:178)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.cre ateSocket(RMIDirectSocketF
actory.java:22)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.cre ateSocket(RMIMasterSocketF
actory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEnd point.java:569)
at
sun.rmi.transport.tcp.TCPChannel.createConnection( TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCP Channel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java: 306)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at testRMI.Main.main(Main.java:28)

(jdk1.5.0_01 - Win2000Pro - no firewall)
What am I doing wrong ?
Thanks for your help,
Martin.

The code :
================================================== =================
Main.java :
package testRMI;

import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.lang.SecurityException;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class Main extends UnicastRemoteObject implements Meeting
{
private String ivDate = new String("25/3/2005");
private static final long serialVersionUID = 1;

public Main() throws RemoteException {

}

public String getDate() throws RemoteException {
return ivDate;
}

public static void main(String[] args) throws
AlreadyBoundException,RemoteException,
MalformedURLException,SecurityException {
System.setSecurityManager(new RMISecurityManager());
Main ms = new Main();
Naming.rebind("rmi://192.168.0.1/Meeting",ms);
}
}
================================================== =================
Meeting.java
package testRMI;

import java.rmi.Remote;
import java.rmi.RemoteException;

public interface Meeting extends Remote
{
public String getDate() throws RemoteException;
}
================================================== =================
ClientRMI.java
package testRMI;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RMISecurityManager;
import java.rmi.Remote;
import java.rmi.RemoteException;

public class ClientRMI
{
public static void main(String[] args)
throws RemoteException, MalformedURLException,NotBoundException {
System.setSecurityManager(new RMISecurityManager());
Remote r = Naming.lookup("rmi://192.168.0.1/Meeting");
String s = null;
if(r instanceof Meeting)
{
Meeting ms = (Meeting)r;
s = ms.getDate();
}
System.out.println(s);
}
}
================================================== =================

Jul 18 '05 #1
2 5561
Hey,

in the lib/security directory of your JDK installation are policy
files, you should take a look at these....

David
--------------------------
http://blog.linsin.de

Jul 18 '05 #2
Yep ... I forgot that part.
Thanks David !
Problem solved

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Claudio Grondi | last post by:
I need to unpack on a Windows 2000 machine some Wikipedia media .tar archives which are compressed with TAR 1.14 (support for long file names and maybe some other features) . It seems, that...
16
by: TB | last post by:
Hi all: If you think that the following comments are absolute amateurish, then please bear with me, or simply skip this thread. A couple of months back I made the decision to initiate a...
5
by: cj | last post by:
Thanks to everyone that has helped me. Now I'm trying to write my first program. I have an example of one that I need to write about. Any help getting me started is appreciated. I'm having trouble...
1
by: sqlster | last post by:
When I get latest on asp.net project from VSS, I do the following: 1. Open up the project file in VS.net 2. Access bin folder via file explorer. 3. Select all the files and check off the read only...
2
by: Neil | last post by:
I have three stored procedures that need to run nightly in SQL 7. The three procedures are not related; but to keep the procedures from running at the same time, I placed them as three steps of a...
1
by: thickface | last post by:
Hi all, I have a question and any suggestions for solutions would be greatly appreciated. In my program, I first defined a variable called 'incidence' which has to be updated at every time step, ...
9
by: FS.Jason | last post by:
I am a beginner of programming and started to learn Python a week ago. last 3 days, i write this little tool for Renju.if you have any advice on my code,please tell me ps:sorry for my poor english...
4
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for...
7
by: Chris Lasher | last post by:
Hi all, I have a simple script: --- #!/usr/bin/env python a = 1 b = 2
0
by: Family Tree Mike | last post by:
This link looks like it covers the steps. Its been a while since I have used 2003 though. Hope this helps. http://www.informit.com/library/content.aspx?b=Net_2003_21days&seqNum=145
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.