I am wanting to create a Grails application with a number of java source files. These java files are to give me access to an embedded Neo4J graph by means of spring-data-neo4j.
(I would use the Grails Neo4J GORM plugin instead, but for the fact that it doesn't work in anything higher than Grails 2.3.5 - I'm using 2.4.3 - and even when using 2.3.5, the sample application provided by the developer has errors when I run it).
I want to create a series of java classes that represent the nodes that are present in the graph, which spring-data-neo4j will then allow me to access in Grails as POJOs (as discussed in point 1 of the second answer on SO here). I am using this Spring Data tutorial here as a starting point. I've copied the Person.java and PersonRepository.java classes to src/java. I'm then running "grails run-app" - I don't expect anything to happen, just for Grails to compile the java sources and then start normally (I'll then work on importing some of the code in Application.java into a 3rd java class to actually use the classes).
However, I get the following error and Grails crashes:
context.ContextLoader Context initialization failed java.lang.NoSuchMethodError: org.springframework.expression.spel.SpelParserConfiguration.(Lorg/springframework/expression/spel/SpelCompilerMode;Ljava/lang/ClassLoader;)V at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) context.GrailsContextLoaderListener Error initializing the application: org.springframework.expression.spel.SpelParserConfiguration.(Lorg/springframework/expression/spel/SpelCompilerMode;Ljava/lang/ClassLoader;)V java.lang.NoSuchMethodError: org.springframework.expression.spel.SpelParserConfiguration.(Lorg/springframework/expression/spel/SpelCompilerMode;Ljava/lang/ClassLoader;)V at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) | Error Forked Grails VM exited with error | Server running. Browse to
http://localhost:8080/
If I run the java example application as a basic java program (build and run it using "gradle run") then it works as advertised.
Is there something I need to do to get java code to compile properly inside a Grails spring data application?