mannejkumar opened a new issue, #14639:
URL: https://github.com/apache/grails-core/issues/14639
`abstract class BaseDomain {
```
static mapWith = "mongo"
transient springSecurityService
ObjectId id
def Long version
def Date createdOn
def Date updatedOn
def Long createdBy
def Long updatedBy
static constraints = {
version display:false
createdOn display:false
updatedOn display:false
createdBy display:false
updatedBy display:false
}
static mapping = {
sort updatedOn:'desc'
}
def beforeInsert = {
initDefaults()
return true
}
def beforeUpdate = {
def currentUser = springSecurityService.getCurrentUser()
updatedBy = currentUser ? currentUser.id : 0;
updatedOn = new Date();
}
def beforeValidate = {
initDefaults()
return true
}
def afterInsert = {
}
def afterUpdate = {
}
def afterDelete = {
}
def onLoad = {
}
def afterLoad = {
}
def dynamicProps = [:]
def propertyMissing(String name, value) { dynamicProps[name] = value }
def propertyMissing(String name) { dynamicProps[name] }
void initDefaults() {
def currentUser = springSecurityService?.getCurrentUser()
if (createdBy == null) {
createdBy = currentUser? currentUser.id : 0;
}
if (createdOn == null) {
createdOn = new Date();
}
if (updatedBy == null) {
updatedBy = currentUser? currentUser.id : 0;
}
if (updatedOn == null) {
updatedOn = new Date();
}
}
```
}`
This is my abstract class presented in src/groovy. if i am extending this
class in my domain class i am getting the exception when i am trying to run the
app. the same code is working with hibernate. but i am facing this issue with
mongodb plugin.
`Error |
2016-05-30 13:49:15,331 [localhost-startStop-1] ERROR
context.GrailsContextLoaderListener - Error initializing the application:
Error creating bean with name 'instanceTagLibraryApi': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
method: public void
org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup);
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'gspTagLibraryLookup': Invocation of init method
failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib':
Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.codehaus.groovy.gr
ails.web.mapping.LinkGenerator
org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsLinkGenerator': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.grails.datastore.mapping.model.MappingContext
org.codehaus.groovy.grails.web.mapping.DefaultLinkGenerator.mappingContext;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsDomainClassMappingContext': Bean
instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested exception is java.lang.NullPointerException
Message: Error creating bean with name 'instanceTagLibraryApi': Injection of
autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
method: public void
org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup);
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'gspTagLibraryLookup': Invocation of init method
failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib':
Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator
org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator;
nested exc
eption is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'grailsLinkGenerator': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.grails.datastore.mapping.model.MappingContext
org.codehaus.groovy.grails.web.mapping.DefaultLinkGenerator.mappingContext;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsDomainClassMappingContext': Bean
instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested exception is java.lang.NullPointerException
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
---
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Could not autowire method: public void
org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup);
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'gspTagLibraryLookup': Invocation of init method
failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib':
Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator
org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsLinkGenerator': Injection of autowired
dependenc
ies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.grails.datastore.mapping.model.MappingContext
org.codehaus.groovy.grails.web.mapping.DefaultLinkGenerator.mappingContext;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsDomainClassMappingContext': Bean
instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested exception is java.lang.NullPointerException
->> 262 | run in java.util.concurrent.FutureTask
---
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name
'gspTagLibraryLookup': Invocation of init method failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib':
Injection of autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator
org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsLinkGenerator': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.grails.datastore.mapping.model.MappingContext
org.codehaus.groovy.grails.web.mapping.DefaultLinkGenerator.mappingContext; nes
ted exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsDomainClassMappingContext': Bean
instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested exception is java.lang.NullPointerException
->> 262 | run in java.util.concurrent.FutureTask
---
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name
'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of
autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator
org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsLinkGenerator': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.grails.datastore.mapping.model.MappingContext
org.codehaus.groovy.grails.web.mapping.DefaultLinkGenerator.mappingContext;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsDomainClassMappingContext': Bean
instantiation via co
nstructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested exception is java.lang.NullPointerException
->> 262 | run in java.util.concurrent.FutureTask
---
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Could not autowire field: private
org.codehaus.groovy.grails.web.mapping.LinkGenerator
org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsLinkGenerator': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.grails.datastore.mapping.model.MappingContext
org.codehaus.groovy.grails.web.mapping.DefaultLinkGenerator.mappingContext;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsDomainClassMappingContext': Bean
instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested
exception is java.lang.NullPointerException
->> 262 | run in java.util.concurrent.FutureTask
---
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name
'grailsLinkGenerator': Injection of autowired dependencies failed; nested
exception is org.springframework.beans.factory.BeanCreationException: Could not
autowire field: private org.grails.datastore.mapping.model.MappingContext
org.codehaus.groovy.grails.web.mapping.DefaultLinkGenerator.mappingContext;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsDomainClassMappingContext': Bean
instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested exception is java.lang.NullPointerException
->> 262 | run in java.util.concurrent.FutureTask
---
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Could not autowire field: private
org.grails.datastore.mapping.model.MappingContext
org.codehaus.groovy.grails.web.mapping.DefaultLinkGenerator.mappingContext;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsDomainClassMappingContext': Bean
instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested exception is java.lang.NullPointerException
->> 262 | run in java.util.concurrent.FutureTask
---
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name
'grailsDomainClassMappingContext': Bean instantiation via constructor failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested exception is java.lang.NullPointerException
->> 262 | run in java.util.concurrent.FutureTask
---
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanInstantiationException: Failed to instantiate
[org.codehaus.groovy.grails.domain.GrailsDomainClassMappingContext]:
Constructor threw exception; nested exception is java.lang.NullPointerException
->> 262 | run in java.util.concurrent.FutureTask
---
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by NullPointerException: null
->> 333 | hash in java.util.concurrent.ConcurrentHashMap
---
| 988 | get in ''
| 280 | initializePersistentEntity in
org.grails.datastore.mapping.model.AbstractMappingContext
| 232 | addPersistentEntityInternal in ''
| 216 | addPersistentEntity in ''
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
Error |
Forked Grails VM exited with error
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]