[GRADLE-1609] Daemon does not work with Grails Created: 13/Jun/11  Updated: 04/Jan/13  Resolved: 25/Aug/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-3
Fix Version/s: 1.0-milestone-5

Type: Bug
Reporter: Luke Daley Assignee: Luke Daley
Resolution: Fixed Votes: 0


 Description   

When starting Grails in the daemon JVM I see different behaviour to when I don't use the daemon. My build fails with:

19:25:40.866 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
19:25:40.866 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':spock-grails:clean'.
19:25:40.867 [ERROR] [org.gradle.BuildExceptionReporter] Cause: java.lang.reflect.InvocationTargetException
19:25:40.867 [ERROR] [org.gradle.BuildExceptionReporter] Cause: java.lang.reflect.InvocationTargetException (no error message)
19:25:40.872 [ERROR] [org.gradle.BuildExceptionReporter] Cause: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/grails/launcher/RootLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for resolved class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
19:25:40.873 [ERROR] [org.gradle.BuildExceptionReporter] 
19:25:40.874 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
19:25:40.877 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':spock-grails:clean'.
19:25:40.878 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:71)
19:25:40.878 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:48)
19:25:40.880 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
19:25:40.881 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
19:25:40.881 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
19:25:40.882 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
19:25:40.883 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
19:25:40.883 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
19:25:40.884 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
19:25:40.885 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:237)
19:25:40.885 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167)
19:25:40.887 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:160)
19:25:40.888 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:78)
19:25:40.889 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:113)
19:25:40.889 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54)
19:25:40.890 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:158)
19:25:40.890 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
19:25:40.891 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:80)
19:25:40.891 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.ExecuteBuildAction.run(ExecuteBuildAction.java:44)
19:25:40.892 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.DefaultGradleLauncherActionExecuter.execute(DefaultGradleLauncherActionExecuter.java:49)
19:25:40.892 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.DaemonMain.build(DaemonMain.java:143)
19:25:40.892 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.DaemonMain.doRunWithExceptionHandling(DaemonMain.java:132)
19:25:40.893 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.DaemonMain.doRunWithLogging(DaemonMain.java:114)
19:25:40.893 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.DaemonMain.doRun(DaemonMain.java:94)
19:25:40.894 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.DaemonMain.access$000(DaemonMain.java:45)
19:25:40.894 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.DaemonMain$1.handle(DaemonMain.java:75)
19:25:40.895 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.DaemonConnector$1.execute(DaemonConnector.java:165)
19:25:40.895 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.launcher.DaemonConnector$1.execute(DaemonConnector.java:161)
19:25:40.895 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.messaging.remote.internal.TcpIncomingConnector$Receiver.run(TcpIncomingConnector.java:102)
19:25:40.896 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:63)
19:25:40.896 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
19:25:40.897 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.grails.launcher.GrailsLauncher.launch(GrailsLauncher.java:114)
19:25:40.897 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.grails.launcher.GrailsLauncher$launch.call(Unknown Source)
19:25:40.897 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.grails.gradle.plugin.GrailsTask.executeCommand(GrailsTask.groovy:94)
19:25:40.898 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:158)
19:25:40.898 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
19:25:40.899 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.grails.gradle.plugin.GrailsTask_Decorated.invokeMethod(Unknown Source)
19:25:40.899 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
19:25:40.900 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:129)
19:25:40.900 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:127)
19:25:40.901 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:63)
19:25:40.901 [ERROR] [org.gradle.BuildExceptionReporter] 	... 29 more
19:25:40.902 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.reflect.InvocationTargetException
19:25:40.902 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.grails.launcher.GrailsLauncher.launch(GrailsLauncher.java:108)
19:25:40.902 [ERROR] [org.gradle.BuildExceptionReporter] 	... 38 more
19:25:40.903 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/grails/launcher/RootLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for resolved class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
19:25:40.903 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:273)
19:25:40.904 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
19:25:40.904 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
19:25:40.905 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
19:25:40.920 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
19:25:40.921 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.springframework.util.PropertyPlaceholderHelper.<clinit>(PropertyPlaceholderHelper.java:40)
19:25:40.921 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.springframework.util.SystemPropertyUtils.<clinit>(SystemPropertyUtils.java:49)
19:25:40.921 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.springframework.util.Log4jConfigurer.initLogging(Log4jConfigurer.java:66)
19:25:40.925 [ERROR] [org.gradle.BuildExceptionReporter] 	... 39 more
19:25:40.925 [ERROR] [org.gradle.BuildExceptionReporter] 


 Comments   
Comment by Luke Daley [ 25/Aug/11 ]

The daemon process was being launched with the full gradle runtime as the system classpath, whereas non gradle mode just has the launcher jar on the system classpath.

Generated at Wed Jun 30 11:59:54 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.