I have a problem in production when I generate pdf through renderPdf. Sporadically when it will render the error in some MAP property that I send to the GSP, for example:
Caused by: java.lang.NullPointerException: Cannot get property 'diario' on null object
However, when you try again with the same data, the pdf is successfully generated. I use the Grails version 3.3.2.
I increased the RAM memory in the Grails configuration and decreased the occurrence of this error.
export GRAILS_OPTS="-XX:PermSize=2048m -XX:MaxPermSize=2048m -Xms2048m -Xmx2048m"
Related
I tried to import my data from Neo4j into Gephi but it doesn't work.
I have the following result in Neo4j :
Failed to invoke procedure apoc.gephi.add: Caused by: com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 start byte 0xfb at [Source: (apoc.export.util.CountingInputStream); line: 1, column: 136]
As previously mentioned, it looks like neo4j is not exporting using UTF-8, so that, I would check how neo4j is generating the output.
Another possibility is that, when neo4j writing the output, something went slightly wrong.
I got this very same problem in the past when concurrently managing content in a file.
A thread crashed and closed "not correctly enough" the file. I mean, when reviewing the file, everything looks pretty normal, but some characters have been introduced which are not UTF-8. A tool like Atom can help you.
Best
I deployed a Grails 3.2.0 WAR on Tomcat 8.5.6 and JDK 1.8.0_91 with a simple controller having following code:
package com.test
class MailController {
static responseFormats = ['json']
def index() {
Map headers = (request.headerNames as List).collectEntries { // It fails on this line
return [(it): request.getHeader(it)]
}
println "Incoming email $headers"
render status: 200
}
}
This code fails with the following exception:
Caused by: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at groovy.util.ProxyGenerator.instantiateDelegateWithBaseClass(ProxyGenerator.java:225)
at groovy.util.ProxyGenerator.instantiateDelegateWithBaseClass(ProxyGenerator.java:193)
at groovy.util.ProxyGenerator.instantiateDelegate(ProxyGenerator.java:185)
at groovy.util.ProxyGenerator.instantiateDelegate(ProxyGenerator.java:181)
at org.grails.web.converters.ConverterUtil.invokeOriginalAsTypeMethod(ConverterUtil.java:161)
at org.grails.web.converters.ConvertersExtension.asType(ConvertersExtension.groovy:56)
at com.test.MailController.index(MailController.groovy:7)
at org.grails.core.DefaultGrailsControllerClass$MethodHandleInvoker.invoke(DefaultGrailsControllerClass.java:222)
at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:187)
at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
... 14 common frames omitted
Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyObject
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
... 27 common frames omitted
Before building the WAR file, I've changed the embedded tomcat to provided in build.gradle and also commented the groovy-ant dependency related to grails-core#10196
I see a answer here but that didn't worked and the above code is working fine when we run via grails run-app.
Update
I shorted down the issue. It is failing on this part only request.headerNames as List
I am pretty sure the problem is with the use of "as List". Mostly because Grails will overwrite Groovy's asType implementation which makes the "as X" coercion syntax work.
Grails does this to add support for things like JSON for marshalling known Grails types to web transport formats.
Unfortunately, in doing so Grails also breaks any asType function you might have declared yourself. Or in this case Groovy itself already declared for converting an Enumeration into a List.
It's quite annoying as Grails is effectively breaking existing contracts here and forcing you to modify upstream code to allow it to run on Grails.
That or dump Grails because it doesn't play nice with perfectly valid Groovy code.
I believe replacing "as List" with .asType(List) won't even fix the issue as you're still invoking the same code. At best you could try .collect([]) {it} instead. It may not be necessary to add the empty array as the first argument to collect.
I've enabled jdbcStore in QuartzConfig
quartz {
jdbcStore = true
autoStartup = true
}
and provided quartz.properties in grails-app/conf directory:
...
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
...
The problem is that when I run grails in local dev environment with grails rA those properties are ignored and I get an exception:
Caused by: org.quartz.JobPersistenceException: Couldn't store trigger 'RebillJobSimpleTrigger' for 'com.payment.rebill.RebillJob' job:Bad value for type long : \xaced00057.....
at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeTrigger(JobStoreSupport.java:1241)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$5.execute(JobStoreSupport.java:1147)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$40.execute(JobStoreSupport.java:3670)
at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:242)
In live environment everything works ok, however I'm unable to run the project in embedded jetty.
Elaboration:
The exception is thrown because my custom quartz.properties are ignored (Thus instead of PostgreSQLDelegate the StdJDBCDelegate is used which is unable to read BLOB from DB).
I use quartz grails plugin version 0.4.2 which contains empty grails-app/conf/quartz.properties and I think there is some class loader issue which loads this empty file instead of my own quartz.properties file.
Looking into the plugin the properties file is configured in QuartzGrailsPlugin.groovy's spring bean:
quartzScheduler(SchedulerFactoryBean) {
configLocation = "classpath:quartz.properties"
...
(There is some spring bean builder magic which converts the "classpath:quartz.properties" String to spring's Resource class, since SchedulerFactoryBean's configLocation property is of type Resource).
When I debug the initialization on line 554 of SchedulerFactoryBean the configLocation leads to empty file despite my quartz.properties are not empty.
When I manually change the quartz spring bean to read file from different location everything works:
quartzScheduler(SchedulerFactoryBean) {
configLocation = "classpath:data/quartz.properties"
...
However I can't change the quartz plugin itself. Do you have any idea how to fix this locally ?
I use grails version 2.1.2
In my mapping we are using xml files as our source.Our issue is that while trying to execute our mapping using large xml files (i.e files larger than 300 MB) we are facing an error. The error message is
'Error [Invalid Document Structure] occured while parsing :[FATAL:Error at line1,char1 ']
We have successfully executed our mapping with smaller files(size < 300 MB).
Is there any setting which can be changed to process such large files.If not, is there any workaround that can be done?
I've been trying to upsert and delete some data at objects in salesforce cloud using Data Loader 25.0.2. Data Loader executes without problems, but the insertions/deletions don't get done. The log file returns some lines with this errors:
2012-10-03 17:13:16,958 ERROR [deleteAccount]
client.PartnerClient processResult (PartnerClient.java:432) - Errors
were found on item0 2012-10-03 17:13:16,958 ERROR
[deleteAccount] client.PartnerClient processResult
(PartnerClient.java:434) - Error code is:INVALID_ID_FIELD 2012-10-03
17:13:16,958 ERROR [deleteAccount] client.PartnerClient
processResult (PartnerClient.java:435) - Error message:invalid record
id
I've checked that the object ids match, so there are not obvious differences between the data at the cloud and the csv being used to the deletion command.
What could be happening?
I finally found that the codification of the .csv file I've uploaded differed from the codification used for internal representation in salesforce for the data of that object. For example: My .csv file was codified on ANSI instead of UTF-8. This detail got salesforce into confussion. So I had only to change the file's codification to UTF-8 and everything got solved.