Four Stars

Issue deploying a rest service on a Windows Server

Hi All,

 

I'm new with TOS ESB and work with the community version. I've developed a REST service which works fine on my local machine (checked on SoapUi with the following url : http://localhost:8088/transport/order/123456). I've created my job (.jar for OSGi container) and copied it in the Runtime_ESBSE\container\deploy directory on a Windows 2012R2 server. When I check the karaf webconsole, I can see my job (status = active) and everything seems to be fine. When I try to invoke my REST service on the server with SoapUI (http://localhost:8088/transport/order/123456) everything is ok,I retrieve my data but when I try to invoke the REST service deployed on the distant server from my local machine (http://my-server:8088/transport/order/123456), I get the following error : Socket is not connected.

 

Additional info :

- I've stopped Windows 2012R2 server firewall

- I've added the following option on the header properties of the tRESTResponse component : Name = "Access-Control-Allow-Origin" - Value = "*"

- The endpoint REST on the tRESTRequest is : http://localhost:8088/transport/order

 

Does someone have an idea to help me ?

Many thanks

  • ESB
1 ACCEPTED SOLUTION

Accepted Solutions
Five Stars

Re: Issue deploying a rest service on a Windows Server

hello,

Can you try this :

make sure you the port is 8040 and it's open to the firewall

list your service with  http://ipserver:8040/services

if you use the runtime talend ESB OS you dont need to specify the server, modify your  The endpoint REST on the tRESTRequest with : /transport/order

deploy to the contenair

list your service with http://ipserver:8040/services

 

invoke with http://ipserver:8040/services/transport/order/123456

 

 

 

 

10 REPLIES
Moderator

Re: Issue deploying a rest service on a Windows Server

Hi,

Can you ping your distant server successfully?

Best regards

Sabrina

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: Issue deploying a rest service on a Windows Server

Hi Sabrina,

 

Thank you for your help. Yes I can ping the distant server successfully.

 

Best regards


Thomas

Moderator

Re: Issue deploying a rest service on a Windows Server

Hi,


 I get the following error : Socket is not connected.


Could you please show us the full stack track? On which talend build version you got this issye?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: Issue deploying a rest service on a Windows Server

Hi Sabrina,

I use build 6.3.1 for both TOS (on Windows 7 Pro 64) and runtime. Today I've tried to invoke the rest service from different clients and get a very odd behavior :
* For one client with Windows 10 Pro I get the following error : Error getting response; java.net.SocketException: Permission denied: connect
* For two clients with Windows 7 Pro 64 I get the following error :  Error getting response; java.net.SocketException: socket is not connect

These clients belong to the same windows domain, and users are admin of their computer
Please find enclosed the logs coming from SoapUi

Thank you.

Best regards

Thomas

Moderator

Re: Issue deploying a rest service on a Windows Server

Hi,

Are you using java 7 or java 8? Is there any anti-virus or firewall software which block you from connecting to the Server port? Your role have access right for your server also?

Best regards

Sabrina

 

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: Issue deploying a rest service on a Windows Server

Hi,

I use java 8 update 144 for both clients and server. I've tried the following steps :
* With windows 10 client, when I switch off all firewall and antivirus rules, I get this error : Error getting response; org.apache.http.conn.HttpHostConnectException: Connection to http://{IP or hostname of the server}:8088 refused
* With Windows 7 clients, always the same error : Error getting response; java.net.SocketException: socket is not connect

I've modified my server as follow :
- Create incoming and outgoing traffic rules on port 8088
- Deactivate windows firewall
- Deactivate the antivirus

After another try to invoke my REST service with SoapUI on the server I get these results :
- http://localhost:8088/transport/order/123456 --> result OK
- http://127.0.0.1:8088/transport/order/123456 --> result OK
- http://{IP Address of the server}:8088/transport/order/123456 --> result KO
- http://{hostname of the server}:8088/transport/order/123456 --> result KO

Error message for the two last tries :
Error getting response; org.apache.http.conn.HttpHostConnectException: Connection to http://{IP or hostname of the server}:8088 refused

Best Regards

Thomas

Five Stars

Re: Issue deploying a rest service on a Windows Server

hello,

Can you try this :

make sure you the port is 8040 and it's open to the firewall

list your service with  http://ipserver:8040/services

if you use the runtime talend ESB OS you dont need to specify the server, modify your  The endpoint REST on the tRESTRequest with : /transport/order

deploy to the contenair

list your service with http://ipserver:8040/services

 

invoke with http://ipserver:8040/services/transport/order/123456

 

 

 

 

Four Stars

Re: Issue deploying a rest service on a Windows Server

Hi fab_74,

 

Many thanks for your message, it works very well now !

To be very clear about this issue, is it mandatory to invoke the service by calling the http://ipserver:8040/services/ ?

 

Best regards

Five Stars

Re: Issue deploying a rest service on a Windows Server

hi,

 

ip by servername Smiley Wink

you can modify the port with the file  :/container/etc/org.ops4j.pax.web.cfg

I think it's possible not use it...  If you use the http port (80) (I did this operation  for https but not for http)

but I don't think you can modify or remove /service/

Best regards

Four Stars

Re: Issue deploying a rest service on a Windows Server

Ok, I'll look at this configuration file.

Thanks again for your help !

 

Best regards