Search code examples
javaibm-cloudwebsphere-libertyworkload

How to troubleshoot IBM Bluemix Workload Scheduler for Java Runtime Error?


I have followed the sample code from the StockValueAlertExample. So I setup the process in code (and not through the Application-Lab UI)

There is a connection between my webapp (liberty profile) and the workload scheduler service.

For some reason there a two agents :

BN_CLOUD (where BN is the tenant) BN_CLOUD_1

BN_CLOUD has a red sign BN_CLOUD_1 has a green sign

After changing the agent to (BN_CLOUD_1) in the process step (by using the Application-Lab ui) and running the process, I got the following error:

= Status Message: AWKJJE004E Runtime Error "com.eoffice.scheduling.DummyTask".

Is there a interface that must be implemented ? I assumed running java meant implementing a static void main

Could I have provided a wrong jarpath when I setup the JavaStep ?


Solution

  • About the agent name, a new instance should only have the xx_CLOUD agent. If there are 2 agents (BN_CLOUD and BN_CLOUD_1 in your case) that means that there was an internal issue in the service instance provisioning. The operations team is working to identify and remove the issue. Moving your steps on BN_CLOUD_1 is correct as temporary workaround.

    About your runtime error, this is because you are trying to run your java class on the CLOUD agent, that is not able to run your jar. This step can be used installing an agent on your own machine and providing your jar locally.

    The standard patter to run Java code from the Workload Scheduler service on Bluemix, is to implement a REST API on Liberty runtime that runs your Java code, and then use a REST step in Workload Scheduler service to call that REST API.

    You can check the new Java Workload Scheduler Web Starter boilerplate as an example of Java code called by the Workload Scheduler service via REST API. In the boilerplate the code running on Liberty runtime defines also the Workload Scheduler process, but if you prefer you can use the Workload Scheduler UI to create the process manually.