Java Callout - does it require to restart RMPs post uploading organization/environment level resources?

I have created 2 Jars, one with input.txt file and another with a java class to read the input file. Uploaded the 1st jar as an organization resource file and used 2nd jar to create Java Callout policy which internally added it as a proxy level resource. Deployed the API proxy.

Got the below mentioned error message intermittently while testing the java callout policy. Checked both the RMP nodes and found errors on one of the node. Post restarting that node, able to get successful responses continuously. Is it required to restart RMPs whenever new resource files are uploaded at organization/environment level?

java.io.IOException: resource "/input.txt" not found at com.sample.java.utils.ReadFileCallout.getResourceAsStream(ReadFileCallout.java:85) at com.sample.java.utils.ReadFileCallout.getPrivateKeyBytes(ReadFileCallout.java:103) at com.sample.java.utils.ReadFileCallout.execute(ReadFileCallout.java:138) at com.apigee.steps.javacallout.JavaCalloutStepDefinition$ClassLoadWrappedExecution.execute(JavaCalloutStepDefinition.java:166) at com.apigee.steps.javacallout.JavaCalloutStepDefinition$SecurityWrappedExecution$1.run(JavaCalloutStepDefinition.java:231) at java.security.AccessController.doPrivileged(Native Method) at com.apigee.steps.javacallout.JavaCalloutStepDefinition$SecurityWrappedExecution.execute(JavaCalloutStepDefinition.java:228) at com.apigee.steps.javacallout.JavaCalloutStepDefinition$CallOutWrapper.execute(JavaCalloutStepDefinition.java:101) at com.apigee.messaging.runtime.steps.StepExecution.execute(StepExecution.java:146) at com.apigee.flow.execution.AbstractAsyncExecutionStrategy$AsyncExecutionTask.call(AbstractAsyncExecutionStrategy.java:74) at com.apigee.flow.execution.AbstractAsyncExecutionStrategy$AsyncExecutionTask.call(AbstractAsyncExecutionStrategy.java:45) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

0 1 183
1 REPLY 1

Hi Mahammad,

You do not need to restart the MP. In order to comply with security practices, the ability to load files from external jars is quite limited. You might consider having your input.txt file in the same jar as your code.

However, looking at your stack trace, I see you are trying to read a private key. Apigee Edge has the ability to store and manage private keys in the keystore. You may want to consider this alternative, as it allows the key to be managed by operations, and not through a development process.