I saw this issue referenced over here, but even after removing the messageFlow and Expressions jar, it didn't fix my problem. In fact, I stripped my java class down to nothing, just to see if I could get it to work:
package com.xxxx.pmb; import com.apigee.flow.execution.ExecutionContext; import com.apigee.flow.execution.ExecutionResult; import com.apigee.flow.message.MessageContext; /** * Created by AD97875 on 12/7/2015. */ public class DummyTest { public ExecutionResult execute(MessageContext messageContext, ExecutionContext executionContext) { return ExecutionResult.SUCCESS; } }
My java callout looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <JavaCallout async="false" continueOnError="false" enabled="true" name="JavaDecryptor"> <DisplayName>Java.Decryptor</DisplayName> <Properties/> <ClassName>com.xxxx.pmb.DummyTest</ClassName> <ResourceURL>java://apigeeEncrypter-1.0-SNAPSHOT.jar</ResourceURL> </JavaCallout>
And looking at the generated jar provides this:
C:\Users\AD97875\IdeaProjects\encyptJava\target>jar -tf apigeeEncrypter-1.0-SNAP SHOT.jar META-INF/ META-INF/MANIFEST.MF com/ com/xxxx/ com/xxxx/pmb/ com/xxxx/pmb/DummyTest.class META-INF/maven/ META-INF/maven/com.xxxx.pmb/ META-INF/maven/com.xxxx.pmb/apigeeEncrypter/ META-INF/maven/com.xxxx.pmb/apigeeEncrypter/pom.xml META-INF/maven/com.xxxx.pmb/apigeeEncrypter/pom.properties C:\Users\AD97875\IdeaProjects\encyptJava\target>
However, I'm still getting this error message:
Error in deployment for environment dev.The revision is deployed, but traffic cannot flow. Failed to instantiate the JavaCallout Class com.xxxx.pmb.DummyTest
Can you try simple java-cookbook sample provided in apigee samples here - https://github.com/apigee/api-platform-samples/tree/master/doc-samples/java-cookbook See if this sample works.
Hi @David Scott
From the code you have pasted it seems like your 'DummyTest' does not implement the interface
com.apigee.flow.execution.spi.Execution
Let me know if thats the issue
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |