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)
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).
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
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
There was an instance of slf4j in:
/Library/Java/Extensions/
Moving that out seems to have fixed the problem.
Related
I am new to Grails and never made any project on it. I followed some tutorials and downloaded both Grails and JDK and set my environment variables exactly as specified, but when I tried to run the application, I got this error and my application is not running:
Error initializing classpath: could not determine java version from '10.0.2'
I just used CMD and none of the IDE is used, please help me solve this problem.
First check classpath of both for Java & Grails by running these command java -version & grails -version
If you found problem in classpath then solve by this way http://grails.asia/grails-tutorial-for-beginners-setup-your-windows-development-environment/
Although its better to use Java 8, not Java 10
I'm trying to run grails list-profiles, but receive the following error:
snowch#snowch-ws2:~/repos$ grails list-profiles --stacktrace
| Error Error occurred running Grails CLI: null (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NullPointerException
at org.grails.cli.profile.git.GitProfileRepository.getAllProfiles(GitProfileRepository.groovy:72)
at org.grails.cli.profile.commands.ListProfilesCommand.handle(ListProfilesCommand.groovy:43)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:173)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:99)
| Error Error occurred running Grails CLI: null
My versions are:
snowch#snowch-ws2:~/repos$ grails --version
| Grails Version: 3.0.1
| Groovy Version: 2.4.3
| JVM Version: 1.7.0_75
This was on a fresh install of grails and gvm.
The command grails create-app myapp works without error.
This question is similar to Grails 3.0 error, nullpointer, however, that question does not state what command is being run.
After searching online, I found that I needed to set my GRAILS_OPTS environment variable as follows before running the command:
export GRAILS_OPTS="-XX:-UseSplitVerifier -Xverify:none"
Source of fix: https://grails.org/news/1292028
I have not figured out, what is the exact cause of the error, but it seems to occur if you try to run grails 3 in the system where grails 2 is also installed.
What I did to get the command run - I created the project in a new directory. The directory for my old grails app was:
/home/me/projects/oldgrailsapp
when I tried to execute the grails command in /home/me/projects it failed, but when I tried this in another directory /home/me/projects_new, it succeeded. So I guess that the problem was that old grails configuration was somehow interfering with the new one.
I also removed references to old grails and groovy versions from the PATH variable by editing .bashrc file in my home directory (I really do not know if it was needed).
I had same experience when I was working on "Building an Andoird Client" guide, I got the following message whenever I try to create an app in the same folder where I've created the first app grails-app :
| Error Error occurred running Grails CLI: null (Use --stacktrace to see the ful
l trace)
So obviously, when you create a grails app in folder containing "grails-app" directory, grails will consider this folder as full grails application, hence cannot create-app in that directory.
I used:
Grails 3.1.15
Java 1.8.0.101
Hope this help.
It worked for me now.
this was my setting
GRAILS_HOME=C:\Users\murali.solayappan\apps\grails-3.1.11
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_102
I received the same error while launching "grails" for the first time
**Error occurred running Grails CLI: connect timed out**
After reading GRAILS_HOME\bin\grails.bat i found that executing "grails" while in GRAILS_HOME dir makes some difference. So I did the same
Now i received error stating that GRAILS couldn't find a particular maven package from my mirror repository - printed my private nexus repository url. I know that's my private repo and not connected to internet.
so I changed the MY_HOME_DIR.m2\"settings.xml" with the one came by default in Maven.
After that executed "grails" while in %GRAILS_HOME% dir.
It worked like breeze !!! I got grails prompt.
C:\Users\murali.solayappan\apps>grails
| Enter a command name to run. Use TAB for completion:
grails> exit
Somethimes it happens when you have wrong version of grails installed for the project you want to run it on
try to run it somewhere else and see if you get the same error
i had the same issue because i was using Grails 1.3.5 witj Java 8 which are incompatibles. I changed with Java 7 and it works fine.
I was just trying to run Grails 3.0.1 in commandline via "grails" but it failed with the following stacktrace:
| Error Error occurred running Grails CLI: null
java.lang.NullPointerException
at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3137)
at org.grails.cli.profile.git.GitProfileRepository.getAllProfiles(GitProfileRepository.groovy:72)
at org.grails.cli.profile.commands.ListProfilesCommand.handle(ListProfilesCommand.groovy:43)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:173)
at org.grails.cli.GrailsCli.getBaseUsage(GrailsCli.groovy:118)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:162)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:99)
| Error Error occurred running Grails CLI: null
I'm using this version of Java
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
I have tried all the things mentioned in different threads, including setting GRAILS_OPTS. The issue seems to go away after running
grails create-app myApp and create a sample app.
Not sure why, but seems like a connection problem with the Grails repo, which resolved after running the command.
I am facing problem in executing a the test cases for grails application. I'm using grails 2.3.7 and jdk1.7.0_25. when I am trying to perform the test-app command to test my grails application, I am getting the bellow error.
|Loading Grails 2.3.7 |Configuring classpath . |Environment set to test ...................................... |Running without daemon... Error | Error running forked test-app: org/codehaus/gant/GantBinding (Use --stacktrace to see the full trace) Error | Forked Grails VM exited with error
any guess, why this type of error comes? Please check in this regard and suggest any help.
It looks like this may be an issue with a missing tools.jar file, according to this bug. Seems like it may have been fixed in a later version of Grails, so if you can't add the jar, perhaps upgrading may help.
When trying to start a project (./grailsw run-app) for the first time with the latest version of the database-migration plugin, it fails with the following error:
Error Compilation error: startup failed:
[..]/work/plugins/database-migration-1.3.8/src/groovy/grails/plugin/databasemigration/GormDatabaseSnapshotGenerator.groovy: 48: You cannot create an instance from the abstract class 'liquibase.snapshot.DatabaseSnapshot'.
# line 48, column 31.
DatabaseSnapshot snapshot = new DatabaseSnapshot(db, requestedSchema)
I'm using java7 on OSX:
$ java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
This seems vaguely familiar to me; I was able to find random references to other projects in 2009-2011 about this. Nothing current; and nothing found in the specific plugin's issue tracker. I'd ask there but I expect this is a fairly standard issue, not related to the specific grails plugin.
A peer is using java6. I went back to java6 (apple(tm) version), ran ./gradlew --refresh-dependencies run-app and got the same thing.
Looks like liquibase made that class abstract in v3
However, the plugin looks like it should be using v2.0.5
So as far as I can see, for v2.0.5 it should be ok?
Unless you've added a dependency to liquibase v3?