Quantcast

Plugin with mongoDB

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Plugin with mongoDB

Alberto Barcelos
Hi all

I have a grails app with a rich domain model and many plugins. We use hibernate for most domain classes but we're trying mongodb plugin. There is module of this app that I've wrapped inside a plugin.

Scenario 1:

In this plugin I've uinstalled hibernate and installed mongodb plugin. But when I try to save any domain class from the main app I get an expection because grails try to use hibernate instead of mongo.

Scenario 2: 

I tried to install mongodb plugin in the main app but it seems to be incompatible with many other plugins.

Scenario 3: 

The plugin works correctly on isolation as expected.

What I'm doing wrong? There are any other architecture that not use jms or rest that I could use? 

Thks!

Alberto Barcelos
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Plugin with mongoDB

Graeme Rocher-4
Administrator
You will have to provide more information on the exist errors you are
seeing in Scenario 1 and 2

Cheers

On Tue, Jan 18, 2011 at 4:31 AM, Alberto Barcelos <[hidden email]> wrote:

> Hi all
> I have a grails app with a rich domain model and many plugins. We use
> hibernate for most domain classes but we're trying mongodb plugin. There is
> module of this app that I've wrapped inside a plugin.
> Scenario 1:
> In this plugin I've uinstalled hibernate and installed mongodb plugin. But
> when I try to save any domain class from the main app I get an expection
> because grails try to use hibernate instead of mongo.
> Scenario 2:
> I tried to install mongodb plugin in the main app but it seems to
> be incompatible with many other plugins.
> Scenario 3:
> The plugin works correctly on isolation as expected.
> What I'm doing wrong? There are any other architecture that not use jms or
> rest that I could use?
> Thks!
> Alberto Barcelos
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Plugin with mongoDB

Alberto Barcelos
Hi. sorry for take so long to reply.

For scenario 2: mongodb and hibernate installed on application AND  plugin with mondb and without hibernate 
I get this error when I try to run application:

2011-01-20 19:45:09,725 [main] ERROR context.GrailsContextLoader  - Error executing bootstraps: Error creating bean with name 'controllerHandlerMappings': Cannot resolve reference to bean 'mongoOpenSessionInViewInterceptor' while setting bean property 'interceptors' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoOpenSessionInViewInterceptor': Cannot resolve reference to bean 'mongoDatastore' while setting bean property 'datastore'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': FactoryBean threw exception on object creation; nested exception is org.springframework.datastore.mapping.model.DatastoreConfigurationException: Failed to configure Mongo template for entity [EncryptedData]: can't call something
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'controllerHandlerMappings': Cannot resolve reference to bean 'mongoOpenSessionInViewInterceptor' while setting bean property 'interceptors' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoOpenSessionInViewInterceptor': Cannot resolve reference to bean 'mongoDatastore' while setting bean property 'datastore'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': FactoryBean threw exception on object creation; nested exception is org.springframework.datastore.mapping.model.DatastoreConfigurationException: Failed to configure Mongo template for entity [EncryptedData]: can't call something
at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoOpenSessionInViewInterceptor': Cannot resolve reference to bean 'mongoDatastore' while setting bean property 'datastore'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': FactoryBean threw exception on object creation; nested exception is org.springframework.datastore.mapping.model.DatastoreConfigurationException: Failed to configure Mongo template for entity [EncryptedData]: can't call something
... 24 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDatastore': FactoryBean threw exception on object creation; nested exception is org.springframework.datastore.mapping.model.DatastoreConfigurationException: Failed to configure Mongo template for entity [EncryptedData]: can't call something
... 24 more
Caused by: org.springframework.datastore.mapping.model.DatastoreConfigurationException: Failed to configure Mongo template for entity [EncryptedData]: can't call something
at org.grails.datastore.gorm.mongo.bean.factory.MongoDatastoreFactoryBean.getObject(MongoDatastoreFactoryBean.groovy:50)
at org.grails.datastore.gorm.mongo.bean.factory.MongoDatastoreFactoryBean.getObject(MongoDatastoreFactoryBean.groovy)
... 24 more
Caused by: com.mongodb.MongoException$Network: can't call something
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:194)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:192)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:192)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
at com.mongodb.DB.getCollectionNames(DB.java:196)
at com.mongodb.DB.collectionExists(DB.java:237)
... 26 more
Caused by: java.io.IOException: couldn't connect to [alberto-laptop/127.0.1.1:27107] bc:java.net.ConnectException: Connection refused
at com.mongodb.DBPort._open(DBPort.java:150)
at com.mongodb.DBPort.go(DBPort.java:70)
at com.mongodb.DBPort.call(DBPort.java:56)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
... 31 more

---------------------------------------------------------

I've defined the database connection parameters on main app. If I remove one of the app plugins I get the same error for another entity(from other plugin).

In the other scenario, when I install mongodb on my plugin and remove hibernate from it, the main app start and works fine. But when I try to save any object inside my plugin i get a mapping exception

org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: br.com.idra.cotecom.analise.AnaliseFact; nested exception is org.hibernate.MappingException: Unknown entity: br.com.idra.cotecom.analise.AnaliseFact
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:679)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
at org.codehaus.groovy.grails.orm.hibernate.metaclass.SavePersistentMethod.performSave(SavePersistentMethod.java:53)
at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractSavePersistentMethod.doInvokeInternal(AbstractSavePersistentMethod.java:179)
at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractDynamicPersistentMethod.invoke(AbstractDynamicPersistentMethod.java:59)
at sun.reflect.GeneratedMethodAccessor717.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:188)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:132)
at org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport$_addBasicPersistenceMethods_closure72.doCall(HibernatePluginSupport.groovy:809)
at sun.reflect.GeneratedMethodAccessor721.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown Source)
at org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport$_enhanceSessionFactory_closure13.doCall(HibernatePluginSupport.groovy:376)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:813)
at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1107)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1060)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at analise.AnaliseService.save(AnaliseService.groovy:14)
at analise.AnaliseService$$FastClassByCGLIB$$1d4f29dd.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at analise.AnaliseService$$EnhancerByCGLIB$$a9ad9282.save(<generated>)
at analise.AnaliseService$save.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at br.com.cotecom.domain.cotacao.AnaliseFactory.crie(AnaliseFactory.groovy:29)
at br.com.cotecom.domain.cotacao.AnaliseFactory$crie.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at br.com.cotecom.domain.cotacao.CotacaoRascunho.doBackgroungWork(CotacaoRascunho.groovy:33)
at br.com.cotecom.domain.cotacao.CotacaoRascunho.this$3$doBackgroungWork(CotacaoRascunho.groovy)
at br.com.cotecom.domain.cotacao.CotacaoRascunho$this$3$doBackgroungWork.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
at br.com.cotecom.domain.cotacao.CotacaoRascunho.envie(CotacaoRascunho.groovy:20)
at br.com.cotecom.domain.cotacao.CotacaoRascunho$envie.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
at br.com.cotecom.domain.cotacao.Cotacao.envie(Cotacao.groovy:139)
at br.com.cotecom.domain.cotacao.ICotacao$envie.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at br.com.cotecom.services.CotacaoService.envieCotacao(CotacaoService.groovy:49)
at br.com.cotecom.services.CotacaoService$$FastClassByCGLIB$$4b4ea778.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at br.com.cotecom.services.CotacaoService$$EnhancerByCGLIB$$6031caeb.envieCotacao(<generated>)
at br.com.cotecom.services.CotacaoService$envieCotacao.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
at br.com.cotecom.services.remote.RemoteCotacaoService.envieCotacao(RemoteCotacaoService.groovy:81)
at br.com.cotecom.services.remote.RemoteCotacaoService$$FastClassByCGLIB$$5373e7b0.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at br.com.cotecom.services.remote.RemoteCotacaoService$$EnhancerByCGLIB$$a43c7b53.envieCotacao(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:406)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1417)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:878)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:49)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.processFilterChain(UrlMappingsFilter.java:287)
at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:205)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:245)
at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:134)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:119)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
at org.codehaus.groovy.grails.plugins.springsecurity.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:40)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.codehaus.groovy.grails.plugins.springsecurity.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:79)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:104)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:65)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.MappingException: Unknown entity: br.com.idra.cotecom.analise.AnaliseFact
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:580)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1365)
at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:203)
at org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:535)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:103)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor.onSaveOrUpdate(ClosureEventTriggeringInterceptor.java:137)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:534)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:526)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:522)
at sun.reflect.GeneratedMethodAccessor722.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1282)
at $Proxy16.saveOrUpdate(Unknown Source)
at org.codehaus.groovy.grails.orm.hibernate.metaclass.SavePersistentMethod$1.doInHibernate(SavePersistentMethod.java:55)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
... 176 more

If I want to wrap a plugin(wich uses mongodb) inside a app, how can I do that?

Thanks!


Alberto Barcelos


On Tue, Jan 18, 2011 at 6:51 AM, Graeme Rocher <[hidden email]> wrote:
You will have to provide more information on the exist errors you are
seeing in Scenario 1 and 2

Cheers

On Tue, Jan 18, 2011 at 4:31 AM, Alberto Barcelos <[hidden email]> wrote:
> Hi all
> I have a grails app with a rich domain model and many plugins. We use
> hibernate for most domain classes but we're trying mongodb plugin. There is
> module of this app that I've wrapped inside a plugin.
> Scenario 1:
> In this plugin I've uinstalled hibernate and installed mongodb plugin. But
> when I try to save any domain class from the main app I get an expection
> because grails try to use hibernate instead of mongo.
> Scenario 2:
> I tried to install mongodb plugin in the main app but it seems to
> be incompatible with many other plugins.
> Scenario 3:
> The plugin works correctly on isolation as expected.
> What I'm doing wrong? There are any other architecture that not use jms or
> rest that I could use?
> Thks!
> Alberto Barcelos
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Plugin with mongoDB

Graeme Rocher-4
Administrator
On Thu, Jan 27, 2011 at 3:15 AM, Alberto Barcelos <[hidden email]> wrote:
> Hi. sorry for take so long to reply.
> For scenario 2: mongodb and hibernate installed on application AND  plugin
> with mondb and without hibernate
> I get this error when I try to run application:

This error looks like you don't have Mongo running

> 2011-01-20 19:45:09,725 [main] ERROR context.GrailsContextLoader  - Error
> executing bootstraps: Error creating bean with name
> 'controllerHandlerMappings': Cannot resolve reference to bean
> 'mongoOpenSessionInViewInterceptor' while setting bean property
> 'interceptors' with key [1]; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'mongoOpenSessionInViewInterceptor': Cannot resolve reference to
> bean 'mongoDatastore' while setting bean property 'datastore'; nested
> exception is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'mongoDatastore': FactoryBean threw exception on
> object creation; nested exception is
> org.springframework.datastore.mapping.model.DatastoreConfigurationException:
> Failed to configure Mongo template for entity [EncryptedData]: can't call
> something
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'controllerHandlerMappings': Cannot resolve reference to bean
> 'mongoOpenSessionInViewInterceptor' while setting bean property
> 'interceptors' with key [1]; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'mongoOpenSessionInViewInterceptor': Cannot resolve reference to
> bean 'mongoDatastore' while setting bean property 'datastore'; nested
> exception is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'mongoDatastore': FactoryBean threw exception on
> object creation; nested exception is
> org.springframework.datastore.mapping.model.DatastoreConfigurationException:
> Failed to configure Mongo template for entity [EncryptedData]: can't call
> something
> at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
> at grails.web.container.EmbeddableServer$start.call(Unknown Source)
> at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
> at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
> at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
> at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
> at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
> at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
> at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
> at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
> at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
> at RunApp$_run_closure1.doCall(RunApp.groovy:33)
> at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
> at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
> at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
> at gant.Gant.withBuildListeners(Gant.groovy:427)
> at gant.Gant.this$2$withBuildListeners(Gant.groovy)
> at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
> at gant.Gant.dispatch(Gant.groovy:415)
> at gant.Gant.this$2$dispatch(Gant.groovy)
> at gant.Gant.invokeMethod(Gant.groovy)
> at gant.Gant.executeTargets(Gant.groovy:590)
> at gant.Gant.executeTargets(Gant.groovy:589)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'mongoOpenSessionInViewInterceptor': Cannot resolve
> reference to bean 'mongoDatastore' while setting bean property 'datastore';
> nested exception is org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'mongoDatastore': FactoryBean threw exception
> on object creation; nested exception is
> org.springframework.datastore.mapping.model.DatastoreConfigurationException:
> Failed to configure Mongo template for entity [EncryptedData]: can't call
> something
> ... 24 more
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'mongoDatastore': FactoryBean threw exception on
> object creation; nested exception is
> org.springframework.datastore.mapping.model.DatastoreConfigurationException:
> Failed to configure Mongo template for entity [EncryptedData]: can't call
> something
> ... 24 more
> Caused by:
> org.springframework.datastore.mapping.model.DatastoreConfigurationException:
> Failed to configure Mongo template for entity [EncryptedData]: can't call
> something
> at
> org.grails.datastore.gorm.mongo.bean.factory.MongoDatastoreFactoryBean.getObject(MongoDatastoreFactoryBean.groovy:50)
> at
> org.grails.datastore.gorm.mongo.bean.factory.MongoDatastoreFactoryBean.getObject(MongoDatastoreFactoryBean.groovy)
> ... 24 more
> Caused by: com.mongodb.MongoException$Network: can't call something
> at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:194)
> at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:192)
> at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:192)
> at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:223)
> at com.mongodb.DB.getCollectionNames(DB.java:196)
> at com.mongodb.DB.collectionExists(DB.java:237)
> ... 26 more
> Caused by: java.io.IOException: couldn't connect to
> [alberto-laptop/127.0.1.1:27107] bc:java.net.ConnectException: Connection
> refused
> at com.mongodb.DBPort._open(DBPort.java:150)
> at com.mongodb.DBPort.go(DBPort.java:70)
> at com.mongodb.DBPort.call(DBPort.java:56)
> at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:186)
> ... 31 more
> ---------------------------------------------------------
> I've defined the database connection parameters on main app. If I remove one
> of the app plugins I get the same error for another entity(from other
> plugin).
> In the other scenario, when I install mongodb on my plugin and remove
> hibernate from it, the main app start and works fine. But when I try to save
> any object inside my plugin i get a mapping exception

Hmm you will have to raise a JIRA with an example the reproduces this
error. Not seen this before

Cheers

> org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity:
> br.com.idra.cotecom.analise.AnaliseFact; nested exception is
> org.hibernate.MappingException: Unknown entity:
> br.com.idra.cotecom.analise.AnaliseFact
> at
> org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:679)
> at
> org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
> at
> org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
> at
> org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
> at
> org.codehaus.groovy.grails.orm.hibernate.metaclass.SavePersistentMethod.performSave(SavePersistentMethod.java:53)
> at
> org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractSavePersistentMethod.doInvokeInternal(AbstractSavePersistentMethod.java:179)
> at
> org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractDynamicPersistentMethod.invoke(AbstractDynamicPersistentMethod.java:59)
> at sun.reflect.GeneratedMethodAccessor717.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:188)
> at
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
> at
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:54)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:132)
> at
> org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport$_addBasicPersistenceMethods_closure72.doCall(HibernatePluginSupport.groovy:809)
> at sun.reflect.GeneratedMethodAccessor721.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
> at
> org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
> at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
> at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown Source)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
> at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown Source)
> at
> org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport$_enhanceSessionFactory_closure13.doCall(HibernatePluginSupport.groovy:376)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
> at
> org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
> at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:813)
> at
> groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1107)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1060)
> at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
> at
> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
> at analise.AnaliseService.save(AnaliseService.groovy:14)
> at analise.AnaliseService$$FastClassByCGLIB$$1d4f29dd.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> at
> org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
> at analise.AnaliseService$$EnhancerByCGLIB$$a9ad9282.save(<generated>)
> at analise.AnaliseService$save.call(Unknown Source)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
> at
> br.com.cotecom.domain.cotacao.AnaliseFactory.crie(AnaliseFactory.groovy:29)
> at br.com.cotecom.domain.cotacao.AnaliseFactory$crie.call(Unknown Source)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
> at
> br.com.cotecom.domain.cotacao.CotacaoRascunho.doBackgroungWork(CotacaoRascunho.groovy:33)
> at
> br.com.cotecom.domain.cotacao.CotacaoRascunho.this$3$doBackgroungWork(CotacaoRascunho.groovy)
> at
> br.com.cotecom.domain.cotacao.CotacaoRascunho$this$3$doBackgroungWork.callCurrent(Unknown
> Source)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
> at
> br.com.cotecom.domain.cotacao.CotacaoRascunho.envie(CotacaoRascunho.groovy:20)
> at br.com.cotecom.domain.cotacao.CotacaoRascunho$envie.call(Unknown Source)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
> at br.com.cotecom.domain.cotacao.Cotacao.envie(Cotacao.groovy:139)
> at br.com.cotecom.domain.cotacao.ICotacao$envie.call(Unknown Source)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
> at
> br.com.cotecom.services.CotacaoService.envieCotacao(CotacaoService.groovy:49)
> at
> br.com.cotecom.services.CotacaoService$$FastClassByCGLIB$$4b4ea778.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> at
> org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
> at
> br.com.cotecom.services.CotacaoService$$EnhancerByCGLIB$$6031caeb.envieCotacao(<generated>)
> at br.com.cotecom.services.CotacaoService$envieCotacao.call(Unknown Source)
> at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
> at
> br.com.cotecom.services.remote.RemoteCotacaoService.envieCotacao(RemoteCotacaoService.groovy:81)
> at
> br.com.cotecom.services.remote.RemoteCotacaoService$$FastClassByCGLIB$$5373e7b0.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
> at
> org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
> at
> br.com.cotecom.services.remote.RemoteCotacaoService$$EnhancerByCGLIB$$a43c7b53.envieCotacao(<generated>)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:406)
> at
> flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
> at
> flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1417)
> at
> flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:878)
> at
> flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
> at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
> at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:49)
> at
> flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
> at
> flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
> at
> flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274)
> at
> flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.processFilterChain(UrlMappingsFilter.java:287)
> at
> org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:205)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:245)
> at
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:134)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
> at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
> at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
> at
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
> at
> org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
> at
> org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:119)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
> at
> org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
> at
> org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
> at
> org.codehaus.groovy.grails.plugins.springsecurity.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:40)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
> at
> org.codehaus.groovy.grails.plugins.springsecurity.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:79)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
> at
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
> at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
> at
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:104)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:65)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: org.hibernate.MappingException: Unknown entity:
> br.com.idra.cotecom.analise.AnaliseFact
> at
> org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:580)
> at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1365)
> at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:203)
> at
> org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:535)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:103)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
> at
> org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor.onSaveOrUpdate(ClosureEventTriggeringInterceptor.java:137)
> at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:534)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:526)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:522)
> at sun.reflect.GeneratedMethodAccessor722.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1282)
> at $Proxy16.saveOrUpdate(Unknown Source)
> at
> org.codehaus.groovy.grails.orm.hibernate.metaclass.SavePersistentMethod$1.doInHibernate(SavePersistentMethod.java:55)
> at
> org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
> ... 176 more
> If I want to wrap a plugin(wich uses mongodb) inside a app, how can I do
> that?
> Thanks!
>
> Alberto Barcelos
>
>
> On Tue, Jan 18, 2011 at 6:51 AM, Graeme Rocher <[hidden email]> wrote:
>>
>> You will have to provide more information on the exist errors you are
>> seeing in Scenario 1 and 2
>>
>> Cheers
>>
>> On Tue, Jan 18, 2011 at 4:31 AM, Alberto Barcelos <[hidden email]>
>> wrote:
>> > Hi all
>> > I have a grails app with a rich domain model and many plugins. We use
>> > hibernate for most domain classes but we're trying mongodb plugin. There
>> > is
>> > module of this app that I've wrapped inside a plugin.
>> > Scenario 1:
>> > In this plugin I've uinstalled hibernate and installed mongodb plugin.
>> > But
>> > when I try to save any domain class from the main app I get an expection
>> > because grails try to use hibernate instead of mongo.
>> > Scenario 2:
>> > I tried to install mongodb plugin in the main app but it seems to
>> > be incompatible with many other plugins.
>> > Scenario 3:
>> > The plugin works correctly on isolation as expected.
>> > What I'm doing wrong? There are any other architecture that not use jms
>> > or
>> > rest that I could use?
>> > Thks!
>> > Alberto Barcelos
>> >
>>
>>
>>
>> --
>> Graeme Rocher
>> Grails Project Lead
>> SpringSource - A Division of VMware
>> http://www.springsource.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


sd
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Plugin with mongoDB

sd
I'm seeing the same exception.

I have moved all my mongo plugins to a plugin which my application uses. It works fine when using run-app but when creating a war and deploying to tomcat I always encounter an unknown entity exception

2011-06-22 20:20:49,973 [Thread-2] ERROR context.ContextLoader  - Context initialization failed
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: com.test.domain.security.SecRole; nested exception is org.hibernate.MappingException: Unknown entity: com.test.domain.security.SecRole
        at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:87)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
        at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
        at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: com.test.domain.security.SecRole; nested exception is org.hibernate.MappingException: Unknown entity: com.test.domain.security.SecRole
        at BootStrap$_closure1.doCall(BootStrap.groovy:16)
        at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:251)
        at grails.util.Environment.executeForEnvironment(Environment.java:244)
        at grails.util.Environment.executeForCurrentEnvironment(Environment.java:220)
        ... 5 more
Caused by: org.hibernate.MappingException: Unknown entity: com.test.domain.security.SecRole
        at $Proxy12.saveOrUpdate(Unknown Source)

Loading...