Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [MongoEMF] Serializing EMF Model to MongoDB with MongoEMF fails(Serializing EMF Model to MongoDB with MongoEMF fails with "unknown protocol: mongod")
icon9.gif  [MongoEMF] Serializing EMF Model to MongoDB with MongoEMF fails [message #1478070] Tue, 18 November 2014 11:04
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hello everybody,

I am currently trying to serialize a simple EMF Model into a MongoDB using MongoEMF. I am following the User Guide of Bryan Hunt [1] and had numerous success feelings configuring the runtime to use MongoEMF. However, when launching my OSGi/Equinox environment, I am still getting the following errors and serialization into the MongoDB fails with "unknown protocol: mongodb".

I tried to understand the different error messages and track them down. Unfortunately, I did not receive a point of conclusion, neither found a solution for the problem. That's how far I came until now:

!ENTRY org.eclipse.equinox.ds 4 0 2014-11-18 11:57:18.216
!MESSAGE [SCR] Exception while activating instance org.eclipselabs.emongo.components.MongoIdFactoryComponent@6c2a5316 of component org.eclipselabs.emongo.idFactory  
!STACK 0
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:235)
	at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
	at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
	at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
	at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
	at org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:536)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:213)
	at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
	at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
	at org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:536)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:213)
	at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)
	at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)
	at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)
	at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)
	at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
	at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
Caused by: com.mongodb.MongoTimeoutException: Timed out after 0 ms while waiting to connect. Client view of cluster state is {type=Unknown, servers=[{address=localhost:27017, type=Unknown, state=Connecting}]
	at com.mongodb.BaseCluster.getDescription(BaseCluster.java:128)
	at com.mongodb.DBTCPConnector.getClusterDescription(DBTCPConnector.java:396)
	at com.mongodb.DBTCPConnector.getType(DBTCPConnector.java:569)
	at com.mongodb.DBTCPConnector.isMongosConnection(DBTCPConnector.java:370)
	at com.mongodb.Mongo.isMongosConnection(Mongo.java:645)
	at com.mongodb.DBCollection.findOne(DBCollection.java:865)
	at com.mongodb.DBCollection.findOne(DBCollection.java:843)
	at com.mongodb.DBCollection.findOne(DBCollection.java:789)
	at org.eclipselabs.emongo.components.MongoIdFactoryComponent.activate(MongoIdFactoryComponent.java:63)
	... 41 more


I don't understand what this problem is about.

!ENTRY org.eclipse.equinox.ds 1 0 2014-11-18 11:57:18.263
!MESSAGE Could not bind a reference of component org.eclipselabs.emodeling.factory. The reference is: Reference[name = ResourceSetConfigurator, interface = org.eclipselabs.emodeling.ResourceSetConfigurator, policy = dynamic, cardinality = 0..n, targe
t = null, bind = bindResourceSetConfigurator, unbind = unbindResourceSetConfigurator]


If I check the output of "services", I find that the ResourceSetConfigurator service is available and bound:

{org.eclipselabs.emodeling.ResourceSetConfigurator}={component.name=org.eclipselabs.emodeling.uriHandlerConfigurator, component.id=9, service.id=95, service.bundleid=32, service.scope=bundle}
  "Registered by bundle:" org.eclipselabs.emodeling.components_1.0.0.201307280847 [32]
  "Bundles using service"
    org.eclipselabs.emodeling.components_1.0.0.201307280847 [32]


The same is true for the other two services which are shown to be missing:

!ENTRY org.eclipse.equinox.ds 1 0 2014-11-18 11:57:18.263
!MESSAGE Could not bind a reference of component org.eclipselabs.emodeling.uriHandlerConfigurator. The reference is: Reference[name = UriHandlerProvider, interface = org.eclipselabs.emodeling.UriHandlerProvider, policy = dynamic, cardinality = 0..n, 
target = null, bind = bindUriHandlerProvider, unbind = unbindUriHandlerProvider]


!ENTRY org.eclipse.equinox.ds 1 0 2014-11-18 11:57:18.264
!MESSAGE Could not bind a reference of component org.eclipselabs.emodeling.uriHandlerConfigurator. The reference is: Reference[name = UriMapProvider, interface = org.eclipselabs.emodeling.UriMapProvider, policy = dynamic, cardinality = 0..n, target =
 null, bind = bindUriMapProvider, unbind = unbindUriMapProvider]


I have no idea what is the following error about:

!ENTRY org.eclipse.ui 4 4 2014-11-18 11:57:18.357
!MESSAGE Unable to load UI activator
!STACK 0
org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; osgi.identity="org.eclipse.ui"; type="osgi.bundle"; version:Version="3.106.0.v20140812-1751"; singleton:="true" [id=49] STARTED [STARTED] inval
id
	at org.eclipse.osgi.container.Module.lockStateChange(Module.java:329)
	at org.eclipse.osgi.container.Module.start(Module.java:389)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)
	at org.eclipse.ui.internal.WorkbenchPlugin.start(WorkbenchPlugin.java:883)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320)
	at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:391)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:272)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:588)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:540)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:527)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:754)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:706)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)


And then there seems to happen a NullPointer exception in the MongoEMF code DefaultStreamFactory.bindMongoIdFactory():

!ENTRY org.eclipselabs.mongoemf.streams 4 0 2014-11-18 11:57:18.810
!MESSAGE [SCR] Error while trying to bind reference Reference[name = MongoIdFactory, interface = org.eclipselabs.emongo.MongoIdFactory, policy = dynamic, cardinality = 0..n, target = null, bind = bindMongoIdFactory, unbind = unbindMongoIdFactory]
	Details:
	Problematic reference = Reference[name = MongoIdFactory, interface = org.eclipselabs.emongo.MongoIdFactory, policy = dynamic, cardinality = 0..n, target = null, bind = bindMongoIdFactory, unbind = unbindMongoIdFactory]
	of service component = org.eclipselabs.mongoemf.streams.factory
	component implementation class = org.eclipselabs.mongoemf.streams.DefaultStreamFactory
	located in bundle with symbolic name = org.eclipselabs.mongoemf.streams
	bundle location = initial@reference:file:../../workspaces/eclipse-luna-modeling/platform-demo/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipselabs.mongoemf.streams_0.8.0.201403232117.jar
!STACK 0
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:376)
	at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:444)
	at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:218)
	at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:343)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
	at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
	at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
	at org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:536)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:213)
	at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)
	at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)
	at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)
	at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)
	at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
	at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
Caused by: java.lang.NullPointerException
	at org.eclipselabs.mongoemf.streams.DefaultStreamFactory.bindMongoIdFactory(DefaultStreamFactory.java:70)
	... 29 more


Do you guys have any idea how to proceed to track down the problem and solve it. I appreciate any hint...

Take care
Timo

[1] https://github.com/BryanHunt/mongo-emf/wiki/User-Guide

[Updated on: Wed, 26 November 2014 07:12]

Report message to a moderator

Previous Topic:How to Reload the Data with ecp Renderers in the Properties View
Next Topic:[Edapt] How to build an history from a model comparison ?
Goto Forum:
  


Current Time: Tue Apr 07 08:26:58 GMT 2020

Powered by FUDForum. Page generated in 0.02025 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top