I totally agree with this. It seems you are causing yourself a lot of problems for something the platform can do easier for you...
Original Message:
Sent: Wed March 15, 2023 08:21 AM
From: Francois Brandelik
Subject: How to import external Java library/classes
Have you looked at the dynamic runtime override properties of the HTTP Request node? There is no need for your java compute node, just some elaborate logic in the nodes preceding your HTTP Request node should do it!
------------------------------
Francois Brandelik
Original Message:
Sent: Wed March 15, 2023 03:56 AM
From: Nathaniel Santiago
Subject: How to import external Java library/classes
We want to avoid using drag-and-drop nodes like HTTP Request/Reply because we will send multiple asynchronous calls "dynamically". It is impossible with nodes like that. That's why we want our JavaComputeNode to do all the logic
I also tried again to put the jar files in the 3 shared classes directories you mentioned. still doesn't work :(
and yes also tried restarting IS even the whole ACE toolkit.
here's a screenshot.
------------------------------
Nathaniel Santiago
Original Message:
Sent: Wed March 15, 2023 02:19 AM
From: Matthias Blomme
Subject: How to import external Java library/classes
Hi Nathaniel
HTTP Request/Reply with json is perfectly doable from within esql, so not sure what makes your request so special that you need special java classes for that.
You are showing 2 separate print screens, first is from a stand alone IS and the second is from a node managed is.
For node managed IS, you actually have 3 shared classes directories
- system wide: C:\ProgramData\IBM\MQSI\shared-classes
- node wide: C:\ProgramData\IBM\MQSI\components\ACENODE\shared-classes
- integration server wide: C:\ProgramData\IBM\MQSI\components\ACENODE\servers\IS1\shared-classes
If you put shared-classes anywhere here, they are picked up by any flow inside the integration server. Aside from this you can include the jar files inside the bar you deploy.
In the below screenshot I simply referenced the jar file from the java project and it gets pulled inside the bar file.
You can also decompile java code you need and add it as java files to your java project, but I wouldn't advice that.
Did you try to do a restart of the IS/NODE after putting the jars in the shared-classes directory?
------------------------------
Regards
Matthias Blomme
Original Message:
Sent: Tue March 14, 2023 10:01 PM
From: Nathaniel Santiago
Subject: How to import external Java library/classes
@Matthias Blomme Hello again. are there other ways to import java libraries other than jar files? Using jar file still doesn't work for me.
I need to import an HTTP Request Library and a JSON Library for the feature that we need to implement. (Call and APIEndpoint using HTTP Request Library and Modify the request/response using the JSON Library in a JavaComputeNode)
Thanks in advance
------------------------------
Nathaniel Santiago
Original Message:
Sent: Tue March 14, 2023 02:29 AM
From: Matthias Blomme
Subject: How to import external Java library/classes
Hi Nathaniel
Sure you can, in a number of ways.
You can add java libraries inside an application, you can add them to the shared classes of your integration server, you can add them to the shared classes the node or you can create a custom node and add them by installing that one in the runtime.
Have a look at the following documentation to see how it works
https://www.ibm.com/docs/en/app-connect/12.0?topic=overview-java-shared-classloader
Can I ask why you can't call the endpoint with any other means, like rest node or something?
------------------------------
Regards
Matthias Blomme
Original Message:
Sent: Mon March 13, 2023 12:03 AM
From: Nathaniel Santiago
Subject: How to import external Java library/classes
Hello, I'm currently trying to call an endpoint using JavaComputeNode. Unfortunately, there is no current library in IBM ACE that I can use (I suppose).
I'm asking if: is it possible to import an external java library/packages/classes/jar file so that I can call an endpoint using JavaComputeNode?
Thanks in advance for those who will respond in my question
------------------------------
Nathaniel Santiago
------------------------------