Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ROpp1632553451
Contributor
Contributor

REST API job runs in studio but not in CMD or Linux machine

The job I created runs perfectly in Studio. Even crested another job to test the REST API and everything looks good in my Studio. When I do build a job and then try to run the REST API from CMD or from Linux machine it doesn't run.

Tried all the options given in different posts in de community (point windows to JDK, add CLASSPATH, PATH and JAVA_HOME) and now I have an additional problem when I try to build the job from Studio (Error line: 451. Detail message syntax error on token ":",;expected. There may be some other errors caused by JVM compatibility.Make sure your JVM setup is similar to the studio)

Labels (4)
8 Replies
Anonymous
Not applicable

Hello,

Could you please clarify in which Talend version/edition you are and what's JDK version you are using?

Best regards

Sabrina

 

ROpp1632553451
Contributor
Contributor
Author

Hi,

I am using JDK 17 and Talend Studio 7.3.

I tried several different ways to resolve the problem with the job, with no success.

 

Tried to fix the issue through:

  • Updated packages – more than 12 hours update
  • Download and Install Java JDK
  • Set CLASSPATH, PATH, JAVA_HOME vars
  • Change IP ports – in all the cases the same response “web server failed to start. Port 80.. was already in use”

 

When I run the .bat from CMD as administrator, the response is “web server failed to start. Port 80.. was already in use”

Found here and here the issue is caused due to “The IP specified is not own interface. Socket is not able to bind to that IP”.

 

Also found in application properties file that server.port: 8065 - that was automatically defined - is the port CMD is pointing to and not port 8088 defined by me

Tried changing server.port to the same port defined in REST_endpoint but received the same response “web server failed to start. Port 80.. was already in use”.

Anonymous
Not applicable

Hello,

Firstly, JDK 17 is not list in the compatible java environment table. Please try oracle JDK 11 instead.

For more information, please have a look at this online documentation: TalendHelpCenter: Compatible Java Environments

Ensure proper version of JDK is installed. If that requirement is met, ensure JDK bin is included in your PATH environment variable and is being reached.

Best regards

Sabrina

 

ROpp1632553451
Contributor
Contributor
Author

Downloaded JDK 11 and added to Path.

Run the job again but received the same response in CDM

ROpp1632553451
Contributor
Contributor
Author

When I try to post to the REST API I build I receive the following message in the job I use to post:

sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1400)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1384)

at org.apache.cxf.io.AbstractWrappedOutputStream.close(AbstractWrappedOutputStream.java:77)

at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)

at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671)

at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)

... 10 more

Caused by: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at sun.net.NetworkClient.doConnect(NetworkClient.java:175)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)

at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)

at sun.net.www.http.HttpClient.New(HttpClient.java:339)

at sun.net.www.http.HttpClient.New(HttpClient.java:357)

at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1199)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)

at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)

at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:274)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1343)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1304)

at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:307)

at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)

at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1356)

... 14 more

 

Exception in component tRESTClient_1 (REST_web_service_test)

javax.ws.rs.ProcessingException: java.net.ConnectException: ConnectException invoking http://localhost:8090/api/v1/Transactions: Connection refused: connect

at org.apache.cxf.jaxrs.client.AbstractClient.checkClientException(AbstractClient.java:632)

at org.apache.cxf.jaxrs.client.AbstractClient.preProcessResult(AbstractClient.java:606)

at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1150)

at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1087)

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:932)

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:901)

at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:364)

at org.apache.cxf.jaxrs.client.WebClient.post(WebClient.java:373)

at boc.rest_web_service_test_0_1.REST_web_service_test.tFixedFlowInput_1Process(REST_web_service_test.java:2796)

at boc.rest_web_service_test_0_1.REST_web_service_test.runJobInTOS(REST_web_service_test.java:3607)

at boc.rest_web_service_test_0_1.REST_web_service_test.main(REST_web_service_test.java:3377)

Caused by: java.net.ConnectException: ConnectException invoking http://localhost:8090/api/v1/Transactions: Connection refused: connect

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1400)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1384)

at org.apache.cxf.io.AbstractWrappedOutputStream.close(AbstractWrappedOutputStream.java:77)

at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)

at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671)

at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)

at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)

at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:704)

at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1086)

... 7 more

Caused by: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at sun.net.NetworkClient.doConnect(NetworkClient.java:175)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)

at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)

at sun.net.www.http.HttpClient.New(HttpClient.java:339)

at sun.net.www.http.HttpClient.New(HttpClient.java:357)

at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1199)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)

at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)

at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:274)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1343)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1304)

at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:307)

at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)

at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1356)

Anonymous
Not applicable

Hello,

Please open the studio preferences and open Java->Installed JRE and use the Add button. Choose here the home directory of your installed JRE(JDK 11).

Best regards

Sabrina

 

ROpp1632553451
Contributor
Contributor
Author

doesn't work. Tried with JDK Oracle, JDK zulu, changing PATH, CLASSPATH, JAVA_HOME, Installed JRE... Nothing has changed, same response "Web server failed to start. Port 8065 was already in use" but that port wasn't defined by me. That's the port defined in server.port (in properties file) not in REST endpoint (trestrequest). Cannot understand why those ports are different and why CMD points to server.port - that is the port that fails to connect - and not to REST endpoint.

Anonymous
Not applicable

Hello,

The job is still running well within studio? Did you build it as a standalone one? Would you mind posting your job design screenshots here which will be helpful for us to address your issue?

Please mask your sensitive data if needed.

Best regards

Sabrina