I am trying to execute a remote operation, which means, an operation of another CArtAgO artifact. After the execution of the following @LINK operation an exception is occurring:
@LINK
void reply() throws OperationException {
try {
log("received keepalive back!");
}
}
CArtAgO is giving the following error message:
ERROR: (ArtifactC) Error on execLinkedOp without parameters! cartago.OperationException: execLinkedOp failed java.lang.IllegalArgumentException: INTERNAL ERROR: Op Exec Context cannot be restored. at cartago.Artifact.execLinkedOp(Artifact.java:964) at camelartifact.CamelArtifact.receiveMsg(CamelArtifact.java:112) at camelartifact.CamelArtifact.access$200(CamelArtifact.java:48) at camelartifact.CamelArtifact$ReadCmd.exec(CamelArtifact.java:207) at cartago.Artifact.await(Artifact.java:831) at camelartifact.CamelArtifact.listenRoutes(CamelArtifact.java:68) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at cartago.ArtifactOpMethod.exec(ArtifactOpMethod.java:39) at cartago.Artifact.doOperation(Artifact.java:407) at cartago.Artifact.access$200(Artifact.java:32) at cartago.Artifact$ArtifactAdapter.doOperation(Artifact.java:1275) at cartago.WorkspaceKernel.serveOperation(WorkspaceKernel.java:1136) at cartago.WorkspaceKernel.access$000(WorkspaceKernel.java:48) at cartago.WorkspaceKernel$EnvironmentController.run(WorkspaceKernel.java:1477)
What exactly is this error "op exec context cannot be restored" and how to fix it?
This error typically happens when you are calling execLinkedOp without being a CArtAgO internal thread, e.g., directly from some external Java threads, you should use IBlockingCmd with await methods. You can follow this example.
Another recommendations: