Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

J2SE1.4.1, Hello World example error on two machines...

1 view
Skip to first unread message

Beom-Seok, Lee

unread,
Jan 7, 2003, 10:40:53 AM1/7/03
to
In executing Hello world example,whick is part of J2SE1.4.1 SDK example,
Executing on one machine, it was working good.
 
But executing on two machines,,, it was not working good....
I don't know why?
 
there are no networking problem, such as Port, HostAddress,, no problem..
then why?
 
Whay do you think about this...?

Bellow are the code and error message..

// HelloClient.java
public static void main(String args[]) {
try {
    // create and initialize the ORB   
    ORB orb = ORB.init(args,null);
 
   // get the root naming context 
   org.omg.CORBA.Object objRef =  orb.resolve_initial_references"NameService");

  // Use NamingContextExt instead of Naming 
  // part of the interoperable naming Service  
  NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);   // this ine

ERROR : org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201
completed: No
org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
at  com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:148)

at  com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:65)

at  com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:67)
at  com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:644)

at  com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:586)

at  com.sun.corba.se.internal.corba.ClientDelegate.is_a(ClientDelegate.java:838)
at  org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at  org.omg.CosNaming.NamingContextExtHelper.narrow(NamingContextExtHelper.java:73)
at  HelloClient.main(HelloClient.java:22)




jb

unread,
Jan 10, 2003, 9:03:05 PM1/10/03
to
Hi,
If your first machine name is HostA and the second one HostB,
First start your server on HostA whith yhe following command :
> orbd -ORBInitialPort 9500 -ORBInitialHost HostA
> java <yourServerClass> -ORBInitialPort 9500 -ORBInitialHost HostA
and for the client
> java <yourClientClass> -ORBInitialPort 9500 -ORBInitialHost HostA

Drop me an email if it<s still not working.

Bye.

이범석

unread,
Jan 12, 2003, 7:57:44 PM1/12/03
to
Thanks for your reply...
 
I think you are suspicious of port problem....
 
I tried on port 9500..... but it didn't work.
Same error message...    naming service 'narrow()' error...
 
While I'm inspecting this problem, I have come to have suspicions of my Java
Installation or Nework problem or other setting..

I tried a new RMI example, to examine my Java and
Network OK.
I get the RMI example in the Book, "Thinking in Java",
Bruce Eckel, 3rd example. chapter 15, 'PerfectTime'
example

- I started rmiregistry with port 2005
       rmiregistry 2005
- and started rmi server
       java PerfectTime

it also show me the following error
--------------------------------------------------

[aw2310@ticn-test2 c15]$ java PerfectTime
Exception in thread "main"
java.security.AccessControlException: access denied
(java.net.SocketPermission 150.150.50.166:2005
connect,resolve)
        at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
        at
java.security.AccessController.checkPermission(AccessController.java:401)
        at
java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
        at
java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
        at java.net.Socket.connect(Socket.java:419)
        at java.net.Socket.connect(Socket.java:375)
        at java.net.Socket.<init>(Socket.java:290)
        at java.net.Socket.<init>(Socket.java:118)
        at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
        at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:122)
        at
sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
        at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
        at
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at
sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
        at
sun.rmi.registry.RegistryImpl_Stub.bind(Unknown
Source)
        at java.rmi.Naming.bind(Naming.java:110)
        at PerfectTime.main(PerfectTime.java:30)
       
--------------------------------------------------

this error is also because of binding the name
service(rmiregistry).....

I execute this rmi code with another java virtual
machine.

Kaffe Virtual Machine, Transvirtual Technologies,
Engine : Just-in-ime v3, version:1.0.6, Java
Version:1.1

This rmi example worked good with Kaffe Virtual
Machine.

I think all of my problems come from communicating
with the naming system(orbd, rmiregistry).

I attach the rmi source code....

please review these and reply me soon.

thanks...

ps : I tried another example... 'socket communication
example', from Bruce Eckel Book chapter 15
    it only has simple server and client... it is
working good.
    I attach this example also...

 
 
"jb" <jbo...@chez.com> wrote in message news:3E1F7B59...@chez.com...

이범석

unread,
Jan 14, 2003, 5:39:15 AM1/14/03
to
I solve this problem by I edited /etc/hosts file...
 
the problem was connecting the name service with 127.0.0.1 address
 
so I added a new line
 
#real ip address        hostname
#127.0.0.1        localhost
150.150.50.166        ticn-test2
 
I think in the internal code of 'orbd', orbd use local loopback address instead of read address
 
 
 
 
0 new messages