Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法在openshift上打开传出连接(套接字)_Java_Tcp_Spring Integration_Openshift - Fatal编程技术网

Java 无法在openshift上打开传出连接(套接字)

Java 无法在openshift上打开传出连接(套接字),java,tcp,spring-integration,openshift,Java,Tcp,Spring Integration,Openshift,我正在编写一个小应用程序来检查openshift上几个spring特性的功能和配置。您可以在此处找到代码: 目前我尝试测试spring集成对tcp/ip的支持,因为openshift对绑定到端口的能力有一些严格的限制。服务器套接字部分很简单:选择一个允许的端口并使用内部服务器ip(而不是本地主机) 我在客户端失败了。我想使用我的公共dns条目打开tcp连接以连接到我的服务器。据我所知(下面是stacktrace),我的应用程序无法为服务器的传出连接打开本地套接字 17:41:36.309 [po

我正在编写一个小应用程序来检查openshift上几个spring特性的功能和配置。您可以在此处找到代码:

目前我尝试测试spring集成对tcp/ip的支持,因为openshift对绑定到端口的能力有一些严格的限制。服务器套接字部分很简单:选择一个允许的端口并使用内部服务器ip(而不是本地主机)

我在客户端失败了。我想使用我的公共dns条目打开tcp连接以连接到我的服务器。据我所知(下面是stacktrace),我的应用程序无法为服务器的传出连接打开本地套接字

17:41:36.309 [pool-3-thread-1] DEBUG o.s.i.i.t.c.TcpNetClientConnectionFactory - Opening new socket connection to springtest-laures.rhcloud.com:4444
17:41:36.317 [pool-3-thread-1] ERROR o.s.i.ip.tcp.TcpOutboundGateway - Tcp Gateway exception
java.net.SocketException: Permission denied
    at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.7.0_19]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_19]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_19]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_19]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) ~[na:1.7.0_19]
    at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_19]
    at java.net.Socket.connect(Socket.java:528) ~[na:1.7.0_19]
    at java.net.Socket.<init>(Socket.java:425) ~[na:1.7.0_19]
    at java.net.Socket.<init>(Socket.java:208) ~[na:1.7.0_19]
    at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:271) ~[na:1.7.0_19]
    at org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory.createSocket(TcpNetClientConnectionFactory.java:89) ~[spring-integration-ip-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory.obtainConnection(TcpNetClientConnectionFactory.java:63) ~[spring-integration-ip-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory.getConnection(AbstractClientConnectionFactory.java:49) ~[spring-integration-ip-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.ip.tcp.TcpOutboundGateway.handleRequestMessage(TcpOutboundGateway.java:116) ~[spring-integration-ip-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:134) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:115) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:102) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.core.MessagingTemplate.doSendAndReceive(MessagingTemplate.java:318) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:239) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.core.MessagingTemplate.convertSendAndReceive(MessagingTemplate.java:274) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:224) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceive(MessagingGatewaySupport.java:203) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(GatewayProxyFactoryBean.java:306) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.gateway.GatewayProxyFactoryBean.doInvoke(GatewayProxyFactoryBean.java:269) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.integration.gateway.GatewayProxyFactoryBean.invoke(GatewayProxyFactoryBean.java:260) [spring-integration-core-2.2.3.RELEASE.jar:na]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [spring-aop-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at com.sun.proxy.$Proxy22.sendMessage(Unknown Source) [na:na]
    at com.openshift.test.socket.SocketClient.sendMessage(SocketClient.java:24) [SocketClient.class:na]
    at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) ~[na:na]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_19]
    at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_19]
    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:64) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) [spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_19]
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) [na:1.7.0_19]
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) [na:1.7.0_19]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_19]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.7.0_19]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_19]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_19]
    at java.lang.Thread.run(Thread.java:722) [na:1.7.0_19]
17:41:36.309[pool-3-thread-1]调试o.s.i.i.t.c.TcpNetClientConnectionFactory-打开到springtest laures.rhcloud.com的新套接字连接:4444
17:41:36.317[pool-3-thread-1]错误o.s.i.ip.tcp.TcpOutboundGateway-tcp网关异常
java.net.SocketException:权限被拒绝
在java.net.PlainSocketImpl.socketConnect(本机方法)~[na:1.7.0_19]
在java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)~[na:1.7.019]
在java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)~[na:1.7.019]
在java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)~[na:1.7.019]
在java.net.socksocketimpl.connect(socksocketimpl.java:391)~[na:1.7.0_19]
在java.net.Socket.connect(Socket.java:579)~[na:1.7.0_19]
在java.net.Socket.connect(Socket.java:528)~[na:1.7.0_19]
在java.net.Socket.(Socket.java:425)~[na:1.7.0\u 19]
在java.net.Socket.(Socket.java:208)~[na:1.7.0_19]
在javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:271)~[na:1.7.019]
在org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory.createSocket(TcpNetClientConnectionFactory.java:89)~[spring-integration-ip-2.2.3.RELEASE.jar:na]
在org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory.obtainConnection(TcpNetClientConnectionFactory.java:63)~[spring-integration-ip-2.2.3.RELEASE.jar:na]
在org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory.getConnection(AbstractClientConnectionFactory.java:49)~[spring-integration-ip-2.2.3.RELEASE.jar:na]
在org.springframework.integration.ip.tcp.TcpOutboundGateway.handleRequestMessage(TcpOutboundGateway.java:116)~[spring-integration-ip-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:134)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)[spring-integration-core-2.2.3.RELEASE.jar:na]
在org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:115)[spring-integration-core-2.2.3.RELEASE.jar:na]
在org.springframework.integration.dispatcher.UnicastingDispatcher.dispatcher(UnicastingDispatcher.java:102)[spring-integration-core-2.2.3.RELEASE.jar:na]
在org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)[spring-integration-core-2.2.3.RELEASE.jar:na]
在org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)[spring-integration-core-2.2.3.RELEASE.jar:na]
在org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.core.MessagingTemplate.dosendReceive(MessagingTemplate.java:318)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.core.MessagingTemplate.sendAndReceive(MessagingTemplate.java:239)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.core.MessagingTemplate.convertSendAndReceive(MessagingTemplate.java:274)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.gateway.MessagingGatewaySupport.dosendReceive(MessagingGatewaySupport.java:224)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.gateway.MessagingGatewaySupport.sendReceive(MessagingGatewaySupport.java:203)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(GatewayProxyFactoryBean.java:306)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.gateway.GatewayProxyFactoryBean.doInvoke(GatewayProxyFactoryBean.java:269)[spring-integration-core-2.2.3.RELEASE.jar:na]
位于org.springframework.integration.gateway.GatewayProxyFactoryBean.invoke(GatewayProxyFactoryBean.java:260)[spring-integration-core-2.2.3.RELEASE.jar:na]
在org.springframework.aop.framework.ReflectiveMethodInvocation.procedue(ReflectiveMethodInvocation.java:172)[spring-aop-3.2.2.RELEASE.jar:3.2.2.RELEASE]
在org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)[spring-aop-3.2.2.RELEASE.jar:3.2.2.RELEASE]
在com.sun.proxy.$Proxy22.sendMessage(未知源)[na:na]
在com.openshift.test.socket.SocketClient.sendMessage(SocketClient.java:24)[SocketClient.class:na]
在sun.reflect.GeneratedMethodAccessor21.invoke(未知源)~[na:na]
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)~[na:1.7.019]
在java.lang.reflect.Method.invoke(Method.java:601)~[na:1.7.0_19]
在org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:64)[spring-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
在