bauna / drools-gorm

It provides persistent storage for Drools and jBPM 5 using Grails GORM
http://grails.org/plugin/drools-gorm
Apache License 2.0
11 stars 12 forks source link

Getting an error running drools-gorm on grails 2.1.0 #4

Open gdeudney opened 12 years ago

gdeudney commented 12 years ago

I have tried to run drools-gorm example and plugin validation tests and get the same error on 2.1.0 of grails. Note that I had to exclude hibernate-annotations to get the app to run. Any idea why this would be happening? The tests all successfully pass in 1.3.9 not sure why this is failing.

Full stacktrace

Around line 60 of grails-app\domain\org\drools\gorm\session\SessionInfoDomain.groovy 57:
58: def beforeInsert() { 59: this.lastModificationDate = new Date() 60: Set updates = env.get(GORM_UPDATE_SET); 61: updates.add(this) 62: } 63:
Around line 86 of grails-app\services\org\drools\gorm\GormDomainService.groovy 83:
84: // common -------------------------- 85: def saveDomain(domainObject) { 86: if(!domainObject.save(flush: true)) { 87: throw new IllegalArgumentException("Object of '${domainObject.class.simpleName}' couldn't be saved because of validation errors: "+ domainObject.errors.toString()) 88: }
89: } Around line 122 of SingleSessionCommandService.java 119: try { 120: registerRollbackSync(); 121:
122: GrailsIntegration.getGormDomainService().saveDomain(this.sessionInfo); 123: updateBlobs(false); 124: txManager.commit(status); 125: } catch ( Exception t1 ) { Around line 123 of KnowledgeStoreServiceImpl.java 120: Constructor< ? extends CommandExecutor> constructor = serviceClass.getConstructor( KnowledgeBase.class, 121: KnowledgeSessionConfiguration.class, 122: Environment.class ); 123: return constructor.newInstance( kbase, 124: conf, 125: env ); 126: } catch ( SecurityException e ) { Around line 63 of KnowledgeStoreServiceImpl.java 60: throw new IllegalArgumentException( "Environment cannot be null" ); 61: } 62: 63: return new CommandBasedStatefulKnowledgeSession( (CommandService) buildCommanService( kbase, 64: mergeConfig( configuration ), 65: environment ) ); 66: } Around line 86 of grails-app\services\com\transatron\jbpm\JbpmService.groovy 83: def kb = createKbase() 84: def gormSessConfig = getGORMSessionConfig() 85: if(kb != null && gormSessConfig != null){ 86: StatefulKnowledgeSession ksession = kstore.newStatefulKnowledgeSession(kb, gormSessConfig, env) 87:
88: ProcessInstance pi = ksession.startProcess(processId) 89:
Around line 9 of grails-app\controllers\com\transatron\bp\CallJBPMController.groovy 6:
7: def jbpmService 8: def index() { 9: jbpmService.startProcess('com.bauna.droolsjbpm.gorm.hello') 10: render text: "Kbase", contentType: "text/plain" 11: 12: }

and the trace

Trace Line | Method ->> 60 | beforeInsert in SessionInfoDomain.groovy


| 46 | onApplicationEvent in org.grails.datastore.mapping.engine.event.AbstractPersistenceEventListener | 86 | saveDomain . . . . . . . . in GormDomainService.groovy | 122 | in SingleSessionCommandService.java | 123 | buildCommanService . . . . in KnowledgeStoreServiceImpl.java | 63 | newStatefulKnowledgeSession in '' | 86 | startProcess . . . . . . . in JbpmService.groovy | 9 | index in CallJBPMController.groovy | 886 | runTask . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run in '' ^ 662 | run . . . . . . . . . . . . in java.lang.Thread

himanshumodi commented 11 years ago

Hi Gmonkey,

Thanks for your post. I upgraded this plugin to 2.2.1. While testing it with "grails test-app" I get below exception same like yours. Could you please let me know what you did to resolve it.

Cannot invoke method get() on null object. Stacktrace follows: Message: Cannot invoke method get() on null object Line | Method ->> 60 | beforeInsert in org.drools.gorm.session.SessionInfoDomain


| 46 | onApplicationEvent in org.grails.datastore.mapping.engine.event.AbstractPersistenceEventListener | 86 | saveDomain . . . . . . . . in org.drools.gorm.GormDomainService | 122 | in org.drools.gorm.session.SingleSessionCommandService | 123 | buildCommanService . . . . in org.drools.gorm.impl.KnowledgeStoreServiceImpl | 63 | newStatefulKnowledgeSession in '' | 80 | startProcess . . . . . . . in drools.gorm.example.JbpmService | 8 | index in drools.gorm221.TestController | 195 | doFilter . . . . . . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter | 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter | 1145 | runWorker . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor | 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker

Thanks in advance. Himanshu