Openshift,一个调用另一个web服务的web服务

时间:2022-04-10 03:00:59

I created a Tomcat 7 app in Openshift, and I deployed my web services there. the problem is that my web service is supposed to call another service. No results are displayed. I tested the service in localhost and it workedd fine but not in openshift!!

我在Openshift中创建了一个Tomcat 7应用程序,并在那里部署了我的web服务。问题是我的web服务应该调用另一个服务。没有显示结果。我在localhost中测试了服务,它很好,但是没有在openshift中!!

Should I change the URL of the services to myapp-myDomain.rhcloud.com? or what's the problem?

我应该将服务的URL更改为myapp-myDomain.rhcloud.com吗?还是有什么问题?

Update

更新

Does it have something to do with port forwarding, since my application trys to call another web service deployed in tomcat and anothe one external from wsdl url address (playing the role of a client web service), all deployed in Openshift?

它是否与端口转发有关,因为我的应用程序试图调用部署在tomcat中的另一个web服务,并从wsdl url地址(扮演客户端web服务的角色)中指定一个外部服务,这些都部署在Openshift中?

I receive the following exception which looks like some kind of Permission issue wrt Axis on Openshift.

我收到了下面的异常,它看起来像是Openshift上的某种权限问题wrt轴。

Complete StackTrace

完成加

    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:460)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

org.apache.axis2.AxisFault: Permission denied
    org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:197)
    org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
    org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
    org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
    org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
    org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
    org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.net.BindException: Permission denied
    java.net.PlainSocketImpl.socketBind(Native Method)
    java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
    java.net.Socket.bind(Socket.java:631)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:606)
    org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
    org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
    org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
    org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
    org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
    org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
    org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
    org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
    org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
    org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
    org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

A simple example with details are found here

这里有一个包含细节的简单示例

2 个解决方案

#1


1  

It could be related to Cross domain policy issue. I'm not sure. Please check the below URL. I hope it might of any help.

它可能与跨域策略问题有关。我不确定。请检查以下网址。我希望这能有所帮助。

https://spring.io/guides/gs/rest-service-cors/

https://spring.io/guides/gs/rest-service-cors/

#2


0  

It's a permission problem. You must run your both server as root user to open the 80 port. Otherwise you will got the exception.

这是权限的问题。您必须以根用户的身份运行两个服务器,才能打开80端口。否则就会出现异常。

See priviliged port

看到priviliged港口

#1


1  

It could be related to Cross domain policy issue. I'm not sure. Please check the below URL. I hope it might of any help.

它可能与跨域策略问题有关。我不确定。请检查以下网址。我希望这能有所帮助。

https://spring.io/guides/gs/rest-service-cors/

https://spring.io/guides/gs/rest-service-cors/

#2


0  

It's a permission problem. You must run your both server as root user to open the 80 port. Otherwise you will got the exception.

这是权限的问题。您必须以根用户的身份运行两个服务器,才能打开80端口。否则就会出现异常。

See priviliged port

看到priviliged港口