2012-06-06 78 views
1

我想在兩臺機器上運行一個簡單的客戶端 - 服務器程序運行的Hello World,CORBA,在兩臺機器上

我讀這page但我得到這個錯誤:

Jun 04, 2012 6:43:10 PM com.sun.corba.se.impl.transport.SocketOrChannelConnectio 
nImpl <init> 
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR 
_TEXT; hostname: xx.xx.xx.xx; port: 1050" 
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No 
     at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(Unknown Source) 
     at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(Unknown Source) 
     at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(Unknown Source) 
     at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(Unknown Source) 
     at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection(Unknown Source) 
     at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(Unknown Source) 
     at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(Unknown Source) 
     at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(Unknown Source) 
     at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve(Unknown Source) 
     at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown Source) 
     at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown Source) 
     at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown Source) 
     at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(Unknown Source) 
     at HelloClient.main(HelloClient.java:17) 
Caused by: java.net.ConnectException: Connection refused: connect 
     at sun.nio.ch.Net.connect0(Native Method) 
     at sun.nio.ch.Net.connect(Unknown Source) 
     at sun.nio.ch.Net.connect(Unknown Source) 
     at sun.nio.ch.SocketChannelImpl.connect(Unknown Source) 
     at java.nio.channels.SocketChannel.open(Unknown Source) 
     at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket(Unknown Source) 
     ... 12 more 

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.impl.logging.ORBUtilSystemException.connectFailure(Unknown Source) 
     at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(Unknown Source) 
     at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(Unknown Source) 
     at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(Unknown Source) 
     at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection(Unknown Source) 
     at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(Unknown Source) 
     at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(Unknown Source) 
     at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(Unknown Source) 
     at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve(Unknown Source) 
     at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown Source) 
     at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown Source) 
     at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(Unknown Source) 
     at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(Unknown Source) 
     at HelloClient.main(HelloClient.java:17) 
Caused by: java.net.ConnectException: Connection refused: connect 
     at sun.nio.ch.Net.connect0(Native Method) 
     at sun.nio.ch.Net.connect(Unknown Source) 
     at sun.nio.ch.Net.connect(Unknown Source) 
     at sun.nio.ch.SocketChannelImpl.connect(Unknown Source) 
     at java.nio.channels.SocketChannel.open(Unknown Source) 
     at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket(Unknown Source) 
     ... 12 more 

你可以請讓我知道如何在兩臺使用Corba和java的互聯網上運行一個簡單的程序,例如「Hello Wrold」?

問候。

+0

有你檢查的防火牆?當你運行'java HelloServer -ORBInitialPort 1050'檢查'netstat -na'(檢查windows語法)如果服務器在1050上監聽。然後運行客戶端。 –

+0

我檢查過它。 sever正在監聽端口1050. – Blueferi

回答

0

我如何在兩臺機器上使用Corba和java在互聯網上運行一個簡單的程序,例如「Hello Wrold」?

我認爲在互聯網上是關鍵。你需要確保:

  1. 服務器對IP地址的客戶端訪問指定(即,或者IP地址是公共的,或者有設立任何相關的防火牆適當masquarading規則) ;
  2. 有合適的防火牆和/或端口轉發規則,允許客戶端訪問服務器上的端口1050

我會建議首先讓客戶端和服務器在同一子網上運行時工作,然後才轉移到分佈式安裝。

+0

您的意思是我在同一臺機器上運行服務器和客戶端嗎?我在一臺機器上運行了該程序,它工作正常。 – Blueferi

+0

請幫忙... – Blueferi

0
  1. 運行ORB start orbd -ORBInitialPort 1050
  2. 運行你的類的客戶端和服務器:-ORBInitialPort 1050 -ORBInitialHost localhost

或替代: 1.運行服務器: tnameserv -ORBInitialPort 1050

  • 運行客戶端: java YourServer -ORBInitialPort 1050 java YourClient -ORBInitialHost 127.0.0.1 -ORBInit ialPort 1050
  • a similar problem

    相關問題