Grails 5 application fails to start up with an error related to spring/resources.groovy - grails

I am upgrading a grails 2.x application to Grails 5. During start up there is a ClassCastException and it just says resources cannot be cast to groovy.lang.Script. Why would this happen? Is there a solution to get around this problem?
Stack Trace:
org.grails.core.exceptions.GrailsConfigurationException: Error loading spring/resources.groovy file: resources cannot be cast to groovy.lang.Script

The issue was due to the usage of PluginAwareResourceBundleMessageSource in resource.groovy. In older versions of grails, this class was available under the package - org.codehaus.groovy.grails.context.support.PluginAwareResourceBundleMessageSource
But Grails5 has it under org.grails.spring.context.support.PluginAwareResourceBundleMessageSource

Related

Migration Error going from Struts 2.3 to 2.5

I have a legacy app and I have to update struts 2.3 to struts 2.5. I have followed the migration instructions here (https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration) but I am getting the following error in Weblogic:
org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception occurred during processing request: Cannot find definition named '/menu.tiles'
According to the migration instructions above, I only have to change the DOCTYPE in my struts.xml and tiles.xml files.
I tried the solution here (org.apache.tiles.definition.NoSuchDefinitionException: Cannot find definition named 'addCustomer.tiles') but that didn't work.
Any ideas?
All, I found this on stack overflow and it solved my issue. I am posting the answer so the next guy doesn't spend days looking for the answer.
The accepted answer from the link below solved my problem. *Note - I am working with Weblogic 12.4
Runtime exception while upgrading to struts 2.5.17

Problems upgrading to Spring Data Neo4j 4.0.0

I'm trying to upgrade a project to Spring Data Neo4j 4.0.0 and I'm facing two problems :
The "spring-data-neo4j-rest" package is missing at MvnRepository (spring-data-neo4j-rest-4.0.0.jar returns 404 error). Does the package still exist and should be there, or should I just delete the dependency from my pom.xml?
I've got the following error : The method fetch(Set<...>) is undefined for the type Neo4jOperations in all my DAOs. The method was used to initialize collections of lazily loaded nodes. How can I initialize a node's collections?
Thanks!
Did you read the migration guide that's provided for SDN 4?
http://docs.spring.io/spring-data/neo4j/docs/current/reference/html/#migration
fetch is gone and replaced by fetch-depth
SDN-rest is gone too any not needed anymore (as SDN-4 is all about remote connections).

How to resolve errors in grails application after upgrading to 2.3.6

I recently updated my grails project from 2.0.4 to 2.3.6, which is giving some errors while saving a form which contains multipart data (file attachments),
Its giving me the error for the file attachment fields like rejected value: grails.validation.ValidationException: Validation Error(s) occurred during save():
And its giving me the error in Requestmap.groovy as well, below is the error
Requestmap.url.unique.error
In version 2.0.4, its working fine without any errors.
How to resolve these issues?
Grails documentation contains tips on updating from one version to another. In your case you are making a large jump so you may have to refer to the following:
Upgrade from versions previous to 2.2
Upgrade from 2.2 to 2.3
Both issues you have are validation errors. You can see the validation errors in detail by executing:
Requestmap requestmap = new Requestmap([...])
requestmap.validate()
println requestmap.errors
You can find additional details about validation errors in the docs.

Grails upgrade from 1.3.7 to 2.0.1 -

I have upgraded my grails app from 1.3.7 to 2.0.1. I had few static (gsp but not using any controllers) pages using standard layout under "grails-app\views\" . These files were working fine prior to upgrade. But after upgrade, I get 404 error. Only index.gsp is working if I give root path ie. "http://localhost:8080/myapp/". But if I specify "http://localhost:8080/myapp/index.gsp", I get 404 error.
I assume this is something to do with grails filters in 2.0.1. But i couldn't figure it out yet. DO anyone have experienced any similar issue?
This was a security risk and directly linking to GSPs was disallowed in 2.0 - see http://jira.grails.org/browse/GRAILS-7542 and http://grails.1312388.n4.nabble.com/Direct-linking-to-gsp-in-Grails-2-0-td4228929.html for a discussion and examples of how to use URL mappings to link to GSPs.

Workaround for superclass mismatch for class SQLiteAdapter error

I'm using torquebox 2.0 beta (i.e. jruby on rails). Everything was working fine until I installed the Citier gem. Once I installed the gem, I began to get the following error:
superclass mismatch for class SQLiteAdapter
the full error is included in this gist: Full Trace of Error Message
Does anyone have any suggestions for a workaround or a fix for this error.
Thanks in advance for your help.
'citier' is assuming a certain class hierarchy for SQLiteAdapter and PostgreSQLadapter, and that is clashing with JDBC adapters'. I don't know how to fix it; it might be as simple as removing the inheritance specification from the offending line 17, but maybe not. Either way, you should contact citier's author.

Resources