0

I'm using Grails 2.3.8

I've created a default app using

grails create-app testapp

When I run:

grails runApp

I get the following issue:

| Configuring classpath
| Error Error executing script RunApp: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.eclipse.aether.internal.impl.Slf4jLoggerFactory$Slf4jLoggerEx.debug(Slf4jLoggerFactory.java:163)
    at org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider.newLocalRepositoryManager(DefaultLocalRepositoryProvider.java:142)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.newLocalRepositoryManager(DefaultRepositorySystem.java:421)
    at grails.util.BuildSettings.doResolve(BuildSettings.groovy:513)
    at grails.util.BuildSettings.doResolve(BuildSettings.groovy)
    at grails.util.BuildSettings$_getDefaultBuildDependencies_closure17.doCall(BuildSettings.groovy:774)
    at grails.util.BuildSettings$_getDefaultBuildDependencies_closure17.doCall(BuildSettings.groovy)
    at grails.util.BuildSettings.getDefaultBuildDependencies(BuildSettings.groovy:768)
    at grails.util.BuildSettings.getBuildDependencies(BuildSettings.groovy:673)
| Error Error executing script RunApp: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V

I tried running:

grails dependency-report

but I get the same issue.

java -version

gives:

java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
saw303
  • 8,051
  • 7
  • 50
  • 90
Greg Pagendam-Turner
  • 2,356
  • 5
  • 32
  • 49

4 Answers4

0

Not sure if this is your problem, but I vaguely recall there being some problems with Groovy and the earlier versions of Java 7. I'd recommend moving to the most recent. I have no problems with 2.3.8 and jdk1.7.0_55 (most recent at time of writing).

Bob Brown
  • 930
  • 2
  • 7
  • 14
0

Have you looked for conflicting versions of slf4j? Try running Grails dependency-report.

There are a few other SO questions that indicate this to be a cause of issue. Eg: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log

sl4j error in weblogic when deploying grails application war

Community
  • 1
  • 1
Bob Brown
  • 930
  • 2
  • 7
  • 14
0

One thing that can help in debugging situations like this is doing:

  export JAVA_OPTS="-verbose"

You can then see which slf4j JAR is being loaded by the JVM, but yes there is undoutably some conflicing slf4j JAR on your classpath

Graeme Rocher
  • 7,985
  • 2
  • 26
  • 37
0

There was an instance of slf4j in:

/Library/Java/Extensions/

Moving that out seems to have fixed the problem.

Greg Pagendam-Turner
  • 2,356
  • 5
  • 32
  • 49