Linux CORBA 通信问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13017782/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 14:40:36  来源:igfitidea点击:

Issues with CORBA communication

javalinuxsolariscorba

提问by roymustang86

This maybe too localized, but I am hoping someone can help me articulate my questions properly.

这可能太本地化了,但我希望有人能帮助我正确地表达我的问题。

So, we have a front end web server that communicates with a back end app server using CORBA. I have been asked to port the back end application to a LINUX box, which I did. But, in order to test it, I am trying to point the front end web server to the LINUX back end.

因此,我们有一个前端 Web 服务器,它使用 CORBA 与后端应用程序服务器进行通信。我被要求将后端应用程序移植到 LINUX 机器上,我做到了。但是,为了测试它,我试图将前端 Web 服务器指向 LINUX 后端。

We are using omniORB-4.1.4, and here is how the instance of the back end system is obtained:

我们使用的是 omniORB-4.1.4,这里是获取后端系统实例的方法:

        String args[] = new String[0];
        System.out.println(getDateTime()+"Instance: Connecting to: "+initialHost+"  "+initialPort+"  "+enviornment+"  "+version);
        java.util.Properties props = new java.util.Properties();
        props.put("org.omg.CORBA.ORBInitialPort", initialPort);
        props.put("org.omg.CORBA.ORBInitialHost", initialHost);
        props.put("com.sun.CORBA.giop.ORBGIOPVersion", "1.0");
        orb=org.omg.CORBA.ORB.init(args,props);

When both and front end and back end are running on a SUN/Solaris box, it seems to get an instance fine. But, when the back end is running on a LINUX box, it gives a Connection Refused exception, and the hostname as 127.0.0.1

当前端和后端都在 SUN/Solaris 机器上运行时,它似乎得到了一个很好的实例。但是,当后端在 LINUX 机器上运行时,它会给出连接被拒绝的异常,并且主机名为 127.0.0.1

  2012/10/22 13:53:22.033   EvaluateInstance: Connecting to: cmrheldv  23026  DEV87  0871
   Oct 22, 2012 1:53:22 PM com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl <init>
  WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: cmrheldv; port: 23026"
 org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
    at      com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2200)
    at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2221)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:205)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:218)
    at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:101)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:171)
    at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:118)
    at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:74)
    at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve(BootstrapResolverImpl.java:107)
    at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
    at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
    at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
    at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(ORBImpl.java:1151)
    at EvaluateInstance.InitializeModules(EvaluateInstance.java:152)
    at EvaluateInstance.initializeVariables(EvaluateInstance.java:326)
    at EvaluateCF.initializeInstances(EvaluateCF.java:1792)
    at EvaluateCF.processRequest(EvaluateCF.java:112)
    at coldfusion.tagext.CfxTag.doStartTag(CfxTag.java:102)
    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)
    at cfconfglobalconstants2ecfm330318830._factor9(/opt/jrun4/servers/or_dev87/cfusion-ear/cfusion-war/origenate/confglobalconstants.cfm:372)
    at cfconfglobalconstants2ecfm330318830._factor10(/opt/jrun4/servers/or_dev87/cfusion-ear/cfusion-war/origenate/confglobalconstants.cfm:13)
    at cfconfglobalconstants2ecfm330318830._factor11(/opt/jrun4/servers/or_dev87/cfusion-ear/cfusion-war/origenate/confglobalconstants.cfm:6)
    at cfconfglobalconstants2ecfm330318830.runPage(/opt/jrun4/servers/or_dev87/cfusion-ear/cfusion-war/origenate/confglobalconstants.cfm:1)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)
    at cfapp_globals2ecfm1890385339.runPage(/opt/jrun4/servers/or_dev87/cfusion-ear/cfusion-war/origenate/app_globals.cfm:61)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)
    at cfapp_locals2ecfm610494134.runPage(/opt/jrun4/servers/or_dev87/cfusion-ear/cfusion-war/origenate/securitycontrol/app_locals.cfm:49)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)
    at cfdefault2ecfm129406838._factor9(/opt/jrun4/servers/or_dev87/cfusion-ear/cfusion-war/origenate/securitycontrol/default.cfm:107)
    at cfdefault2ecfm129406838.runPage(/opt/jrun4/servers/or_dev87/cfusion-ear/cfusion-war/origenate/securitycontrol/default.cfm:1)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
    at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381)
    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
    at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
    at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
    at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
    at coldfusion.CfmServlet.service(CfmServlet.java:200)
    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
    at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
 Caused by: java.net.ConnectException: Connection refused
    at sun.nio.ch.Net.connect(Native Method)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:500)
    at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
    at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket(DefaultSocketFactoryImpl.java:60)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:188)
    ... 64 more

Is it something to do with the properties? Because the two boxes can hear each other perfectly well on the defined ports.

跟属性有关系吗?因为两个盒子在定义的端口上可以很好地听到对方的声音。

Also, when I do a netstat on the Linux box, it shows up a LISTENING connection to the port from the Solaris box. What makes the response return as a 127.0.0.1?

此外,当我在 Linux 机器上执行 netstat 时,它会显示从 Solaris 机器到端口的侦听连接。是什么让响应返回 127.0.0.1?

The Solaris box is called yyyy, and the Linux box is called xxxx. The initial port and host is gotten through an ini file.

Solaris 的盒​​子叫做 yyyy,Linux 的盒子叫做 xxxx。初始端口和主机通过 ini 文件获取。

采纳答案by roymustang86

The problem was nothing to do with the code. It was something to do with connectivity.

问题与代码无关。这与连接性有关。

On the LINUX box, cmrheldv, I had to edit the /etc/hosts file and change the 127.0.0.1 to the real ip for the localhost.

在 LINUX 机器 cmrheldv 上,我必须编辑 /etc/hosts 文件并将 127.0.0.1 更改为本地主机的真实 IP。

http://jeewesley.blogspot.com/2008/12/glassfish-ejb3-remote-interface-on.html

http://jeewesley.blogspot.com/2008/12/glassfish-ejb3-remote-interface-on.html

回答by Ivan Manoel da Silva Filho

Try to set the path to your variable and start orbd.

尝试设置变量的路径并启动 orbd。

Open cmd and type:

打开cmd并输入:

set path=%path%;"C:\Program Files\Java\jdk1.8.0_65\bin"

After that:

在那之后:

start orbd

回答by Mehdi

You should first start the ORB port with this command :

您应该首先使用以下命令启动 ORB 端口:

orbd -ORBInitialPort [PORT NUMBER]