Date: Mon, 02 Jul 2001 18:38:05 -0700 From: Cedric Berger <cedric@wireless-networks.com> To: j mckitrick <jcm@FreeBSD-uk.eu.org> Cc: freebsd-java@freebsd.org Subject: Re: argh!! Can't get bind/rmi to work.... Message-ID: <3B4121FD.5080002@wireless-networks.com> References: <20010703015156.A27017@dogma.freebsd-uk.eu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Looks like some sort of DNS issue, right?
is BindTest a valid hostname on your system?
I doubt it.
Try replacing:
String name = "//BindTest";
by
tring name = "//localhost/BindTest";
Cedric
j mckitrick wrote:
>Sorry in advance this isn't BSD specific, but i am frustrated to no end. I
>had a simple RMI program that binds to a port. It works under 1.1, but not
>1.2. Could someone tell me why not? It trips up on the Naming.rebind()
>call. I fussed with my securiy policy (finally have it working) and the url
>format (complained it was malformed). I am trying to connect to localhost.
>I have rmiregistry running.
>
>I whittle it down to only needing 2 small files. Please help if you can,
>i'm beating my head against a wall.
>
>Here is the error message:
>
>local:~/src/engine> java BindTest
>BindTest exception: Unknown host: BindTest; nested exception is:
> java.net.UnknownHostException: BindTest
>java.rmi.UnknownHostException: Unknown host: BindTest; nested exception is:
> java.net.UnknownHostException: BindTest
>
>java.net.UnknownHostException: BindTest
> at java.net.InetAddress.getAllByName0(InetAddress.java:577)
> at java.net.InetAddress.getAllByName0(InetAddress.java:546)
> at java.net.InetAddress.getByName(InetAddress.java:455)
> at java.net.Socket.<init>(Socket.java:98)
> at
>sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:29)
> at
>sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:124)
> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:497)
> at
>sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:194)
> at
>sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:178)
> at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
> at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
> at java.rmi.Naming.rebind(Naming.java:165)
> at BindTest.main(BindTest.java:30)
>
>
>
>Jonathon
>--
>Microsoft complaining about the source license used by
>Linux is like the event horizon calling the kettle black.
>
>
>------------------------------------------------------------------------
>
>/* jonathon mckitrick */
>
>import java.rmi.*;
>import java.rmi.server.*;
>import compute.*;
>
>public class BindTest extends UnicastRemoteObject
> implements Compute
>{
> public BindTest() throws RemoteException
> {
> super();
> }
>
> public Object executeTask()
> {
> return null;
> }
>
> public static void main(String[] args)
> {
> System.getSecurityManager();
>// if (System.getSecurityManager() == null)
>// System.setSecurityManager(new RMISecurityManager());
>
> String name = "//BindTest";
> try
> {
> Compute engine = new BindTest();
> Naming.rebind(name, engine);
> System.out.println("BindTest bound");
> } catch (Exception e)
> {
> System.err.println("BindTest exception: " + e.getMessage());
> e.printStackTrace();
> }
> }
>}
>
>
>------------------------------------------------------------------------
>
>/* jonathon mckitrick */
>
>package compute;
>
>import java.rmi.Remote;
>import java.rmi.RemoteException;
>
>public interface Compute extends Remote
>{
> Object executeTask() throws RemoteException;
>}
>
> BindTest.java
>
> Content-Type:
>
> text/plain
>
>
> ------------------------------------------------------------------------
> Compute.java
>
> Content-Type:
>
> text/plain
>
>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B4121FD.5080002>
