Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rest Interface Issue Using Quarkus #635

Open
jeportc82 opened this issue Sep 1, 2023 · 2 comments
Open

Rest Interface Issue Using Quarkus #635

jeportc82 opened this issue Sep 1, 2023 · 2 comments

Comments

@jeportc82
Copy link

jeportc82 commented Sep 1, 2023

Environment Details

  • MicroStream Version: 08.01.01-MS-GA
  • JDK version: 17
  • OS: Mac os
  • Used frameworks: Quarkus 3.3.1

Describe the bug

REST Interface does not start.

I'm getting the following error.

Exception in thread "Thread-130" java.lang.NoClassDefFoundError: javax/servlet/Filter

        at spark.embeddedserver.EmbeddedServers.initialize(EmbeddedServers.java:41)
        at spark.Service.lambda$init$2(Service.java:618)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:516)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:466)
        ... 3 more 

To Reproduce

Add the following maven dependencies

    <dependency>
      <groupId>one.microstream</groupId>
      <artifactId>microstream-quarkus3-extension</artifactId>
      <version>08.01.01-MS-GA</version>
    </dependency>
    <dependency>
        <groupId>one.microstream</groupId>
        <artifactId>microstream-storage-restservice-sparkjava</artifactId>
        <version>08.01.01-MS-GA</version>
    </dependency>

and then execute the following code to start the service

StorageRestService service = StorageRestServiceResolver.resolve(storage);
service.start();

Expected behavior

Rest Interface must be available in the default por 4567.

@hg-ms
Copy link
Contributor

hg-ms commented Sep 4, 2023

The NoClassDefFoundError is most likely caused by the missing java EE dependencies required by our rest service implementation. Quarkus already uses the newer Jarkata EE.

Our ‘microstream-storage-restservice-sparkjava’ was implemented to run within plain java applications. Therefore, it brings its own rest framework and webserver (sparkjava). If you like to use the rest-api with Quarkus I’d suggest not using our implementation. Instead, you may consider implementing the required rest api directly using Quarkus only. Doing so should be quite trivial. Please see #549 for more details.

@guykatz
Copy link

guykatz commented Sep 14, 2023

@jeportc82 it was super easy to implement the REST endpoints "in house" as described in #549
With Quarkus the REST part is super easy and the only thing you will have to do is plug in 2-3 lines of code calling the micsotream adapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants