Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Openshift, a web Service that invoke another web Service

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!!

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

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?

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

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

like image 621
Lola Loulita Avatar asked May 07 '15 10:05

Lola Loulita


1 Answers

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/

like image 70
J.P Avatar answered Sep 21 '22 03:09

J.P