neo4j-ml-procedures icon indicating copy to clipboard operation
neo4j-ml-procedures copied to clipboard

Error compiling - Issue with lombok/java9 and iris already exists

Open kassimorra opened this issue 7 years ago • 2 comments

Hi Michael,

I'm trying to compile your project (jar file isn't avaliable for download). I ran into some errors mainly because I'm using java9 (I don't work with java, maybe I understood wrong). There is a problem with lombok and they have a topic discussing it (https://github.com/rzwitserloot/lombok/issues/985)

The solution was to add to pom.xml the following tags

  <configuration>
                                <source>${java.version}</source>
                                <target>${java.version}</target>
                                <fork>true</fork>
                                <compilerargs>
            		        <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
            		        <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
            		        <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
            		        <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
            		        <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
            		        <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
            		        <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
            		        <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
            		        <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                                </compilerargs>
                            </configuration>


    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.16.18</version>
        <scope>provided</scope>
    </dependency>

But when maven compile, it failed the test. here is the log message. Tests in error: predict(ml.MLProcedureTest): Failed to invoke procedure ml.create: Caused by: java.lang.IllegalArgumentException: Model iris already exists, please remove first

Do you know how to fix this ? I'm running it on mac high sierra

thanks

Kassim

kassimorra avatar Nov 17 '17 01:11 kassimorra

Don't use java9 for now with Neo4j.

I'm not sure where Lombok comes from in your case.

I'm picking up this component again next week.

jexp avatar Nov 19 '17 04:11 jexp

Ok! I switched back to java8.

Then, I got the following error: Tests in error: predict(ml.MLProcedureTest): Failed to invoke procedure ml.create: Caused by: java.lang.IllegalArgumentException: Model iris already exists, please remove first

I rename the model: String model = ml.create("iris2",types, "iris", Collections.singletonMap("framework","encog")).findAny().get().model;

and worked! thanks!

kassimorra avatar Nov 19 '17 09:11 kassimorra