Openshift, a web Service that invoke another web Service
Asked Answered
P

2

12

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

Parlance answered 7/5, 2015 at 10:38 Comment(6)
Are you trying to call another web service on the same application? What do your logs say?Apposition
Thanks for the reply, yes I have an web application deployed in Tomcat that calls another web service also deployed in tomcat, all in Openshift the error is: org.apache.axis2.AxisFault: Permission deniedParlance
@LolaLoulita ok could you install SoapUI in the same you machine where you have your client webservice and test to call the server web service?Aureolin
Have you had a look at this help.openshift.com/hc/en-us/articles/… ? Inside your gear your webservice should bind to 8080 and from external port 80 is routed to your gears 8080 port. How do you connect to your webservice? Do you use something like localhost:80, localhost:8080 or myapp-myDomain.rhcloud.com?Shivers
In the web service wsdl the endpoint is localhost:8080Parlance
Openshift will not allow binding to specific ports. More info here: https://mcmap.net/q/1012816/-permission-denied-error-after-deploying-to-openshift-using-jbossHellcat
A
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/

Arlo answered 7/5, 2015 at 17:2 Comment(0)
A
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.

See priviliged port

Aureolin answered 16/5, 2015 at 10:59 Comment(6)
Thank's for the reply, but what do you mean by running both servers as root, I can't access openshift as root and in my local machine I'm using a root user?! and about SoapUI I can't creat a project since I can't access the wsdl file, when deploying a war web service the wsdl is not generated auto it needs a aar format or somethingParlance
You can call your web service via SOAP ui without a wsdl just with the endpoint of your webserviceAureolin
I tried the endpoint but after I run it it shows an Html page of axis (Services Validate Administration), this is the endpoint mytomcatapp-sirdomain.rhcloud.com/AirlineWebService . any help is appreciatedParlance
@LolaLoulita actually there is no webservice exposed on your server. you can check it mytomcatapp-sirdomain.rhcloud.com/AirlineWebService/axis2-admin/…Aureolin
Well thank's, I don't understand where is the problem I deployed the web service, the war file in the webapp folder in Tomcat !!Parlance
Let us continue this discussion in chat.Aureolin

© 2022 - 2024 — McMap. All rights reserved.