apache / apache/grails-intellij-plugin

Project build with Grails/Maven module results in NoClassDefFoundError jline/console/history/History

Open
#321 0 comments 0 reactions 0 assignees View on GitHub
bug imported-from-youtrack
Dominant language
Java
Stars
17
Forks
4
Avg merge
5d 15h
Merged PRs (30d)
4

Description

We have a Maven multi-module project with a number of Grails modules included. With Intellij 2017.2 and 2017.3 EAP we get an error when building on one of the Grails modules. This particular module has a Maven "test" scope dependency on jline itself, so it looks like it is conflicting somewhere with an Intellij Idea classpath? The only workaround for us is to manually set the dependency scope to "compile" after each project refresh.

`Error:Groovyc: While compiling mci-euui: java.lang.RuntimeException: java.lang.NoClassDefFoundError: jline/console/history/History
at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1091)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1069)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:62)
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.runGroovycInThisProcess(InProcessGroovyc.java:158)
at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.lambda$runGroovyc$0(InProcessGroovyc.java:88)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: jline/console/history/History
at org.codehaus.groovy.grails.compiler.injection.GrailsASTUtils.warning(GrailsASTUtils.java:134)
at org.codehaus.groovy.grails.compiler.web.ControllerActionTransformer.initializeAndValidateCommandObjectParameter(ControllerActionTransformer.java:849)
at org.codehaus.groovy.grails.compiler.web.ControllerActionTransformer.getCodeToInitializeCommandObjects(ControllerActionTransformer.java:432)
at org.codehaus.groovy.grails.compiler.web.ControllerActionTransformer.populateMethodWithCommandObjectInitializationCode(ControllerActionTransformer.java:400)
at org.codehaus.groovy.grails.compiler.web.ControllerActionTransformer.convertToMethodAction(ControllerActionTransformer.java:364)
at org.codehaus.groovy.grails.compiler.web.ControllerActionTransformer.processMethods(ControllerActionTransformer.java:252)
at org.codehaus.groovy.grails.compiler.web.ControllerActionTransformer.performInjectionOnAnnotatedClass(ControllerActionTransformer.java:207)
at org.codehaus.groovy.grails.compiler.web.ControllerActionTransformer.performInjection(ControllerActionTransformer.java:199)
at org.codehaus.groovy.grails.compiler.injection.GrailsAwareInjectionOperation.call(GrailsAwareInjectionOperation.java:154)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1055)
... 20 more
Caused by: java.lang.ClassNotFoundException: jline.console.history.History
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:222)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 30 more`

---

*Imported from [IDEA-181027](https://youtrack.jetbrains.com/issue/IDEA-181027) · Type: Bug · Votes: 0*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the IntelliJ build for the Maven multi-module project with the Grails module and inspect the Groovy compiler path around the reported jline failure. Trace the missing jline/console/history/History class through the GroovyCompilerWrapper and InProcessGroovyc stack frames; done means the module builds without manually changing the dependency scope to compile.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.