Grails Rendering Plugin error when trying to render PDF? - grails

When using the Grails Rendering plugin i am getting an error java.lang.NoSuchMethodError: com.lowagie.text.pdf.BaseFont.getCharBBox[C] . We are also using the Jasper Plugin which uses a new version of the iText library. I guess there is a mismatch between the 2 plugins..
Any idea how to fix this?
/Marco

Your probably right there with the assumption there are two versions of iText. I have had lots of fun with iText conflicts in the past. I don't use the Jasper Plugin so I can't give you the direct answer, but I can recommend a couple of things to try:
Use the command grails dependency report to see what exactly is going on, which version of iText is kept, and which is being kicked out.
In your build config you can manage the dependencies of a particular plugin. So might be able to get away with removing the Jasper Plugin dependency on itext. Here is an example from mine for the export plugin:
runtime(':export:1.1') {
excludes 'itext', 'itext-rtf'
}

Related

custom codec not found in plugin

I have a grails application with multiple internally developed plugins. Since upgrading from 4.x to 5.2.3, codecs are not found in one plugin, but are found in others. Specifically, I can place the same file (UsernameListCodec.groovy, package name changed from one plugin to the next but otherwise no changes) in grails-app/utils in one plugin and it works; when placed in grails-app/utils in another plugin it fails with MissingMethodException.
What could cause this? The plugins are fairly different in terms of what they provide, but very similar in terms of how they're built, published, etc. Clearly this is something I'm doing wrong (since the codec works in another plugin) but I don't even know where to begin looking. Does a plugin need to do something in particular to be able to provide custom codecs as of grails 5?

Grails 3.3: Could not find com.novadge.plugins:grails-twilio:0.1.4

I trying to install the plugin grails-twilio from grails plugin portal but I receive the following message:
| Error Error initializing classpath: Could not find com.novadge.plugins:grails-twilio:0.1.4.
Any advice on installing this plugin?
The dependencies I put from is:
dependencies {
compile 'com.novadge.plugins:grails-twilio:0.1.4'
}
Please check with plugin repo. Version 0.1.4 is not available in the plugins repository.
Check with following code:
dependencies {
compile 'com.novadge.plugins:grails-twilio:0.1.0'
}
Refer plugin page and github for additional configuration
Hope this will you.
I would go to the issues section on the plug-in page, and raise this same issue, linking back to this stack overflow page, including a full stack trace, and maybe a link to a sample app, demonstrating the issue.
In my experience I've found that while, a core set of plug-ins are very good, others can be hit or miss. Sometimes I look at a plug-in, as just a good starting point, and dive into the code. For Twilio in the past I've implemented it's use with just it's library, and it wasn't difficult at all.

cannot find symbol in grails quartz 2 - grails asynchronous mail plugin?

Compilation problem while starting the project
java\grails\plugin\quartz2\GrailsJobFactory.java:49: cannot find symbol
symbol : method newJob(org.quartz.spi.TriggerFiredBundle,org.quartz.Scheduler)
location: class org.quartz.simpl.PropertySettingJobFactory
return super.newJob(bundle,scheduler);
What could be the problem?
The problem is that the async mail plugin requires the Quartz2 plugin, whereas the quartz monitor plugin requires Quartz (one).
You didn't say that you had installed the quartz monitor, but I suspect you did, or some other plugin that requires quartz (one).
What I did was rolled back to 0.4 of the async mail plugin, which uses Quartz (one), and that solved the problem for me.
Just download Quartz 2 Jar file and place it in "Lib" folder which will fix this compilation issue

grails 2.0 - installing resources plugin gives version 1.1.3, not version 1.1.6 [ ** Don't use install-plugin **]

Grails 2.0 projects currently come with resources plugin 1.1.5, which appears to have several dependency problems (e.g. see answer for this post). I'm using IntelliJ, and while I updated BuildConfig.groovy to
runtime ":resources 1.1.6"
which appears to cause IntelliJ to bring in new files, it doesn't update the plugins section (it still shows the old 1.1.5).
So then I did an uninstall-plugin-in resources, which got rid of the plugin in the Grails view. I then did install-plugin resources, and even though the resources plugin website shows it is at 1.1.6, I got a resources-1.1.3 plugin.
How is this possible? That's several versions back now. Additionally the website says it was updated 3 weeks ago to version 1.1.6.
Should one ever even use install-plugin? Can someone please tell me the preferred way to bring plugins into projects?
Thanks.
P.S. Not clear how to download this plugin.
The format for the dependency resolution DSL is group:name:version.
For the resources plugin it should be runtime ":resources:1.1.6"
The install-plugin command has been unofficially deprecated in favor of the dependency resolution DSL.
BUT, here's the first reference to install-plugin in the latest Grails 2.0 documentation:
"Grails supports Rails-style migrations via the Database Migration plugin which can be installed by running
grails install-plugin database-migration
IT WOULD APPEAR GRAILS 2.0 NEEDS TO HAVE AN OVERVIEW SECTION IN CHAPTER 3 -- JUST A FEW WORDS --, EXPLAINING THE DEPARTURE FROM USING INSTALL-PLUGIN, vs CREATING CONFUSION, AND NOT EVEN DOCUMENTING refresh-dependences anywhere in the main Grails 2.0 document if one searches for the term.
Otherwise I think developers like myself spend lots of time doing just the opposite of the main goal of what Grails is, wasting hours configuring things and getting them to run together, realizing the exact opposite of the Grail's goal: "the search is over", easy/fast application development.

Grails Auto-format Line wrap

I was trying to using Crtl+shift+F to format a groovy class in springsource suite tool. However, it doesn't split lines that are very long (more than 80 characters) as it does with java files.
I would appreciate if anybody could recommend me a tool for perform wrapping of lines in groovy files and generally grails projects.
Thanks in advance.
IntelliJ does a very nice job of formatting Groovy code. The free version of IntelliJ includes Groovy support, but not Grails support (last time I checked)
What version of STS are you using? We have recently fixed a few issues regarding formatting of Groovy code in the latest release of Groovy-Eclipse (2.1.1). The update site is here:
http://dist.springsource.org/release/GRECLIPSE/e3.6/
This should solve your problem, but if it doesn't, then I'd suggest raising a bug on the issue tracker:
http://jira.codehaus.org/browse/GRECLIPSE

Resources