recently I worked with an grails project using sql as their main database. Now, they want to use sql database and mongodb as the same. Unfortunately, when I add mongodb plugin the project doesn't work anymore.

I tested with simple project, add mongodb plugin and it works.

In my point of view, there are some conflicts between other plugins and mongodb. So, how can I verify these dependency problems?

I am using grails 2.3.7 and trying with mongodb 3.0.1 compile no error, but problem when running. Here is the details:

Error Details
Error 500: 
Servlet: gsp
URI: /
Exception Message: grails.orm.HibernateCriteriaBuilder.or(Lgroovy/lang/Closure;)Lorg/grails/datastore/mapping/query/api/Criteria; 
Caused by: Executing action [index] of controller [com.finensemble.IndexController] caused exception: Runtime error executing action 
Class: IndexController 
At Line: [54] 
Code Snippet:
Stack Trace
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [index] of controller [com.finensemble.IndexController]  caused exception: Runtime error executing action

    at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:200)

    at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)

    at com.linkedin.grails.profiler.ProfilerFilter.doFilterInternal(ProfilerFilter.java:82)

    at org.apache.shiro.grails.SavedRequestFilter.doFilter(SavedRequestFilter.java:55)

    at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)

    at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)

    at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)

    at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)

    at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)

    at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)

    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

    at java.lang.Thread.run(Thread.java:745)

Caused by: org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Runtime error executing action

    ... 14 more

Caused by: java.lang.reflect.InvocationTargetException

    ... 14 more

Caused by: java.lang.AbstractMethodError: grails.orm.HibernateCriteriaBuilder.or(Lgroovy/lang/Closure;)Lorg/grails/datastore/mapping/query/api/Criteria;

    at com.finansemble.finStore.SaleService$_getActiveSales_closure1.doCall(SaleService.groovy:17)

    at grails.orm.HibernateCriteriaBuilder.invokeClosureNode(HibernateCriteriaBuilder.java:1854)

    at grails.orm.HibernateCriteriaBuilder.invokeMethod(HibernateCriteriaBuilder.java:1553)

    at com.finansemble.finStore.SaleService.getActiveSales(SaleService.groovy:16)

    at com.finansemble.finStore.SaleService.getActiveSales(SaleService.groovy:11)

    at com.finensemble.IndexController$_closure1.doCall(IndexController.groovy:54)

Can I conclude that: hibernate and mongodb depend on some other plugins but in difference version? and the hibernate not load properly?

有帮助吗?

解决方案

Run grails dependency-report and make sure you are using the most recent versions of the grails-datastore-* jars. Normally to achieve this simply upgrade to the latest versions of both hibernate and mongodb

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top