简体   繁体   English

OpenShift上的Apache ODE调用远程Web服务超时

[英]Apache ODE on OpenShift calling remote web-service timeout

I have the following configuration: 我有以下配置:

Tomcat 7 gear running on OpenShift Online. 在OpenShift Online上运行的Tomcat 7设备。 I deployed Apache ODE as a webapp and tested a simple BPEL workflow (Echo test) that worked perfectly. 我将Apache ODE部署为Web应用程序,并测试了一个完美运行的简单BPEL工作流程(回声测试)。 I have 2 more gears on OpenShift both running WildFly8 servers and some web-services. 我在OpenShift上还有2个齿轮,都在运行WildFly8服务器和一些Web服务。 I created a workflow for ODE that calles these services. 我为ODE创建了调用这些服务的工作流。 When I test the workflow on my local PC running Tomcat 7 and Apache ODE it works just fine. 当我在运行Tomcat 7和Apache ODE的本地PC上测试工作流程时,它工作正常。 However, on OpenShift I have the following issue: 但是,在OpenShift上,我遇到以下问题:

When ODE tries to call a remote web-service it tells its Axis libraries to create a socket. 当ODE尝试调用远程Web服务时,它告诉其Axis库创建套接字。 Since binding sockets to "localhost" on OpenShift is not allowed, I get an exception. 由于不允许将套接字绑定到OpenShift上的“ localhost”,因此出现异常。 I modified the org.apache.commons.httpclient.HttpConnection.open() method to bind the socket to the local OpenShift IP of my gear instead of localhost and got rid of the bind exception. 我修改了org.apache.commons.httpclient.HttpConnection.open()方法,将套接字绑定到我的设备的本地OpenShift IP而不是本地主机,并摆脱了绑定异常。 However, the remote web-service doesn't seem to respond to my request: 但是,远程Web服务似乎没有响应我的请求:

07:11:50,505 ERROR [ExternalService] Error sending message (mex={PartnerRoleMex#hqejbhcnphr9mgvfg5xbh1 [PID {org.neo}btest-2] calling org.apache.ode.bpel.epr.WSAEndpoint@1f51919.getClientData(...) Status ASYNC}): The host did not accept the connection within timeout of 60000 ms
org.apache.axis2.AxisFault: The host did not accept the connection within timeout of 60000 ms
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:203)
    at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at org.apache.ode.axis2.SoapExternalService$1$1.call(SoapExternalService.java:206)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 60000 ms
    at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:155)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:715)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
    at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:557)
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
    ... 12 more
Caused by: java.net.SocketTimeoutException: connect timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
    ... 21 more

This is the article that gave me this idea: https://www.openshift.com/forums/openshift/commons-httpclient-permission-denied 这是给我这个想法的文章: https : //www.openshift.com/forums/openshift/commons-httpclient-permission-denied

Again, when testing the exact same workflow on my PC with the exact same web-services it works just fine, so the WildFly8 servers and web-services are not the issue. 同样,在具有完全相同的Web服务的PC上测试完全相同的工作流时,它也可以正常工作,因此,WildFly8服务器和Web服务不是问题。

I am grateful for any tips, I've been at this for almost a week now... 我很感谢任何提示,我已经在这里待了将近一个星期了...

I managed to fix it by creating a DIY cartridge and installing the newest version of Tomcat 7 onto it. 我设法通过创建DIY墨盒并在其上安装了最新版本的Tomcat 7来对其进行了修复。 I deployed ODE and my workflow, got the same binding error as before, modified the apache-commons library that Axis was using and now it's sailing smoothly. 我部署了ODE,工作流程也出现了与以前相同的绑定错误,修改了Axis使用的apache-commons库,现在运行顺利。

I don't know why it didn't work with the Tomcat 7 cartridge I get from OpenShift as standard though. 我不知道为什么它不能与我从OpenShift作为标准的Tomcat 7盒一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM