Options

Web Services with Custom Extension

bmattbmatt Member Posts: 8 Contributor II
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:

Best Answer

Answers

  • Options
    sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager
  • Options
    mmichelmmichel Employee, Member Posts: 129 RM Engineering
    JBoss is shipping RESTEasy, you would need to adapt the jax rs default implementation accordingly.
  • Options
    bmattbmatt Member Posts: 8 Contributor II
    edited September 2019
    Worked with @ryanjohansen and some others today and got this fixed. There were two issues we ran into:

    1. Using the ClientBuilder from JAX-RS caused the initial failure to find code, as it wasnt resolving the class properly.

      Changed:

      this.client = ClientBuilder.newClient(this.jerseyConfig);

      To:

      this.client = new JerseyClientBuilder().withConfig(this.jerseyConfig).build();

    2. As @mmichel pointed out the JAX-RS implementation was also an issue, the project I was building off of was using JAX-RS 2.1. Using the shadow plugin, which appears to already be build in to the RM dependencies, we were able to work around that by relocating the JAX-RS implementation for this extension.

      Added to build.gradle:

      shadowJar {
          relocate 'javax.ws.rs', 'shadow.javax.ws.rs'
      }
Sign In or Register to comment.