|
I'm trying to add a drools dependency to grails 2.0.3.
I added the dependency by adding the following to the repositories block in BuildConfig: mavenRepo "https://repository.jboss.org/nexus/content/groups/public-jboss/" and the following to the dependencies block: runtime ('org.drools:drools-distribution:5.3.0.Final') When I build the war, the appropriate drools jars seem to be there. When I try and run the application, I get the following: ... | Running Grails application | Error 2012-05-02 13:55:32,549 [pool-7-thread-1] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE Line | Method ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 138 | run in java.util.concurrent.FutureTask | 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run in '' ^ 662 | run . . in java.lang.Thread I have no idea where INSTANCE is coming from. This is a new app that was created as a grails 2.0.3 application on windows 7. I have the jbossas and dojo plugins installed. Does anyone have any ideas on how to resolve this issue? Thanks, Lloyd |
|
Hello Lloyd, I will be following the outcome of your issue.
I'm curious as to how you got the Drools plugin to install nicely under 2.0.3? My efforts to install the Drools plugin renders my 2.0.3 app useless and it will not execute at: run-app. Uninstalling the Drools plugin restores my Grails app to its' former vigor. Regards, David. On Wed, 2012-05-02 at 14:06 -0400, Lloyd Meinholz wrote: > I'm trying to add a drools dependency to grails 2.0.3. > > I added the dependency by adding the following to the repositories > block in BuildConfig: > > mavenRepo > "https://repository.jboss.org/nexus/content/groups/public-jboss/" > > and the following to the dependencies block: > > runtime ('org.drools:drools-distribution:5.3.0.Final') > > When I build the war, the appropriate drools jars seem to be there. > > When I try and run the application, I get the following: > > ... > | Running Grails application > | Error 2012-05-02 13:55:32,549 [pool-7-thread-1] ERROR > context.GrailsContextLoader - Error executing bootstraps: Error > creating bean with name 'transactionManagerPostProcessor': > Initialization of bean failed; nested exception is > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'transactionManager': Cannot resolve reference > to bean 'sessionFactory' while setting bean property 'sessionFactory'; > nested exception is > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'sessionFactory': Invocation of init method > failed; nested exception is > org.springframework.beans.BeanInstantiationException: Could not > instantiate bean class > [org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE > Message: Error creating bean with name > 'transactionManagerPostProcessor': Initialization of bean failed; > nested exception is > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'transactionManager': Cannot resolve reference > to bean 'sessionFactory' while setting bean property 'sessionFactory'; > nested exception is > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'sessionFactory': Invocation of init method > failed; nested exception is > org.springframework.beans.BeanInstantiationException: Could not > instantiate bean class > [org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE > Line | Method > ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - > | 138 | run in java.util.concurrent.FutureTask > | 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker > | 908 | run in '' > ^ 662 | run . . in java.lang.Thread > > > I have no idea where INSTANCE is coming from. > > This is a new app that was created as a grails 2.0.3 application on > windows 7. I have the jbossas and dojo plugins installed. > > Does anyone have any ideas on how to resolve this issue? Thanks, > > Lloyd > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by Lloyd Meinholz-2
On Wed, May 2, 2012 at 11:06 AM, Lloyd Meinholz <[hidden email]> wrote:
I'm trying to add a drools dependency to grails 2.0.3. I always start debugging these strange runtime problems with 'grails clean' and 'grails refresh-dependencies' and that tends to fix the problem when it is otherwise completely inexplicable like this one..
|
|
In reply to this post by geezenslaw
On Wed, May 2, 2012 at 5:10 PM, David Brown <[hidden email]> wrote:
Hello Lloyd, I will be following the outcome of your issue. It doesn't sound like he is installing a drools plugin, just a dependency on the drools jar at runtime. |
|
In reply to this post by geezenslaw
As Samuel said, I am manually adding the dependency, not using the plugin.
I've started with the drools-gorm plugin to see if I can figure out how they've avoided the issue but haven't figured anything out yet. I will post here when I do figure it out. Lloyd On Wed, May 2, 2012 at 8:10 PM, David Brown <[hidden email]> wrote: Hello Lloyd, I will be following the outcome of your issue. |
|
In reply to this post by ideasculptor
On Wed, May 2, 2012 at 10:33 PM, Samuel Gendler <[hidden email]> wrote:
I tried the clean and refresh-depenendencies. I tried deleting the project files and re-importing the project. I even deleted the ~/.grails folder. None of these seem to help and I have the same issue. Thanks for the idea though. Lloyd |
|
On Thu, May 3, 2012 at 10:51 AM, Lloyd Meinholz <[hidden email]> wrote:
So it is simply the existence of the dependency which causes everything to break? I'd have to assume that, in that case, one of the transitive dependencies must be overriding one of the jars that the rest of your app is dependent upon with an incompatible version of something. I'd take a look at the dependencies of the drools library and start adding 'excludes' statements to your BuildConfig line until you figure out which jar is the problem. Then you'll have to determine if drools functions correctly with the version that works with grails or not.
Lines in the dependencies section would look like this: compile('org.springframework.integration:spring-integration-core:2.1.1.RELEASE') { excludes "spring-aop", "spring-beans", "spring-context", "spring-context-support", "spring-core", "spring-tx"
} |
|
On Thu, May 3, 2012 at 11:16 AM, Samuel Gendler <[hidden email]> wrote:
And don't forget to clean and refresh dependencies after making changes like that, too, since I wouldn't be surprised if the jars don't get properly expunged otherwise. |
|
On Thu, May 3, 2012 at 2:18 PM, Samuel Gendler <[hidden email]> wrote:
Thanks, will give that a shot. Lloyd |
|
I think I found the issue but it doesn't make sense. The drools-distribution seemed to be pulling src jars but not the binaries. When I changed the dependencies to pull the individual projects that I wanted (drools-compiler, drools-core, etc.) then things seemed to work ok. I don't know if it is a problem with how the drools-distribution is built or my understanding of its purpose. Anyway, things seem to be ok now. Thanks,
Lloyd On Thu, May 3, 2012 at 2:35 PM, Lloyd Meinholz <[hidden email]> wrote:
|
|
In reply to this post by Lloyd Meinholz-2
BTW, drools 5.4.0 was released today and drools-distribution works in BuildConfig. So the issue was definitely something with the maven repository version of drools 5.3.0. Yikes.
Lloyd On Wed, May 2, 2012 at 2:06 PM, Lloyd Meinholz <[hidden email]> wrote: I'm trying to add a drools dependency to grails 2.0.3. |
| Powered by Nabble | Edit this page |
