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

The gist service doesn't run on Java 10 #4

Open
s-u opened this issue Sep 12, 2018 · 4 comments
Open

The gist service doesn't run on Java 10 #4

s-u opened this issue Sep 12, 2018 · 4 comments

Comments

@s-u
Copy link
Collaborator

s-u commented Sep 12, 2018

The service fails with

rcloud.create.notebook: Handler dispatch failed; nested exception is
java.lang.NoClassDefFoundError: javax/activation/MimetypesFileTypeMap (500)

In addition, it doesn't compile under Java 10 for two reasons:

  1. gradlew fails with
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not determine java version from '10.0.2'.
  1. after manual install of more recent gradle build fails with
> Task :rcloud-gist-service:javadoc
/tmp/rcloud-gist-services/rcloud-gist-service/src/main/java/com/mangosolutions/rcloud/rawgist/repository/git/ReadGistOperation.java:19: error: package javax.activation is not visible
import javax.activation.MimetypesFileTypeMap;
            ^
  (package javax.activation is declared in module java.activation, which is not in the module graph)
1 error

It seems possible to work around this issue by using

diff --git a/rcloud-gist-service/build.gradle b/rcloud-gist-service/build.gradle
index b128bf9..622cdc5 100644
--- a/rcloud-gist-service/build.gradle
+++ b/rcloud-gist-service/build.gradle
@@ -19,6 +19,7 @@ dependencies {
   compile 'org.codehaus.groovy:groovy-all'
   compile 'com.hazelcast:hazelcast'
   compile 'com.hazelcast:hazelcast-spring'
+  compile 'com.sun.activation:javax.activation:1.2.0'
 
   compile 'joda-time:joda-time'
   compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda'

but it's unclear if/how that would affect older Java versions.

@gordonwoodhull
Copy link

Nods, I am pretty sure I had to back out to Java 1.8. With version 9+ it ran but rules wouldn't match, so the service could not authenticate.

@boxheed
Copy link
Collaborator

boxheed commented Jan 19, 2021

Hi Simon and Gordon, hope you are both well. Couldn't resist this ticket. I have an update to the code to get it to run on Java 11 basically a load of dependencies needed to be updated due to the way Java has changed since I originally wrote this which had a slight knock on effect on the code. The dependencies could possibly do with tweaking a bit more as they are still not up to the latest but are probably OK for the moment.

I haven't got an RCloud environment with which to the changes so can't provide many guarantees that it is completely working, but it compiles, all the unit tests pass, it starts up and I've created a basic gist although admittedly no content. I've based the changes on the develop branch (again wasn't sure which branch you're really using). It's in my fork here:

https://github.com/boxheed/rcloud-gist-services/tree/develop

I can create a pull request if you want.

@gordonwoodhull
Copy link

Wow! Thanks @boxheed! Much appreciated.

I have to let go of RCloud for a few days and catch up with everything else. Hope to review next week.

It was our Public Cloud demo today so I have been cramming RCloud for about 10 days. Needs some updates but it is still a really neat platform.

@boxheed
Copy link
Collaborator

boxheed commented Jan 25, 2021

@gordonwoodhull No problem, give me a shout if anything doesn't make sense or you want the changes applied elsewhere. Happy to help out.

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