Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 17th, 2006, 07:30 AM
Registered User
 
Join Date: Mar 2006
Location: Bangalore, Karnataka, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default First RMI Program

I have written a simple program for server and client .When
i run the program it is showing the error

The code for the server is


public class CustWorkImpl implements CustWork {
    public CustWorkImpl() throws RemoteException {
        UnicastRemoteObject.exportObject(this);
    }
    public String getSvrMsg() throws RemoteException {
        String threadName = Thread.currentThread().getName();
        String currTime = Calendar.getInstance().getTime().toString();
        System.out.println(threadName + "A Client Connected At: " + currTime);
        return (threadName + "A Client Connected At: " + currTime);
    }
    public static void main(String args[]) {
        try {
            if (System.getSecurityManager() == null) {
                System.setSecurityManager(new RMISecurityManager());
            }
            CustWorkImpl impl = new CustWorkImpl();
            Naming.rebind("workObj", impl);
            System.out.println("Server is Waiting");
        } catch (Exception ex) {
            ex.printStackTrace();
            System.out.println(ex);
        }
    }
}


java.security.AccessCont********************ception: access denied (java.net.SocketPermission 127.0.0.1:9000 connect,resolve)

what should be done to resolve this.

Reply With Quote
  #2 (permalink)  
Old April 4th, 2006, 03:41 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should use the policy file .This file extenstion is policy And in this file
you set permission and Access level.For more information visit this link:

http://www.ccs.neu.edu/home/kenb/com3337/rmi_tut.html



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
call remote native program, rmi? shi Java Espanol 1 March 28th, 2005 08:42 PM
RMI newbie NickTheBubble J2EE 0 December 17th, 2004 06:59 AM
Why rmi don't run? Edward King J2EE 2 December 7th, 2004 04:41 AM
java.rmi.UnmarshalException malar J2EE 1 August 10th, 2004 07:27 AM
Problem running RMI melida J2EE 0 September 23rd, 2003 09:33 AM



All times are GMT -4. The time now is 07:43 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.