Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
Web Services with Custom Extension
We have been working on a custom Druid extension for our processes and everything works in Studio and when run on a Job Agent in RapidMiner Server. However, if we expose a process as a Web Service, it fails to find some classes. The jar for the extension includes the classes in question, so it seems pretty odd. We can see logs where the code for the extension is executing so it is getting that far at least. We also tried dropping a jar in the libs that resolves this class, but it still doesn't find it.
Sep 20 10:06:50 ****** standalone.sh[31845]: Caused by: java.lang.ClassNotFoundException: org.glassfish.jersey.client.JerseyClientBuilder from [Module "deployment.rapidminer-server-9.3.0.ear:main" from Service Module Loader]
# strings /opt/rapidminer/rapidminer-server/rapidminer-server-home/resources/extensions/rmx_druid-1.0.0-all.jar | grep org.glassfish.jersey.client.JerseyClientBuilder
org/glassfish/jersey/client/JerseyClientBuilder$1.class
org/glassfish/jersey/client/JerseyClientBuilder.class
org/glassfish/jersey/client/JerseyClientBuilder$1.classPK
org/glassfish/jersey/client/JerseyClientBuilder.classPK
Tagged:
0
Best Answer
-
MichaelKnopf Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 31 RM Data Scientist@bmatt, thanks for posting the summary! I only have one thing to add: the relocation of the JAX-RS packages alone wasn't enough, since it does not change the logic of the service lookup performed by ClientBuilder.newBuilder() and ClientBuilder.newClient(). Thus, the need for instantiating the Jersey implementation directly.
6
Answers
Changed:
this.client = ClientBuilder.newClient(this.jerseyConfig);
To:
this.client = new JerseyClientBuilder().withConfig(this.jerseyConfig).build();
Added to build.gradle:
shadowJar {
relocate 'javax.ws.rs', 'shadow.javax.ws.rs'
}