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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sleck75
Contributor
Contributor

API call job failing as executable batch file

Hi,

 

I have a job that makes an API call using tRESTClient. It works perfectly fine when run from within TOS. However, when I run it as an executable batch file, it fails.

 

The first step of the job involves truncating a database table and that works fine when I run the executable. It seems to be the next phase of the job involving the API call which doesn't work.

 

Any suggestions appreciated?

 

Thanks,

Scott

Labels (2)
9 Replies
sleck75
Contributor
Contributor
Author

0683p000009Lzkf.jpgerror message


@ssunday wrote:

Hi,

 

I have a job that makes an API call using tRESTClient. It works perfectly fine when run from within TOS. However, when I run it as an executable batch file, it fails.

 

The first step of the job involves truncating a database table and that works fine when I run the executable. It seems to be the next phase of the job involving the API call which doesn't work.

 

Any suggestions appreciated?

 

Thanks,

Scott



@ssunday wrote:

Hi,

 

I have a job that makes an API call using tRESTClient. It works perfectly fine when run from within TOS. However, when I run it as an executable batch file, it fails.

 

The first step of the job involves truncating a database table and that works fine when I run the executable. It seems to be the next phase of the job involving the API call which doesn't work.

 

Any suggestions appreciated?

 

Thanks,

Scott


 


Capture.JPG
Anonymous
Not applicable

Hello,

Regarding this online document about:TalendHelpCenter:Building Jobs,

If the data service Job includes the tRESTClient or tESBConsumer component, and none of the Service Registry, Service Locator or Service Activity Monitor is enabled in the component, the data service Job can be built as OSGI Bundle For ESB or Standalone Job. With the Service Registry, Service Locator or Service Activity Monitor enabled, the data service Job including the tRESTClient or tESBConsumer component can only be built as OSGI Bundle For ESB.

Are you able to successfully build your job as an OSGI Bundle For ESB?

Best regards

Sabrina

 

sleck75
Contributor
Contributor
Author

Thanks Sabrina.

 

I was hoping to build as a standalone, if possible. In my tRestClient, both "Use Service Locator" and "Use Service Activity are Monitor" are disabled (can't see an option for "Service Registry?").

 

Is there anything else I can try to get it to work as a standalone?

 

Thanks again,
Scott

Anonymous
Not applicable

Hello,

Did you execute your job script batch file at the same server or different server with your studio?

Best regards

Sabrina

sleck75
Contributor
Contributor
Author

All on the same server, same database, etc. I've also tried with everything locally and experience the same issue on my laptop ie. runs fine in TOS, but not as an executable.

I think it's something to do with my build, as a colleague can run identical jobs without issue. (albeit, they're using 6.5 and I'm using 7).

Thanks,
Scott
Anonymous
Not applicable

Hi Scott,

Did you follow up this online user guide about:TalendHelpCenter:Building a Job as a standalone Job to build your job?

By default, when a Job is built, all the required jars are included in the.bat or .sh command.

For a complex Job that involves many Jars, the number of characters in the batch command may exceed the limitation of command length on certain operating systems.

To avoid failure of running the batch command due to this limitation, before building your Job, go to Window > Preferences > Talend > Import/Export and then select the Add classpath jar in exported jobs check box to wrap the Jars in a classpath.jar file added to the built Job.

Additionally, are you using JDK 1.8?

Best regards

Sabrina

 

sleck75
Contributor
Contributor
Author

Hi Sabrina,

 

Yes, JDK 1.8.

 

I tried the change to the preferences you suggested, but getting this error:

 

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/ws/WebServiceFeature
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at float_api.stg_client_0_1.STG_CLIENT.tRESTClient_1Process(STG_CLIENT.java:1037)
at float_api.stg_client_0_1.STG_CLIENT.runJobInTOS(STG_CLIENT.java:2046)
at float_api.stg_client_0_1.STG_CLIENT.main(STG_CLIENT.java:1901)
Caused by: java.lang.ClassNotFoundException: javax.xml.ws.WebServiceFeature
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 21 more

 

Also, the job is very simple: tRestClient ---> tExtractXMLField--> tLogRow

 

Thanks again,

Scott

 

Anonymous
Not applicable

Hello Scott,

There is a missing jar issue in your job. It could refer to axws-api-x.x.jar.

Did you install both jdk 1.6 and 1.8 on your computer?

Could you please set Java 1.8 bin path in path variable and modify .ini (for example: TOS_DI-win64-x86) file to force Talend to plug with Java 1.8?

Please add these lines in your .ini file :

-vm C:\Program Files\Java\jdk1.8.0_45\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8

Let us know if it is OK with you.

Best regards

Sabrina

 

Anonymous
Not applicable

Hi,

 

Im also getting same error when I tried to execute the batch in remote machine. Zulu 11 is the open jdk used in remote machine.

When I tried to run the batch file from my local by setting JAVA_HOME to zulu 11 path, Im not getting any error. I need to test this from remote as the web service access is available only from remote.