I am working in grails 2.4.0 and installed excel-import 1.0.0 plugin to the project. While compiling the project it is generating an error that could not resolve the class Application Holder. Please help.
I was having the same problem. You can get the version 1.0.1 of the plugin here https://github.com/jbarmash/grails-excel-import
Or if you prefer, add this url to the repositories section in BuildConfig.groovy
mavenRepo "http://maven.ala.org.au/repository/"
I found that this repository has the latest version of the plugin (at least it compiles with grails 2.4.4, real tests are yet to be made)
Then add this two entries to the plugins section
compile ":excel-import:1.0.1"
compile ":joda-time:1.5"
Upgrade your plugin to the latest 1.0.1 version. It was made 2.4.x compatible.
Related
I am trying to upgrade my grails application from 2.0.0 to 2.5.5, running into Unresolved dependencies for groovy-all jar.
Dependency resolver in BuildConfig.groovy is set to ivy. Also, location %USERPROFILE%/.grails/ivy-cache/org.codehaus.groovy contains groovy-all.jar of version 2.4.5
Java is set to JDK7
Exact error:
org.codehaus.groovy#groovy-all;2.4.5: configuration not found in org.codehaus.groovy#groovy-all;2.4.5: 'master'. It was required from org.grails#grails-core;2.5.5 compile
BuildConfig.groovy
grails.project.dependency.resolver = "ivy"
repositories {
mavenRepo "link to company specific repo"
mavenCentral()
}
plugins {
runtime ":hibernate4:4.3.10"
runtime ":jquery:1.7.1"
runtime ":resources:1.1.5"
runtime ":bubbling:1.5.1"
runtime ":calendar:1.2.1"
runtime ":code-coverage:1.1.6"
runtime ":jsecurity:0.3"
runtime ":tomcat:7.0.42"
runtime ":webflow:1.3.7"
runtime ":webtest:1.1.5.1"
runtime ":yui:2.8.2.1"
build ":tomcat:7.0.70"
}
Please help. Let me know if any additional details needed.
After spending lot of time finding reason for this issue, I came across an issue reported in Grails version 2.5.5 (https://github.com/grails/grails-core/issues/10011) So before going to my project, tried to execute basic grails command "grails-createapp". This command also failed with error mentioned in question above.
Solution in our case was to
1. Remove Grails version 2.5.5 (if this is already installed)
2. Download/install Grails version 2.5.4
3. Run basic command grails-createapp. This runs fine and an app is created.
4. Remove Grails version 2.5.4
5. Install Grails version 2.5.5 now
6. Run command - grails createapp (this starts working now)
Strange issue :)
For upgrade to version 2.5.5 add to your BuildConfig dependencies the line
compile 'org.codehaus.groovy:groovy-all:2.4.6'
This worked for me.
I have grails rest-client-builder plugin installed in my grails application.
Earlier I had 1.0.3, but now I changed the version in BuildConfig.groovy to 2.1.1
Now I am getting this following strange message:
|Environment set to development
.................................
|Packaging Grails application
You currently already have a version of the plugin installed [rest-client-builder-1.0.3]. Do you want to upgrade to [rest-client-builder-2.1.1]? [y,n] y
y
.
|Installing zip rest-client-builder-2.1.1.zip...
...
|Installed plugin rest-client-builder-2.1.1
..............You currently already have a version of the plugin installed [rest-client-builder-2.1.1]. Do you want to downgrade to [rest-client-builder-1.0.3]? [y,n]
Now My question is why I am getting the message to downgrade to 1.0.3 in the same build?
I suspect this is linked to some strange errors (like unit test framework quitting expectedly which was not happening before the upgrade).
PS: When again putting 1.0.3 version back, I just get the message to downgrade. So I wonder whats wrong when I put the higher version.
I am not sure whether this will work for you or not but you can run grails depedency-report command and see if there is anything in there that it's needing the older version. If so upgrade that other plugin If that is not the case make sure you do not have any references in BuildConfig to 1.0.3. This is my BuildConfig:
plugins {
build(":release:3.0.1", ":rest-client-builder:2.1.1", ":tomcat:7.0.54") {
export = false
}
runtime ":console:1.5.4"
runtime ':db-reverse-engineer:0.5'
runtime ":hibernate:3.6.10.16"
compile ":scaffolding:2.0.3"
runtime ":jquery:1.11.1"
compile ":jquery-ui:1.10.4"
compile ":mail:1.0.7"
compile ":cache-headers:1.1.7"
compile ":rest-client-builder:2.1.1"
}
When I had that issue I realized i had the rest-client-builder:1.0.3 listed in the build section and in compile I had the 2.1.1. It was in front of my eyes and I would not see it.
You can also try to do a clean-all. Additionally, delete all the plugins from your .m2 folder at C:\Users\your_user\.m2\repository\org\grails\plugins\rest-client-builder
Then do a grails refresh-dependencies with just the 2.1.1 version in your BuildConfig. I am running grails version 2.3.11 For earlier than grails 2.3 you are stuck with the earlier version.
I'm going to migrate an existing Grails 2.0 plugin to 2.4.
According to the migration guide the following steps were done:
run set-grails-version 2.4.4
update to latest plugin versions (hibernate4, tomcat, release and etc)
In in Intellij I've changed plugin SDK version on 2.4.4. Now module->dependencies looks like
It looks good but when I do grails compile, I have MultipleCompilationErrorsException in SvnDeployer class of release:3.0.1 plugin with "unable to resolve" message: unable to resolve class org.apache.commons.io.FilenameUtils(it's strange, commons.io is included into grails library)
On SDK of 2.0 everything is fine, but when I change SDK version to 2.4, project can not be compiled.
From my experience, Grails upgrades are not really smooth especially between feature releases.
I recommend starting with the usual
grails clean
grails refresh-dependencies
grails compile
After that check if you still get the same kind of errors, see whether or not excluding the svn plugin helps (if you're not using it).
We are currently using grails 2.2 and are trying to upgrade to 2.4, but we have an issue.
In BuildConfig.groovy, we have a few dependencies and plugins that use latest.release.
For example: 'com.example:myplugin:latest.release'.
In grails 2.2, this would work as expected. In grails 2.4, I receive an error: Error Resolve error obtaining dependencies: Could not find artifact ...
We are using the latest version of Artifactory. The error indicates that grails is looking in the correct location, but cannot find it.
If we specify a specific version then grails finds it ok. For example: 'com.example:myplugin:12.03.01'
Has something changed with latest.release since version 2.2? Should we now specify the version numbers?
Thanks.
The latest.release syntax is Ivy specific and only worked with the Ivy resolver. Grails 2.4 uses Aether a dependency resolver which is the dependency resolution engine found in the Maven build tool. In Maven the syntax for expression the latest version is slightly different. See http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges
So to get the latest version you expression a minimum version with no upper bound. Example:
compile ":feeds:[1.6,)"
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)