Build Error when building blank Grails Project in GGTS - grails

I have freshly downloaded GGTS 3.5.1 and pointed it to grails-2.4.0 and jdk_1.8.0_05 but I can't build just a blank grails project without getting build errors.
The exact error is.
Building Workspace
Errors Occurred During The Build
Errors running builder 'Java Builder' on project 'test'.
org.codehaus.groovy.runtime.DefaultGroovyMethods.count(Ljava/lang/Iterable;Lgroovy/lang/Closure;)Ljava/lang/Number;
I have tried booting using the -clean flag, downloading other versions of groovy, grails and jdk. This error even occurs exactly the same on my desktop and laptop, so I guess something I'm doing in the setup has to be wrong.

What was the Groovy compiler specified for in your GGTS? I think for Grails 2.4 you'd need Groovy 2.3 compiler set in the preferences.

Related

Unable to run my Grails app - how to fix this?

When I run my Grails project in Eclipse then the following error comes. What is the meaning of the error? How to remove this? I am using the Git to share the application on Bitbucket. Why is it showing the list of the plugins? Also when I run the app from the command prompt of the Grails then the app runs and there are no errors. Why is this?
|Loading Grails 2.5.0
|Configuring classpath
Error |
G:\programming\TE\TE_intern_grails\local directory for grails using git\arpte\arpte does not appear to be part of a Grails application.
Error |
The following commands are supported outside of a project:
add-proxy
clear-proxy
create-app
create-multi-project-build
create-plugin
help
install-app-templates
list-plugins
package-plugin
plugin-info
remove-proxy
set-proxy
|Run 'grails help' for a complete list of available scripts.Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
You could import the project as a Git project in eclipse and try to run. This has fixed my issue recently.
Otherwise
Right click on the project
Click on run
Go to Run As, then select Run Configurations
Delete the existing run configurations of the present project
Run the project now.
It will work perfectly.

Grails GGTS "Task 'assemble' not found in root project" error when running "grails war" in Command Prompt

I have been learning Groovy/Grails Tool Suite (GGTS) 3.6.4, with Grails 2.4.4 using some video tutorials. When I attempt to package the project into an application using the grails war command on the Windows command prompt, I get the following error:
"Error Gradle build terminated with error: Task 'assemble' not found in root project ..."
Any references to this error that I have found online have only involved Android Studio (for instance), so I am at a loss here as to how to fix it for GGTS.
I have Android Studio 1.0.1 installed, and in case it was affecting the Grails packaging, I tried the solution of removing the <component name="FacetManager"> from the general Android Studio "MyApplication.iml" file, but that had no effect. I couldn't find any analogous file for the GGTS.
In case the issue lies elsewhere in my overall installation, I have Java JRE 7_79 (64-bit) installed, as well as the the JDK 1.7.0_79 (64-bit)
OK. I found out what the cause of the error was, and how to avoid it in the future.
The Problem
Grails 3.0.1 requires the following files for grails war to work:
build.gradle
gradle.properties
gradlew
gradlew.bat
\gradle (directory)
Grails 2.4.4 does not require any of the above files for making a WAR file.
GGTS 3.6.4 does not work with Grails 3.0.1, but it comes with and works fine with Grails 2.4.4.
The Solution
Copying the stated Gradle files & directory to a GGTS project folder fixed the problem. However, I wasn't satisfied with needing to do this manually or with a custom batch file for every project.
Looking deeper, it turns out that when working out compatibility issues between the Java 32-bit JRE existing on my system and the Java 64-bit JRE & SDK, Grails, and GGTS versions (there was a lot of fiddling to get things working), at one point I had set up my global variable to Grails to be directed at 3.0.1, and I failed to update it to Grails 2.4.4. Making this change has fixed the issue.
Explaining the Cause
When following this video series on installing a compatible set of Java, Grails, and GGTS, the instructor manually downloaded the latest version of Grails from the Grails site and then downloaded GGTS separately from its own site. Both of these were older versions than what I was working with.
In my case it turns out that, after setting up the Java SDK & Grails, the latest version of GGTS (3.6.4) did not work properly with the latest version of Grails (3.0.1). Fortunately the GGTS bundle came with an older version of Grails (2.4.4), and by referencing that, GGTS would work correctly. However, although I changed the IDE reference to Grails, I forgot to reset my environment variable ...
So GGTS was setting up the project for using Grails 2.4.4. However, when calling grails war, the command was using Grails 3.0.1! Apparently these two versions of Grails use different files for creating a WAR file, so GGTS was not setting up the project directories with the correct local files, and the packaging was failing.
Avoiding Future Occurrences
So, when using GGTS 3.6.4, make sure that all references to Grails point to Grails 2.4.4.
In general, if any GGTS bundle contains a version of Grails, you should have everything set up to use that version, even if it is old.

Grails : Error generating web.xml file

I have upgraded my Grails project from version 2.1.2 to 2.2.3. Before the upgrade, the project worked flawlessly. However, I am not able to run the project now. I get a strange error :
| Compiling 143 source files.....
| Error Error generating web.xml file (Use --stacktrace to see the full trace)
and the compilation stops.
I thought that the "--stacktrace" option would provide some useful information. However, I am not able to decipher the error.
Error here > http://pastebin.com/zwR4YzXS
Googling / searching this problem did not help. I hope I am not the only one, who is getting this error.
Thank you for your advices !
Some useful info :
Grails 2.2.3
Java version :
java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-0ubuntu0.12.10.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
OS: Ubuntu 12.04 x64
Faced the same issue while working with grails 2.3.2. Actually, I added and then removed clojure plugin. Right after got such problem.
$ grails clean just worked for me.
Same problem i was facing i used the below command :
grails clean
grails refresh-dependencies
and that worked for me
If you are using Intellij the problem is that:
the reason for this is that IDEA adds classpath by default on creating integration test run configuration. So if you run tests you might cause that error
Open Run → Edit Configurations... (or press Alt-Shift-F10)
Select your configuration that fails
Uncheck Add --classpath checkbox
You are done! Run.

Issues with upgrade to Grails 2.2.0 using GGTS

I’m trying to upgrade Grails to version 2.2.0. I used gvm and installed Grails 2.2.0. After this I changed my project in GGTS to use Grails version 2.2.0 and Groovy version 2.0.0. But when I finally tried to run the project, I got the following error:
Error occurred during initialization of VMError opening zip file or JAR manifest
missing : null
agent library failed to init: instrument
What is the problem?
We had the same problem.
This is due to eclipse saving old run configuration for the previous grails version.
Just remove old launch configuration and retry.
To remove old launch configuration :
go to Run\RunConfiguration\Grails
select all nodes and remove them.
I had the same problem when I started using Grails 2.2.0 - The solution Ian mentioned works, here is the link to the issue and resolution that occurred in my project
Grails 2.2.0 error
Added on 1/15/2013 Other suggestions based on 2.2.0/ivy cache issues
I am running on windows, a couple of things to try.
Based on your error message seems like the issue might be related to the Ivy cached, I would suggest cleaning that out using the clean command.
I would also go ahead and delete the Icy cache folders on your machine at \ivy-cache(after backing it up just in case)
Read grails documentation at http://grails.org/doc/2.0.0/guide/gettingStarted.html, refer to section 2.3 regarding Ivy cache – there might be issues running 2.x and 1.x grails projects side by side.
When install, I do not have to install groovy explicitly - I just install grails and that take care of the groovy code implicitly. Is that possible for you to do? To rule out dependency issues?
On my version of grails I have the groovy version showing up as 2.0.5 – I assume you meant grails 2.2.0 – can you ensure that you have a groovy version installed with is compatible with grails 2.2.0?
If possible try your code on a fresh device where grails has not been installed before. This is to rule out interference due to other existing issues
It's a known issue to do with the fact that the version of the springloaded reloading agent used by 2.2 (and 2.1.3) has a different name from that used by previous versions of Grails. There's a workaround in the bug report, or you can upgrade to a nightly build of GGTS which knows about the new name (as described in this bug report).
I am using GGTS 3.2 with Groovy compiler 2.1.1 on Windows XP.
Had imported a project from GGTS 3.1, upgraded compiler to 2.1.1 and got in mess, so
deleted the project and removed it from .grails cache, then re-created project from scratch. When it came to running the project I got the ivy error.
Removing the old launch configuration via Run->RunConfiguration...Grails fixed problem without switching to a night build of GGTS.
(BTW Deleting ivy-cache didn't help at all)

Can't compile grails Tomcat plugin

I'm using Netbeans to build a Grails app, while I have used this fine before on this new computer I can not get even the basic project to compile and run. I am getting errors around compiling the Tomcat plugin. If I uninstall the plugin it and use Jetty instead it will compile but the project isn't set up for Jetty and is missing files.
Below is the error I'm getting I'm thinking it is some issue with my classpath but I just don't know where to start any help would be much appreciated.
java.lang.NoClassDefFoundError: org/apache/catalina/startup/Tomcat$ExistingStandardWrapper
Update I have tried grails clean, and used both grails 1.2.0 and 1.3.1
Update The project I've tried with tomcat is the base project generated by grails.
When you say "but the project isn't set up for Jetty and is missing files." what do you have in there that maybe clashing with Tomcat? It sounds like you must be using some specific tomcat functionality.

Resources