Error loading UrlMappingsPlugin in Grails - grails

When creating a basic grails plugin and compiling with Maven, I get this error message:
Error loading plugin manager: Could not create a new instance of class
[org.codehaus.groovy.grails.plugins.web.mapping.UrlMappingsGrailsPlugin]!
(Use --stacktrace to see the full trace)
Grails version 2.4.3

The solution to this issue is to add the tomcat plugin (no idea why):
Add this to BuildConfig.groovy:
build ":tomcat:7.0.55"
Then you may need to regenerate the pom.xml file using grails create-pom.
This appears to be related to this bug.

Related

"No builders" error GrailsClasspath when running grails run-app

When running grails run-app I get the following error:
| Error Error initializing classpath: No builders are available to build a model of type 'org.grails.gradle.plugin.model.GrailsClasspath'. (Use --stacktrace to see the full trace)
Any ideas anyone?
This is logged as an unresolved issue presently: https://jira.grails.org/browse/GRAILS-12079
I'm seeing this same issue with both grails 3.0.11 and 3.1.1. I was able to get around it for my project by installing grails 2.4.5 then executing grails set-grails-version 2.4.5.
Just had the problem where i took an existing grails project. That grails project was specified as 3.0 but actually contained many references to 2.5 in the build.gradle
Had To make changes to the gradle configuration to make it run.
To get you on track: create a new app somewhere and compare the gradle configuration between the 2

Error installing Grails plugin to local maven repository

I have created a Grails plugin using Grails 2.3.3 and trying to use the plugin in a Grails application which was also created using Grails 2.3.3. Now, to use the plugin in the application, it needs to be published to a plugin repository first. So I attempted to publish the plugin into the local repository by using the commands:
grails clean
grails compile
grails maven-install
For the grails maven-install command I selected the option 2)InstallPlugin. But then got an error:
Error installing plugin: No such property: ERROR_MESSAGE for class: Inst
allPlugin (Use --stacktrace to see the full trace)
Ran the last command above with option --stacktrace and --verbose but did not get any clue as to what the problem might be. I also removed %HOME%/.grails directory and reran the above commands and still came with the same error.
After googling, I found a JIRA for this issue which was closed stating that it happens when Grails version is changed and cleaning up cache files will get rid of this issue. However, that solution is not working for me and, by now, I have spent couple of hours trying to fix this. Also I did not change my Grails version.
Has anyone faced this issue with Grails 2.3.3 or with any recent version of Grails? What was the solution?
Don't use install-plugin, add a dependency in BuildConfig.groovy.
I don't know where the 2)InstallPlugin "option" is coming from. The maven-install script packages your plugin and generates a POM file and the other files needed to be a valid published plugins. Then it copies these files to your local M2 directory, e.g. if your plugin name is "mycoolplugin" the files are copied to $HOME/.m2/repository/org/grails/plugins/mycoolplugin
Now you can "install" the plugin as if it had been published in a remote repo. Add a dependency in the app's BuildConfig.groovy using the usual format, e.g.
plugins {
build ":tomcat:7.0.50"
compile ":scaffolding:2.0.1"
runtime ":hibernate:3.6.10.7"
...
compile ":mycoolplugin:0.1"
}

error while running grails command line

in my grails 2.3.4 application (after upgrading from grails 2.2.3) , when I run the grails command line grails install-plugin pluginname I get the below error , even I tried grails list-plugins I'm getting the same error:
Error Resolve error obtaining dependencies: Failed to resolve dependencies (Se log level to 'warn' in BuildConfig.groovy for more information): org.grails.plugins:tomcat:2.3.4 (Use --stacktrace to see the full trace)
i reviewed the BuildConfig.groovy there is no tomcat 2.3.4 what i'm using is 7.0.47 , here are my plugins :
runtime ":hibernate:3.6.10.6"
runtime ":jquery:1.8.3"
runtime :resources:1.1.6
build ":tomcat:7.0.47"
runtime database-migration:1.2.1
compile :cache:1.0.1
how i can solve this issue ?
you problem seems slovable due to the fact that ...you need to clean the grails project first without building it and then do
grails refresh-dependencies
and then finally
grails clean
and
grails compile
When you run refresh-dependencies your Grails application will try to resolve your grails plugins defined in BuildConfig.groovy file. If this doesn't work remove the plugins and do the above step until the error you have posted in the question vanished then add the correct plugin format and version with the correct precedence dependency, then make sure everything should work well.
Your dependencies are in a dependency block, but they are plugins. Put them in the plugins block of your BuildConfig.groovy file. So instead of what you have, put this:
plugins {
runtime ":hibernate:3.6.10.6"
runtime ":jquery:1.8.3"
runtime ":resources:1.1.6"
build ":tomcat:7.0.47"
runtime ":database-migration:1.2.1"
compile ":cache:1.0.1"
}
Also, this is no "dependency" block. This is a dependencies block, however. See this link for information on dependency resolution in Grails.
I need to add the following repo in buildconfig.groovy to the repositories section:
mavenRepo "https://repo.grails.org/grails/plugins"

Grails GGTS - Refresh dependencies failed

I get build errors in the GGTS Groovy error when I import a class from an external jar.
I've added a jar dependency to my Grails project using BuildConfig.groovy that is installed to my local maven repo:
grails.project.dependency.resolution = {
...
repositories {
...
mavenLocal()
}
...
}
dependencies {
runtime(group: 'groupId', name: 'nameId', version: 'versionId')
}
When I import a class from that jar, I get the error in the GGTS Groovy editor Groovy: unable to resolve class... I can run grail compile and grails run-app from either the command line or GGTS. So clearly Grails has no problem finding the jar and referencing it from my code.
Another question suggested that the user run 'Refresh dependencies (or shortcut "Alt+G, R")' but that results in an error dialog.
Refresh dependecies failed
java.lang.NullPointerException
Opening up the Error Log View shows the stacktrace:
java.lang.NullPointerException
at org.grails.ide.eclipse.core.internal.classpath.PluginDescriptorParser.handleSimpleNode(PluginDescriptorParser.java:216)
at org.grails.ide.eclipse.core.internal.classpath.PluginDescriptorParser.parse(PluginDescriptorParser.java:100)
at org.grails.ide.eclipse.core.internal.classpath.GrailsPluginParser.parse(GrailsPluginParser.java:39)
at org.grails.ide.eclipse.core.internal.plugins.PerProjectPluginCache.parseData(PerProjectPluginCache.java:110)
at org.grails.ide.eclipse.core.internal.plugins.PerProjectPluginCache.initializePluginData(PerProjectPluginCache.java:81)
at org.grails.ide.eclipse.core.internal.plugins.PerProjectPluginCache.refreshDependencyCache(PerProjectPluginCache.java:103)
at org.grails.ide.eclipse.commands.GrailsCommandUtils$1.run(GrailsCommandUtils.java:392)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2327)
at org.grails.ide.eclipse.commands.GrailsCommandUtils.refreshDependencies(GrailsCommandUtils.java:372)
at org.grails.ide.eclipse.core.internal.classpath.GrailsClasspathContainerUpdateJob.runInWorkspace(GrailsClasspathContainerUpdateJob.java:89)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
I am using:
Grails 1.3.7
GGTS 3.4.0.RELEASE-e4.3.1-linux-gtk-x86_64
How do I fix this error and be able to edit my code in GGTS without errors?
I faced a similar issue in GGTS where the project was getting compiled fine from command prompt (grails run-app) but GGTS was showing problem as "Unable to resolve class GrailsTestCase". I checked Dependency management (project right click -> Grails Tools) and it was enabled. I just disabled it and enabled it again. This resolved the issue in my case. Could be some problem with IDE.

Cannot install grails plugin Jaces-cannot resolve

Tried putting this line in the plugin section fo BuildConfig.groovy:
build ":jaces:1.7.2.2"
and also added the repo
mavenRepo "http://jaces.googlecode.com/svn/"
Getting this error:
| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails.plugins:jaces:1.7.2.2
Also getting the error if I take out the build directive and just try the install-plugin command.
using grails 2.2
Any help would be appreciated
Thanks!
The information on the grails portal is outdated. I am trying to update it. Please refer to http://jaces.org instead.
There you will find instructions for downloading the plugin binary from google code and installing to a Grails application.
I will post another message when the Grails portal page is updated.
Thanks

Resources