tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yan Zhu" <...@groupserve.com>
Subject Re: rmi problem
Date Thu, 30 Mar 2000 22:24:58 GMT
I'm using only one rmi registry, however, a few remote objects need to be
registered with this one registry.

In the code, I try to find the existing registry first, if it doesn't exist,
I will create a registry.

But it seems to me, only one object can be registered with the registry.

yan


----- Original Message -----
From: kenneth.baltz <kenneth.baltz@inforonics.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Thursday, March 30, 2000 3:18 PM
Subject: RE: rmi problem


> I'm not sure what you mean by "several remote objects to register".  Here
is
> the code we use to start up our RMI server.   This is all part of
>
>
> public class MyRMIServer extends UnicastRemoteObject {
> public MyRMIServer() {
> super();
> }
>
>     public boolean start( int inPort, String inName ) {
>           _port = inPort;
>           _name = inName;
>           // Create the RMI registry
>           _reg = LocateRegistry.createRegistry( _port );
>           System.out.println( "Created registry on port: " + _port );
>           logCommand( "Created registry on port: " + _port );
>
>           // Bind this to the registry
>           _reg.rebind( _name, this );
>           System.out.println( _name + " Server Started Successfully" );
> }
> }
>
> We only create one registry (can't think why you'd want more) and we only
> bind one server to it.
>
> K.C.
>
>
> > -----Original Message-----
> > From: Yan Zhu [mailto:yan@groupserve.com]
> > Sent: Thursday, March 30, 2000 2:20 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Re: rmi problem
> >
> >
> > Thanks K.C.
> >
> > After modifying the policy file, it is working.  But I have
> > another problem
> > with rmi.  I have several remote object to register.  The
> > first one was
> > registered ok, but the second one was not registered.  (it
> > says address in
> > use).  In the code, it tries to find the registery, if there
> > is not any
> > registry, it will create one.
> >
> > Any clues?
> >
> > yan
> >
> >
> >
> >
> >
> > ----- Original Message -----
> > From: kenneth.baltz <kenneth.baltz@inforonics.com>
> > To: <tomcat-user@jakarta.apache.org>
> > Sent: Thursday, March 30, 2000 8:31 AM
> > Subject: RE: rmi problem
> >
> >
> > > I believe you need something to this effect in your
> > java.policy file.
> > >
> > >     permission java.net.SocketPermission
> > > "*.yourhost.com:2001","connect,accept";
> > >
> > > which allows the RMI server to accept connections from the
> > yourhost.com
> > > domain on port 2001.
> > > This is what we use for our own RMI server.
> > >
> > > K.C.
> > > > -----Original Message-----
> > > > From: Yan Zhu [mailto:yan@groupserve.com]
> > > > Sent: Wednesday, March 29, 2000 7:10 PM
> > > > To: tomcat-user@jakarta.apache.org
> > > > Subject: rmi problem
> > > >
> > > >
> > > > Sorry to duplicate this message, this time it has the
> > correct subject.
> > > >
> > > > hi everyone,
> > > >
> > > > With tomcat, when I try to register a remote object with rmi
> > > > registry from a
> > > > servlet, I got the following error:
> > > >
> > > > java.security.AccessControlException: access denied
> > > > (java.net.SocketPermission 1
> > > > 27.0.0.1:1100 connect,resolve)
> > > >         at
> > > >
> > java.security.AccessControlContext.checkPermission(AccessControlConte
> > > > xt.java:195)
> > > >         at
> > > >
> > java.security.AccessController.checkPermission(AccessController.java:
> > > > 403)
> > > >         at
> > > >
> > java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
> > > >         at
> > > > java.lang.SecurityManager.checkConnect(SecurityManager.java:1021)
> > > >         at java.net.Socket.<init>(Socket.java:258)
> > > >         at java.net.Socket.<init>(Socket.java:98)
> > > >         at
> > > >
> > sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
> > > > SocketFactory.java:29)
> > > >         at
> > > >
> > sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
> > > > SocketFactory.java:124)
> > > >
> > > > Is there any security policy I need to modify to accommodate
> > > > rmi?  It will
> > > > be highly appreciated if anybody can give me a hint.
> > > >
> > > > best,
> > > > yan
> > > >
> > > >
> > > >
> > > > --------------------------------------------------------------
> > > > ------------
> > > > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > > > For additional commmands, email:
> > tomcat-user-help@jakarta.apache.org
> > > >
> > > >
> > > >
> > > >
> > > > --------------------------------------------------------------
> > > > ------------
> > > > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > > > For additional commmands, email:
> > tomcat-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > --------------------------------------------------------------
> > ------------
> > > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commmands, email: tomcat-user-help@jakarta.apache.org
> > >
> >
> >
> > --------------------------------------------------------------
> > ------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
> >
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>


Mime
View raw message