Grails
  1. Grails
  2. GRAILS-9572

GrailsTask causes "Native Library jline_.dll already loaded in another classloader"

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: Build System
    • Labels:
      None
    • Environment:
      Win64

      Description

      GrailsTask can only be invoked once in a build.
      The second invocation causes a "jline_.dll already loaded in another classloader"

      Here is a simplified build.xml (full version attached)

      <project>
        <path id="grails.classpath" .../>
        <taskdef name="grails" .../>
      
        <target name="all" depends="clean, compile"/>
      
        <target name="clean">
          <grails classpathref="grails.classpath" script="Clean"/>
        </target>
      
        <target name="compile">
          <grails classpathref="grails.classpath" script="Compile"/>
        </target>
      </project>
      

      Running "ant clean" or "ant compile" by itself works fine.
      Running "ant all" or "ant clean compile" will fail (full stack attached)

      build.xml:25: Unable to start Grails: java.lang.reflect.InvocationTargetException
              at ...
      Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
              at ...
      Caused by: java.lang.reflect.InvocationTargetException
              at ...
      Caused by: java.lang.UnsatisfiedLinkError: Native Library C:\Users\dandoy\AppData\Local\Temp\jline_.dll already loaded in another classloader
              at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1905)
              at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
              at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
              at java.lang.Runtime.load0(Runtime.java:792)
              at java.lang.System.load(System.java:1059)
              at jline.WindowsTerminal.loadLibrary(WindowsTerminal.java:322)
              at jline.WindowsTerminal.initializeTerminal(WindowsTerminal.java:240)
              at jline.Terminal.setupTerminal(Terminal.java:75)
              at jline.Terminal.getTerminal(Terminal.java:26)
              at jline.ConsoleReader.<init>(ConsoleReader.java:174)
              at jline.ConsoleReader.<init>(ConsoleReader.java:169)
              at grails.build.logging.GrailsConsole.createConsoleReader(GrailsConsole.java:169)
              at grails.build.logging.GrailsConsole.<init>(GrailsConsole.java:133)
              at grails.build.logging.GrailsConsole.createInstance(GrailsConsole.java:268)
              at grails.build.logging.GrailsConsole.getInstance(GrailsConsole.java:245)
              at org.codehaus.groovy.grails.cli.GrailsScriptRunner.<init>(GrailsScriptRunner.java:96)
              ... 25 more
      

      I have traced disk accesses (procmon) and there is only one "jline_.dll" involved.

      1. build.log
        96 kB
        Cedric Dandoy
      2. build.xml
        1.0 kB
        Cedric Dandoy

        Activity

        Hide
        Andrew Eisenberg added a comment -

        Fixed in Grails-IDE, see issue here:

        https://issuetracker.springsource.com/browse/STS-2648

        Show
        Andrew Eisenberg added a comment - Fixed in Grails-IDE, see issue here: https://issuetracker.springsource.com/browse/STS-2648
        Hide
        Andrew Eisenberg added a comment -

        Reopening. Looks different from https://issuetracker.springsource.com/browse/STS-2648 since it looks like you are seeing this problem outside of an IDE.

        You may be able to get around this problem by using some of the same system properties described in the bug report linked above.

        Show
        Andrew Eisenberg added a comment - Reopening. Looks different from https://issuetracker.springsource.com/browse/STS-2648 since it looks like you are seeing this problem outside of an IDE. You may be able to get around this problem by using some of the same system properties described in the bug report linked above.

          People

          • Assignee:
            Unassigned
            Reporter:
            Cedric Dandoy
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development