Java Callout Error throws nullpointer for ApigeeEdge-Java-SecureRandom

Hi All,

We have this problem in our APIGEE private cloud. We are using a Java Callout for generating UUID gotten from https://github.com/DinoChiesa/ApigeeEdge-Java-SecureRandom.

In our Development environment the JavaCallout runs fine and is generating a random uuid successfully. On the other hand on our other environments (running on different host) when testing the JavaCallout throws the below error.

java.lang.NullPointerException at com.dinochiesa.edgecallouts.SecureRandomCallout.getSimpleOptionalProperty(SecureRandomCallout.java:89) at com.dinochiesa.edgecallouts.SecureRandomCallout.getAlgorithm(SecureRandomCallout.java:65) at com.dinochiesa.edgecallouts.SecureRandomCallout.execute(SecureRandomCallout.java:121) at com.apigee.steps.javacallout.JavaCalloutStepDefinition$ClassLoadWrappedExecution.execute(JavaCalloutStepDefinition.java:164) at com.apigee.steps.javacallout.JavaCalloutStepDefinition$SecurityWrappedExecution$1.run(JavaCalloutStepDefinition.java:229) at java.security.AccessController.doPrivileged(Native Method) at com.apigee.steps.javacallout.JavaCalloutStepDefinition$SecurityWrappedExecution.execute(JavaCalloutStepDefinition.java:226) at com.apigee.steps.javacallout.JavaCalloutStepDefinition$CallOutWrapper.execute(JavaCalloutStepDefinition.java:99) at com.apigee.messaging.runtime.steps.StepExecution.execute(StepExecution.java:132) at com.apigee.flow.execution.AsyncExecutionStrategy$AsyncExecutionTask.call(AsyncExecutionStrategy.java:87) at com.apigee.flow.execution.AsyncExecutionStrategy$AsyncExecutionTask.call(AsyncExecutionStrategy.java:56) 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)

Can this be something to do with the JVM version?

0 2 502
2 REPLIES 2

Hi @Harry Reynoso,

From the exception, it looks like you are missing the "algorithm" property in your Java callout configuration or no property at all is configured in Java callout.

Please check the configuration XML for Java callout in both environments if they are same.

If it is possible, could you please share the Java callout configuration XML? I will be able to answer better that way.

Regards.

Hi @Mohammed Zuber,

Thank you for the quick response. Here is the JavaCallout details. Simply put the uuid as output type as per documentation said.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JavaCallout async="false" continueOnError="false" enabled="true" name="JavaCallout.GenerateUUID">
<DisplayName>JavaCallout.GenerateUUID</DisplayName>
<ClassName>com.dinochiesa.edgecallouts.SecureRandomCallout</ClassName>
<Properties>
<Property name="algorithm">SHA1PRNG</Property>
<Property name="output-type">uuid</Property>
</Properties>
<ResourceURL>java://edge-java-callout-prng.jar</ResourceURL>
</JavaCallout>