Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: 1.2-M4
-
Fix Version/s: None
-
Component/s: Persistence
-
Labels:None
Description
Modifying GORMSessionFactoryDefinitionParser.java by
adding the following to private ClassPathBeanDefinitionScanner configureScanner does not due the trick.
// support for JPA Entity class scanner.addIncludeFilter(new AnnotationTypeFilter(javax.persistence.Entity.class));
I get the following exception when trying to add the com.grailstest.Animal @Entity class:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.grailstest.AnimalValidator': Error sett
ing property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'domainClass' threw exception; nested exception is java.lang.NullPointe
rException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1335)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1061)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:289)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:286)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:188)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:543)
Destroying 1 processes
Destroying process.. at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:730)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:387)
Destroyed 1 processes at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)
... 28 more
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'domainClass' threw exception; nested exception is java.lang.NullPointe
rException
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:104)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:60)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1332)
... 42 more
Apparently, for every JPA @Entity the appication is looking for a
{CLASS_NAME}Validator for that entity.
It would also be nice if it could support @Validateable or static constraints like a JPA Entity object supports directly in Grails.
Issue Links
- relates to
-
GRAILS-5290
Modify gorm.xsd to support optional config-location and config-class as specified in GORMSessionFactoryDefinitionParser javadoc
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Graeme Rocher
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Graeme Rocher [ graemerocher ] |
Contegix Support
made changes -
| Project Import | Thu Mar 24 21:22:24 CDT 2011 [ 1301019744151 ] |
Burt Beckwith
made changes -
| Workflow | jira [ 33510 ] | Grails [ 40536 ] |
Burt Beckwith
made changes -
| Workflow | Grails [ 40536 ] | Copy of Grails [ 47967 ] |
Burt Beckwith
made changes -
| Workflow | Copy of Grails [ 47967 ] | Grails [ 55377 ] |
Burt Beckwith
made changes -
| Workflow | Grails [ 55377 ] | Grails2 [ 62925 ] |
Peter Ledbrook
made changes -
| Link |
This issue relates to |
Burt Beckwith
made changes -
| Workflow | Grails2 [ 62925 ] | jira [ 78077 ] |
Burt Beckwith
made changes -
| Workflow | jira [ 78077 ] | Grails2 [ 86329 ] |
Peter Ledbrook
made changes -
| Last Reviewed | 01/Jan/10 |
Peter Ledbrook
made changes -
| Workflow | Grails2 [ 86329 ] | jira [ 88931 ] |
Peter Ledbrook
made changes -
| Workflow | jira [ 88931 ] | Grails2 [ 97077 ] |