Jasper Report plugin in Grails 3.1.8 - grails

Generate PDF file using jasper report in Grails 3.1.8 . But when I
add dependencies some error is occurred. I can't adding any jasper report dependencies
in Grails 3.1.8. Please help me or any idea to use jasper report plugin in grails 3.1.8.I already used
(1)
compile "org.grails.plugins:jasper:1.11.0"
(2)
compile 'com.lowagie:itext:2.1.7.js2'
compile 'net.sf.jasperreports:jasperreports:6.2.1'

The plugin org.grails.plugins:jasper:1.11.0 is not grails 3 compatible. It is only up to Grails 2.x
There is a plugin for Grails 3 version here.https://grails.org/plugins.html#plugin/grails-jasper.
In other hand, you could run grails dependency-report for seeing what it is happening. It seems that there is a conflict between dependencies. But as I said, that plugin probably won't work with your project.

I was having the same issue. I fixed it by downloading the jasper report jar and kept it in a folder named lib, then showed the path in dependencies like this.
compile files('lib/jasperreports-5.5.0.jar')

Related

Changes in inplace plugin code in grails3.x are not reloading automatically

I am upgrading a project from Grails 2.5.1 to Grails 3.1.4.
My Multi-Project Build structure in Grails 3.1.4 is as follows:
- Root
|--MainProject
|--Plugin1ForMain
|--Plugin2ForMain
|--settings.gradle
I run the MainProject using grails run-app command and whenever I change my codes in Plugin1ForMain or any other plugins, the changes are not automatically recompiled like it did in Grails2.x .
How can I make my project autocompile plugin's code in grails3.x ? I am using gradle version 2.3
I also got the same issue with grails 3.1.4 and when I changed the version of Gradle and profile web plugin it started working for me. Hope it solves your problem too.
a) Use Gradle version 2.13, change the Gradle version in gradle.properties
gradleWrapperVersion=2.13
b) And change the profile plugin version to 3.1.6 in build.gradle
profile "org.grails.profiles:web-plugin:3.1.6"

Using a Grails 2.4.2 plugin as a JAR dependency in a Grails 2.2.0 project

I have a custom plugin built using Grails 2.4.2 that is to be used with multiple Grails projects as a regular JAR dependency. I have successfully exported the plugin as JAR and installed into my local Maven repository and added the corresponding dependency statements in the "dependencies" block of the BuildConfig.groovy files of the respective parent projects. e.g.:
compile 'my_package:my_custom_plugin:1.0'
One of the parent project is build using Grails 2.4.2. When I run that project with the above mentioned configuration using the command: grails run-app, it runs fine without any errors.
However, when I do the same kind of configuration in another project built using Grails 2.2.0 and run it using the command: grails run-app, it gives the following error:
Error | Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/grails/datastore/mapping/dirty/checking/DirtyCheckable (Use --stacktrace to see the full trace)
NOTE: Both these parent projects run fine when I add the same plugin as a plugin instead of as a JAR dependency using the statement like this in the BuildConfig.groovy:
grails.plugin.location."my_custom_plugin" = "../my_custom_plugin/"
Can anybody kindly guide me as to how can I resolve this issue?
Any help would be greatly appreciated.

Migrating Grails 2.4 MultipleCompilationErrorsException

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).

How to implement form builder plugin in grails

What steps will reproduce the problem?
1.create grails project on STS: 2.9.2
2.Open plugin manager, install form builder plugin.
1.Create grails project on NetBeans IDE 7.0
2.Open Grails Plugins. install form builder plugin.
1.Create grails application using command grails create-app test
2.install form builder plugin.
What is the expected output? What do you see instead?
Each time i was expecting plugin should install and i can run application, but getting several dependencies. I tried with/without changes made in BuildConfig.groovy.
What version of the product are you using? On what operating system?
I am working on
Java: 1.6.0_29; Java HotSpot(TM) Client VM 20.4-b02
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
with grails 2.0.4
I have installed STS 2.9.2, STS 2.5.1, Netbeans 7.0 with grails plugin
Please provide any additional information below.
Each time i tried to install plugin it is showing me some run-time dependencies for jquery, jquery ui and others, I tried to install all plugins before installing form builder plugin. Now it is showing me some class missing
net.sf.json-lib:json-lib:2.4.
some time it is showing me error about
C:\Documents and Settings\jitendrakarma.grails\2.0.4\projects\FormTest\plugins\form-builder-0.1\grails-app\controllers\org\grails\formbuilder\FormController.groovy: 18: unable to resolve class freemarker.template.Template
# line 18, column 1.
import freemarker.template.Template
Please let me know what is wrong with the process i am following.
You are doing everything totally right. The plugin itself does not manage its dependencies correctly. Also it is belonging to some classes that doesn't exists any more in Grails >= 2.x.x
If you add all missing external dependencies and add the following entries to the plugin closure of grails-app/conf/BuildConfig.groovy
compile ":form-builder:0.1"
compile ":jquery-ui:1.8.6"
compile ":dynamic-domain-class:0.2.1"
compile ":jquery-json:2.2"
compile ":freemarker-tags:0.5.8"
compile ":uni-form:1.5"
compile ":jquery-datatables:1.7.5"
compile ":jquery-validation-ui:1.2"
compile ":lang-selector:0.3"
compile ":quartz:0.4.2"
compile ":jquery-form-builder:0.1"
and add the following entry to the dependencies section of the same file
compile 'org.freemarker:freemarker:2.3.19'
you will still get four compile errors.
One of them is: "unable to resolve class org.codehaus.groovy.grails.web.metaclass.TagLibDynamicMethods"
If you look up this class in the grails api documentation you will see it inside the grails 1.3.7 version but it is missing in the 2.0.4 version.
So the best thing I could recommend you is to search for another plugin or doing some code by your own.
Validation for example could be done with a Command on the grails side and the JQuery Validation Plugin on the client side. The form itself can be created with the help of scaffolding. Even if you don't need a domain you could create one run scaffolding to get the resulting form and throw away the domain.

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