Open arixmkii opened 4 years ago
I'm having the same issue on JDK8. Only when using a custom UserType (although it's throwing an exception mapping OTHER things than what I put the UserType on)
Still present with Grails 5.0.0-RC4 Gorm 7.1.0-RC4 Groovy 3.0.9 Java Temurin 17
With custom user types from hibernate-types-55
grails.gorm.default.mapping = {
'user-type'(type: com.vladmihalcea.hibernate.type.basic.ZoneIdType, class: java.time.ZoneId)
'user-type'(type: com.vladmihalcea.hibernate.type.basic.YearMonthDateType, class: java.time.YearMonth)
}
sql-server jdbc driver. Don't know if this thing matters.
Related to developmentOnly("org.springframework.boot:spring-boot-devtools")
At least in one case classes resolved in org.grails.orm.hibernate.cfg.GrailsDomainBinder#bindSubClass
are loaded from Application classloader, but all caches are filled with Restart classloader.
Don't know if this is still hibernate5 specific or grails in general if this is springboot devtools related?
anyone find a solution to this? I'm having the same issue. After debugging for days on end, I realized it's related to the mapping cache as illustrated above. So I have no idea how to proceed or even have a work around? It actually only showed up after setting up multi-tenancy with discriminator strategy
grailsVersion=5.2.5
grailsGradlePluginVersion=5.2.4
gormVersion=7.3.0
groovyVersion=3.0.11
org.gradle.daemon=true
org.gradle.parallel=true
#org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M
org.gradle.configureondemand=true
Using JDK 17.0.5
Just upgraded to grails 5.3.2 still problem persists. I've double checked all my mappings and nothing seems out of place. Initially I was importing mappings from a trait class. So when the issue started, I decided to implement them directly in all the domain class mappings with all that duplicated code for the mapping. But didn't solve the problem.
Any help?
Any solutions to this issue? I updated from 3.3 to 5.3.2 and am getting this error.
I faced this problem when I tried to use a composite id in one of my classes as shown below.
static mapping = {
id composite: ['community', 'person']
}
Finally I changed it to use String as Id type (I did not want to use Long) and this error disappeared.
static mapping = {
id generator: 'uuid'
}
Did anyone find any solution to the problem?
I've just started getting this error too on Java 11.
grailsVersion=5.3.0
grailsGradlePluginVersion=5.2.4
groovyVersion=3.0.11
gormVersion=7.3.2
springBootVersion=2.7.9
Was working fine until I added a many to many relationship between two already existing domains. But the kicker is, when I debugged it, it was falling over on the Mapping Cache (as previously noted) on a completely unrelated relationship.
What seems to be happening, when starting the embedded Tomcat in IntelliJ, when I add the many to many relationship, it spawns the Gorm binding process twice and it's the second time that fails. Remove the relationship and it only runs once and starts fine.
Tearing my hair out with this one.
Same issue here on Grails 6.2.0 on adding a datasource dynamically
Caused by: java.lang.NullPointerException: Cannot invoke "org.grails.orm.hibernate.cfg.Mapping.getBatchSize()" because "m" is null at org.grails.orm.hibernate.cfg.GrailsDomainBinder.bindSubClass(GrailsDomainBinder.java:1508) at org.grails.orm.hibernate.cfg.GrailsDomainBinder.bindSubClasses(GrailsDomainBinder.java:1467) at org.grails.orm.hibernate.cfg.GrailsDomainBinder.bindRoot(GrailsDomainBinder.java:1410) at org.grails.orm.hibernate.cfg.GrailsDomainBinder.contribute(GrailsDomainBinder.java:161) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:292) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:86) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:479) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:85) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:709) at org.grails.orm.hibernate.cfg.HibernateMappingContextConfiguration.buildSessionFactory(HibernateMappingContextConfiguration.java:287) at org.grails.orm.hibernate.connections.HibernateConnectionSourceFactory.create(HibernateConnectionSourceFactory.java:86) at org.grails.orm.hibernate.connections.AbstractHibernateConnectionSourceFactory.create(AbstractHibernateConnectionSourceFactory.java:39) at org.grails.orm.hibernate.connections.AbstractHibernateConnectionSourceFactory.create(AbstractHibernateConnectionSourceFactory.java:23) at org.grails.datastore.mapping.core.connections.AbstractConnectionSourceFactory.createRuntime(AbstractConnectionSourceFactory.java:70) at org.grails.datastore.mapping.core.connections.InMemoryConnectionSources.addConnectionSource(InMemoryConnectionSources.groovy:51) at org.grails.datastore.mapping.core.connections.AbstractConnectionSources.addConnectionSource(AbstractConnectionSources.groovy:96)
Grails 4.1.0.M2 Gorm 7.1.0.M3 Groovy 3.0.6 Java Adoptopenjdk 15
No matter what is set as target output level. Will fail with application built targeting JDK11, JDK14 or JDK15.
No problems, when running with JDK up to 14 inclusive.
I guess that JDK15 is not yet supported, but this issue can be used for tracking progress.