My team and I are trying to integrate an automated test generation tool (EvoSuite) into our plugin. Internally, it relies on spawning a separate thread or process that runs the actual generation process and communicates the results afterwards. This communication happens through Java RMI and we’re running into several issues that stem from this.
The following exception happens on the thread that is spawned by our plugin. It is thrown upon calling `registry.rebind()`
clientNode = new ClientNodeImpl<>(registry, identifier);
Remote stub = UtilsRMI.exportObject(clientNode);
[MASTER] 12:51:57.896 [client] ERROR ClientServices - Failed to register client services
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
The class `org.evosuite.rmi.service.ClientNodeRemote` is located in the tool’s jar which is loaded inside our `build.gradle.kts`:
The jar can also be located in the lib directory of the plugin which should mean that the jar is loaded into the classpath of the application. It should be noted that attempting to execute the same code in a normal process (outside of the environment of the plugin) works fine and no such issues occur.
Does IntelliJ have any special security requirements that may prevent Java RMI from working correctly within the scope of a plugin? Is there a way to disable those?
What we use for development:
Kotlin support ("org.jetbrains.kotlin.jvm") version "1.6.10"
Gradle IntelliJ Plugin ("org.jetbrains.intellij") version "1.4.0"
Different versions of IntelliJ on team members’ laptops: 2020.x.x, 2021.x.x and 2022.x.x
Plugin development based on IntelliJ Github Template
Thank you in advance!