-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.x branch - error if hibernate is also configured to use ehcache. Invalid character ':' in value part of property #41
Comments
I'm not sure of the proper groovy/grails idiom for checking to see if config properties exist, but maybe something like:
allowing the code in GrailsEhCacheManagerFactoryBean to set the default name. |
What's the solution to prevent this error? I am also getting this error. I am using Hibernate 4.3.8.1 with cache-ehcache 1.0.5? |
I added the following to my Config.groovy file.
// optionally add a guid or timestamp here.
// this cacheManagerName field is MANDATORY because of a bug in the ehcache
plugin.
// without it, the name gets set to [:], which is an invalid name.
grails.cache.ehcache.cacheManagerName = 'default_grails_cache'
…On Wed, Nov 24, 2021 at 4:05 PM Kouassi Axel Geoffroy KOUASSI < ***@***.***> wrote:
What's the solution to prevent this error? I am also getting this error.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALQJ6U7H6XQL5CFVFDZ2HDUNVOUDANCNFSM4IJFY6VQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Thank you very much @tircnf , it fixed that error. I am just curious about how you created/implemented your cache creation. Did you create a utility method to create the cache(s) or did you use configuration inside ehcache.xml or somewhere else? Somehow upgrading from Grails 2.2.0 to Grails 2.4.5, I don't see inside the console that cache(s) are being created locally on the local drive like the old Grails 2.2.0 And of course that leads to errors at runtime like:
|
Most of our caches are pretty small compared to our memory size, so we don't enable the file system cache and just cache in ram. we moved our config form ehcache.xml to Config.groovy with something like this:
I'm glad you were able to find this issue, but maybe more people could benefit if it was on stackoverflow. |
@tircnf Ok thank you very much. I was able to fix it. I had to use the same old custom cache-ehcache as well as a grails cache dependency with a specific version and change and try a lot of different dependencies till it works. The project implemented the caches as services and didn't use the ehcache.xml configuration. Thank you very much. |
A lot of ifs here.
If you are stuck using grails 2.5.6 and hibernate 3.
and if you configure your dataSource to use ehcache
and if you have installed cache-ehcache
You get the following error trying to start an application.
javax.management.MalformedObjectNameException: Invalid character ':' in value part of property
It is caused by code added in 2014 that allows setting a cacheManagerName.
CacheEhcacheGrailsPlugin.groovy
the ?. notation doesn't work well with these config objects, and the name is always set to
[:]
which ends up being illegal somewhere else way down the stack.
javax.management.MalformedObjectNameException: Invalid character ':' in value part of property
I think the code was added based on this blog post:
https://technology.first8.nl/fix-cachemanager-with-same-name-grails-cache-ehcache/
The problem is now that
cacheManagerName
becomes a REQUIRED property to be set in the config object.Hopefully no one else in the world is stuck on grails 2.5.6 with hibernate 3 (because of compass), but if they are, maybe a google search will end up here.
The text was updated successfully, but these errors were encountered: