I just downloaded grails 2.4.3 and created a test application, but it fails when trying to run the application.
Anybody knows why its going wrong here?
Thanks
C:\workspace\grails_apps\testApp>grails run-app
| Running Grails application
Error occurred during initialization of VM
agent library failed to init: instrument
Error opening zip file or JAR manifest missing : C:\Program%20Files%20(x86)\Grails\grails-2.4.3\lib\org.springframework\springloaded\jars\springloaded-1.2.0.RELEASE.jar
| Error Forked Grails VM exited with error
C:\workspace\grails_apps\testApp>
For anyone interested,
this problem was solved by moving the grails installation from
C:\Program Files (x86)\Grails\grails-2.4.3
to
C:\Grails\grails-2.4.3
eg. by removing the spaces in the GRAILS_HOME path as explained in the post found here.
Note, it did not work to remove the spaces by setting GROOVY_HOME = C:\PROGRA~2\Grails\grails-2.4.3
Related
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'm having trouble running Grails on my PC (running Windows 7).
It's been a couple of years since I last worked with Grails, and I have a new computer. So I downloaded Grails and NetBeans and followed the instructions. (Grails: version 2.3.7, NetBeans: version 7.4.)
Everything seems to be working. Both the Java JDK and Grails work - I can run "grails" from the command prompt. And it was easy to activate the support for Grails in NetBeans.
I created a very simple "Hello world" application. It compiles fine - and I can run "grails war" to create a War file. But I can't get it to run on my PC. I get the same error using "Run" in NetBeans and when running "grails run-app" at the command prompt:
|Running Grails application
Error opening zip file or JAR manifest missing : C:\Program%20Files\Grails
\lib\org.springframework\springloaded\jars\springloaded-1.1.5.RELEASE.jar
Error occurred during initialization of VM
agent library failed to init: instrument
Error |
Forked Grails VM exited with error
And the program won't start. The jar in question isn't missing, so I can't see what's wrong. Any ideas? I'd be more than grateful for some help! :-)
/Anders from Sweden
Move your copy of grails to C:\ and try again.
There is a known problem with location with space symbol. You can see it in stacktrace:
C:\Program%20Files\...
I have developed a Grails application and have deployed it many times to Heroku without an issue. However just recently I have changed the solution to use plugins from within a folder I have called "plugins". I have then basically added the following code to the BuildConfig in order to include those plugins in the application:
grails.plugin.location.'spring-security-ui'="plugins/grails-spring-security-ui"
Now when I run the delpoy to Heroku I get the following error:
|Generating plugin.xml for inline plugin
Error |
Error executing script War: java.lang.NullPointerException: Cannot get property 'file' on null object (Use --stacktrace to see the full trace)
! Failed to build app
! Heroku push rejected, failed to compile Grails app
I think this is due to the new plugins I have added to the solution via the new method. Can anyone tell me if I am missing something or what is wrong??
Also I have tested this locally and runs fine :-S
Thanks
EDIT 1......
I have tried to build the WAR file locally i got the following:
Building WAR file.....
| Error Exception occurred trigger event [CreateWarStart]: /home/admin/workspace/APP_NAME/grails-app/migrations does not exist. (Use --stacktrace to see the full trace)
| Done creating WAR target/APP_NAME-0.1.war
Try grails war locally to see if you can reproduce the problem.
This might possibly be related to GRAILS-9006 which was fixed in 2.0.4.
From trying multiple different things I have found that Heroku is rubbish at handling local plugins within Grails. So I moved over to Jelastic and runs like a dream :-)
Thanks for the help!!
I get a strange error when I add a new property to message.properties file in my grails application during runtime. When I restart the application via the command line, or restart STS, this error disappears. I am on version 2.0.1 and until a week ago, I was able to add new properties to message.properties file during runtime. Here is the stacktrace of the error
| Error 2012-06-18 16:54:58,702 [Thread-38] ERROR plugins.AbstractGrailsPluginManager - Plugin [i18n:2.0.1] could not reload changes to file [/home/project/grails-app/i18n/messages.properties]: Error starting Sun's native2ascii:
Message: Error starting Sun's native2ascii:
Any ideas?
cd to jdk path
cp lib/tools.jar jre/lib/ext/tools.jar
It solves the issue.
Note: to get correct jdk path,
check GGTS --> Windows --> Preferences --> Java --> Installed JREs --> JREs Home Path
You should be using JDK rather than JRE.
Also, if you don't need the native2ascii (which you probably don't), in BuildConfig.groovy use: grails.enable.native2ascii = false
Very frustrating bug.
After I executed all the steps suggested above in this thread, grails app was STILL not seeing tools.jar...
GRRR!
For anyone experiencing this problem in GGTS when pointing to the 1.7 jdk (when setting the jre) persisting afterwards, you MUST do the following:
Pick the correct jdk (1.7) in the "JRE Definition" panel within "Installed JRE's" in the GGTS Preferences panels.
Watch the jars from that jdk populate in the JRE definition window panel at the bottom "JRE System Libraries".
Check for tools.jar (mine DID NOT show up as recognized within the jdk lib or, after i tried 'zawmn83's post above) in /lib/ext.
If tools.jar does not show up as recognized in the jdk, click the "Add External JARs..." button, find it, add it.
That completely solve my problem - THANK GOD!!!!
p.s. i also had to set my JAVA_HOME to my 1.7 jdk correctly, in my .bash_profile but, that's already called out here as part of the solution.
Thanks everyone for contributing on this one - this bug has been causing me brain damage whilst tinkering with it today, and the above suggestions got me 99% of the way there!
I had a similar problem, in the end I
Removed the Debug Config for the Project
Deleted the project (but NOT the files)
Removed the .settings directory
Removed the .classpath and .project files from the project
Created a New General Project with the same name in the workspace
Recreated the Debug -> Run as Run-App
Hope this helps
This happened to me when I installed java 8 in parallel with java 7 on Ubuntu but didn't properly configure it with update-alternatives. Specifically, JAVA_HOME was not set properly.
I had a similar error when compiling Grails 2 from the command line under linux.
Error packaging application: Error occurred processing message bundles: Error starting Sun's native2ascii:
...
Caused by: : Error starting Sun's native2ascii:
...
Caused by: java.lang.ClassNotFoundException: sun.tools.native2ascii.Main`
I solved it by setting JAVA_HOME to JDK as mentioned above, something like
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.161.x86_64
and not:
JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
also include $JAVA_HOME/bin in the PATH variable
On linux, running grails war command, it solves the issue
cp /usr/lib/jvm/java-1.8.0-openjdk/lib/tools.jar /usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext/
When I type grails run-app to run grails application the cmd gives me this error
C:\Users\Mamun\Desktop\web\racetrack>grails run-app
Error opening zip file or JAR manifest missing : C:/Program
Error occurred during initialization of VM
agent library failed to init: instrument
C:\Users\Mamun\Desktop\web\racetrack>grails -version
Grails version: 2.0.4
But my grails working perfectly.Need help
Found this while doing a search of grails issues on GitHub. Maybe it can help you.