Functions
A time out issue will occur if you have not properly caught an exception in your function, or if you haven’t closed the context at the end of your function’s code. This issue can also occur if you haven’t installed all the necessary modules files. To resolve this issue, you must try the following:
- Ensure that your code properly catches and handles exceptions
- Check if context.close( ) is added at the end of your function
- Ensure that you have installed all the necessary modules files based on the stack
If you encounter HTTP Error: 409, it means that a function with the same name already exists in the Catalyst console.
You can either change the name in the catalyst-config.json file or delete the existing function in the remote console using the CLI or directly from the console
If you have created functions in the Catalyst remote console, you must download them to your local machine before you can access them in your editor. If you created functions on your local machine, you can skip to step 3.
To access Catalyst Java functions in your Eclipse editor:
-
Download your function’s code from the remote console by executing the following Catalyst CLI command:
$ catalyst pull
You can refer to the Pull Resources help page for a detailed explanation.
This will automatically create a functions directory in your project home containing your functions.
-
Open your Eclipse editor. Navigate to File and then Open Projects From File System.
-
Click Directory next to Input Source in the pop-up.
-
Select the functions folder that was created using the CLI and click OK.
-
Ensure that Add project to working sets is unchecked.
-
Eclipse auto detects the Java functions in that folder. Select the functions you need from the list.
-
Click Finish.
Your Catalyst functions are now accessible in Eclipse.
-
Open your Java functions in Eclipse as described in the previous answer.
-
Right click on your project from the package explorer and click Build Path and then Configure Build Path…
-
Click the Libraries tab and select Add External JARs
-
Select the JAR to be included in the pop-up window and click Open.
-
The selected JAR will be included in JARs and class folders on the build path. Click Apply and Close
-
Code your function with the JAR included and test the code by executing the following command from the CLI:
catalyst serve
You can learn about this command in detail from the Serve Resources help page.
-
You can then directly deploy the function from the CLI without worrying about the additional JAR file. Execute the following CLI command to deploy the Java functions to the remote console along with the external JAR:
catalyst deploy –only functions
You can learn about this command in detail from the Deploy Resources help page.
-
After the function has been deployed, you can verify whether the JAR has been added to your function group from the Catalyst console.
Circuits
Last Updated 2023-08-31 17:32:40 +0530 +0530
Yes
No
Send your feedback to us