Open pandeybk opened 9 years ago
@pandeybk you might try my branch at https://github.com/PaulWaldo/rendering/tree/feature/upgradeDependencies I have upgraded to flying-saucer-pdf-itext5:9.0.7. That may resolve your problem.
@PaulWaldo Thank you for your response. Is it possible to mentioned dependencies in BuildConfig or I have to compile it manually and reference it later on?
On Fri, Aug 7, 2015 at 6:36 PM, Paul Waldo notifications@github.com wrote:
@pandeybk https://github.com/pandeybk you might try my branch at https://github.com/PaulWaldo/rendering/tree/feature/upgradeDependencies I have upgraded to flying-saucer-pdf-itext5:9.0.7. That may resolve your problem.
— Reply to this email directly or view it on GitHub https://github.com/gpc/rendering/issues/24#issuecomment-128692147.
Hi @pandeybk, here is what you do:
grails maven-install
to publish locallymavenLocal()
is in the repositories
closure in BuildConfig.groovy
compile ":rendering:1.0.2-SNAPSHOT"
to the plugins
section of BuildConfig.groovy
That should pull in the updated plugin for your project.
Hi @PaulWaldo,
I followed the steps, here comes new issue, when I run grails maven-install
to publish locally first of all I received following message,
| Script 'MavenInstall' not found, did you mean: 1) UninstallPlugin 2) InstallPlugin 3) InstallDependency 4) InstallJQuery 5) InstallTemplates
I made little bit modification in code, removed export = false
portion from BuildConfig.groovy as per the suggestion in stackoverflow (http://stackoverflow.com/questions/18056918/trouble-installing-using-grails-release-plugin-2-2-1).
Now I am finally receiving following compilation error.
| Error Compilation error: startup failed: /home/bkpandey/workspace/github/opensource/rendering/grails-app/controllers/RenderingController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'RenderingController'. @ line -1, column -1. /home/bkpandey/workspace/github/opensource/rendering/grails-app/controllers/RenderingController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'RenderingController'. @ line -1, column -1. 2 errors
@pandeybk, I'm wondering if it is a grails or groovy version problem. Here is my build transcript:
[~/src/grails/rendering (feature/upgradeDependencies) ] paul-> cat application.properties app.grails.version=2.3.8 app.name=grails-rendering [~/src/grails/rendering (feature/upgradeDependencies) ] paul-> gvm use grails 2.3.8 Using grails version 2.3.8 in this shell. [~/src/grails/rendering (feature/upgradeDependencies) ] paul-> groovy -version Groovy Version: 2.3.6 JVM: 1.7.0_67 Vendor: Oracle Corporation OS: Mac OS X [~/src/grails/rendering (feature/upgradeDependencies) ] | Plugin packaged grails-rendering-1.0.2-SNAPSHOT.zip | POM generated: /Users/paul/src/grails/rendering/target/pom.xml... Maven install complete.
@PaulWaldo
Thank you for pointing to right direction actually it was JDK version. I was using 1.8 and correcting it to 1.7 solve the issue.
But this branch again throwing the same initial error message. I just checked whether my application uses correct branch. Here comes excerpt of dependency-report
+--- org.grails.plugins:rendering:1.0.2-SNAPSHOT
| \--- org.xhtmlrenderer:flying-saucer-pdf-itext5:9.0.7
| \--- com.itextpdf:itextpdf:5.3.0
| \--- org.xhtmlrenderer:flying-saucer-core:9.0.7
| \--- com.lowagie:itext:2.1.0
| \--- bouncycastle:bcmail-jdk14:136
| \--- bouncycastle:bcprov-jdk14:136
@pandeybk it sounds like you are still using Java 8. What are your values for java -version
as well as environment variable JAVA_HOME
? Grails looks to JAVA_HOME
, not the PATH
, so I'll bet that is where you still have the pointer to Java 8.
Currently I am using Intellij and here is configuration, So I think this is not related to JAVA_HOME
and PATH
variable.
/usr/lib/jvm/java-7-openjdk-amd64/bin/java -Dgrails.home=/opt/grails/grails-2.5.0 -Dbase.dir=/home/bkpandey/workspace/wheeloflife -Dtools.jar=/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar -Dgroovy.starter.conf=/opt/grails/grails-2.5.0/conf/groovy-starter.conf -Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m -javaagent:/opt/grails/grails-2.5.0/lib/org.springframework/springloaded/jars/springloaded-1.2.3.RELEASE.jar -noverify -Dspringloaded=profile=grails -Dfile.encoding=UTF-8 -classpath /opt/grails/grails-2.5.0/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.4.3.jar:/opt/grails/grails-2.5.0/dist/grails-bootstrap-2.5.0.jar org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf /opt/grails/grails-2.5.0/conf/groovy-starter.conf "run-app -plain-output"
@pandeybk I'm not an Intellij user, so I'm scratching my head there :-) I do know that grails will use the value of JAVA_HOME when it does its magic. See http://grails.github.io/grails-doc/2.5.0/guide/gettingStarted.html. I was able to recreate your problem on the command line just by switching my JAVA_HOME to Java 8. I assume you are using Linux: can you show me the output of
echo $JAVA_HOME
from the command line? It will look something like this:
[~/src/grails/rendering (feature/upgradeDependencies) ] paul-> echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
@PaulWaldo
Ok, now I running application through command line only. Here is my echo $JAVA_HOME
output.
/usr/lib/jvm/jdk1.7.0_79
Still no progress and same error output.
Also if you look at my first post, I mentioned that the same code base works with grails version 2.2.4. Problem is only identified in 2.5.0 only. So I pretty sure this is not related to JAVA_HOME related.
| Error 2015-08-11 11:08:30,578 [http-bio-8080-exec-4] ERROR errors.GrailsExceptionResolver - NullPointerException occurred when processing request: [GET] /wheeloflife/wheel/download
Stacktrace follows:
Message: null
Line | Method
->> 1281 | getPublicDeclaredMethods in java.beans.Introspector
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1141 | getTargetMethodInfo in ''
| 416 | getBeanInfo . . . . . . in ''
| 163 | getBeanInfo in ''
| 31 | init . . . . . . . . . . in grails.plugin.rendering.document.RenderEnvironment
| 68 | with in ''
| 60 | with . . . . . . . . . . in ''
| 65 | generateXhtml in grails.plugin.rendering.document.XhtmlDocumentService
| 35 | createDocument . . . . . in ''
| 36 | render in grails.plugin.rendering.RenderingService
| 35 | render . . . . . . . . . in ''
| 65 | render in ''
| 59 | doCall . . . . . . . . . in RenderingGrailsPlugin$_closure3
| 90 | download in com.codeharmony.wheeloflife.WheelController
| 198 | doFilter . . . . . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 53 | doFilter . . . . . . . . in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 1145 | runWorker . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . . . . . . . . in java.lang.Thread
I'm sorry @pandeybk, I misunderstood. I'm not familiar with the guts of the plugin to be of much help. One thing you can try is setting debug mode for the plugin
debug 'grails.app.services.grails.plugin.rendering'
I found this to be helpful in seeing the XHTML from the GSP. You can then copy that XHTML into one of the many web validators to see if it is well-formed.
@PaulWaldo thank you for the support and effort. I will let you know if I found any solution. Currently I implemented pdfbox as my PDF generation service.
Thank you again.
I have the same problem on Grails 2.5.1 and Rendering 1.0.0. Exact same code on Grails 2.3.11 worked fine.
This is what i used in my Grails 2.4.3 app. BuildConfig:
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
excludes 'commons-io', 'core-renderer', 'itext', 'org.grails:grails-docs'
}
// more config...
dependencies {
compile 'org.xhtmlrenderer:flying-saucer-core:9.0.7'
compile 'org.xhtmlrenderer:flying-saucer-pdf:9.0.7'
compile 'com.lowagie:itext:2.1.7'
// more config...
I tried your config settings and still get the same issue.
Found the solution to getting it to work on Grails 2.5.1, just add this dependency in your buildConfig: dependencies { runtime 'org.springframework:spring-test:4.1.6.RELEASE' }
Thanks @zaccak that works :+1:
I am trying to render html file to pdf using rendering plugin, my controller method is,
And my _download.gsp file is,
I have added following dependencies in BuildConfig.groovy file
I received following stack-trace,
Note Update: The same code base works with grails version 2.2.4, problem only seen in grails version 2.5.0