Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How to connect EMFStore with MongoDB(NullPointer in MongoDBDynamicModelProvider.getDynamicModels)
How to connect EMFStore with MongoDB [message #1221341] Tue, 17 December 2013 13:22 Go to next message
Phil Wim is currently offline Phil WimFriend
Messages: 89
Registered: October 2013
Member
Hi there,

i try to setup an emfstore with mongodb, which should be running since version 1.1.1.

Here are my steps:
I:
1.added the complete EMFStore project into my workspace.
2.switched to EMFstore targetplatform
3.modified emfstore.product (added org.ecipse.emf.emfstore.mongodb; ...emfstore.mongodb.server ; ...emfstore.mongodb.client)
4.exported as eclipse product
5.started it
After a few seconds, the log says:
!SESSION 2013-12-17 13:59:22.944 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.emf.emfstore.common.model 2 2 2013-12-17 13:59:24.338
!MESSAGE No location provider or error while instantiating location provider, switching to default location!

!ENTRY org.eclipse.emf.emfstore.common.model 1 1 2013-12-17 13:59:24.345
!MESSAGE Property file read. (/home/jpw/.emfstore/server/profiles/default/./conf/es.properties)

!ENTRY org.eclipse.emf.emfstore.common.model 1 1 2013-12-17 13:59:24.346
!MESSAGE Server data home location: /home/jpw/.emfstore/server/profiles/default/

!ENTRY org.eclipse.emf.emfstore.common.model 1 1 2013-12-17 13:59:24.346
!MESSAGE JVM Max Memory: 1390 MByte

!ENTRY org.eclipse.osgi 4 0 2013-12-17 13:59:34.626
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
	at org.eclipse.emf.emfstore.mongodb.server.MongoDBDynamicModelProvider.getDynamicModels(MongoDBDynamicModelProvider.java:53)
	at org.eclipse.emf.emfstore.internal.server.EMFStoreController.registerDynamicModels(EMFStoreController.java:208)
	at org.eclipse.emf.emfstore.internal.server.EMFStoreController.run(EMFStoreController.java:137)
	at org.eclipse.emf.emfstore.internal.server.EMFStoreController.start(EMFStoreController.java:102)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)


There is not much to configure in the automatically created file mongodb.properties. So I left it as default.

I found an outdated guide for connecting emfstore with mongo db (https://github.com/ExNexu/emfstore-mongodb/wiki). The description says i have to to prepare my mongodb. But still no success. Is this guide related to the new mongodb functionality?

Can somebody tell me how to get it running?

[Updated on: Tue, 17 December 2013 14:12]

Report message to a moderator

Re: How to connect EMFStore with MongoDB [message #1221989 is a reply to message #1221341] Thu, 19 December 2013 09:12 Go to previous messageGo to next message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 99
Registered: December 2013
Member

Hi,

Sorry for the late response. The guide you are mentioning is not related to the current implementation.
I think you might be missing some plugins. To get EMFStore to run with mongodb you also have to add the following plugins (and their dependencies) to the run/product configuration:

org.eclipselabs.emf.query.simple
org.eclipselabs.mongo
org.eclipselabs.mongo.emf
org.eclipselabs.mongo.emf.builders
org.eclipselabs.mongo.emf.converter
org.eclipselabs.mongo.emf.ext
org.eclipselabs.mongo.emf.query.simple
org.eclipselabs.mongo.emf.streams
org.eclipse.equinox.ds
org.eclipse.equinox.cm

For equinox.ds and equinox.cm you have to set autostart to true and the start-level to 1.

Best regards,
Johannes


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: How to connect EMFStore with MongoDB [message #1222134 is a reply to message #1221989] Thu, 19 December 2013 18:40 Go to previous messageGo to next message
Phil Wim is currently offline Phil WimFriend
Messages: 89
Registered: October 2013
Member
Hi Johannes,

thanks for your reply. I'm struggling for a while now. But I take it as a challenge to finally start learning Eclipse Development and OSGi. Smile

For now I solved all dependencies issues. The log just concerns about missing OSGi definitions:

!ENTRY org.eclipse.emf.emfstore.mongodb.server 4 0 2013-12-19 19:13:58.156
!MESSAGE [SCR] Component definition XMLs not found in bundle org.eclipse.emf.emfstore.mongodb.server. The component header value is OSGI-INF/config.xml

!ENTRY org.eclipse.emf.emfstore.mongodb.server 4 0 2013-12-19 19:13:58.157
!MESSAGE [SCR] Component definition XMLs not found in bundle org.eclipse.emf.emfstore.mongodb.server. The component header value is OSGI-INF/config.xml

!ENTRY org.eclipse.emf.emfstore.mongodb.server 4 0 2013-12-19 19:13:58.159
!MESSAGE [SCR] Component definition XMLs not found in bundle org.eclipse.emf.emfstore.mongodb.server. The component header value is OSGI-INF/provider.xml

!ENTRY org.eclipse.emf.emfstore.mongodb.server 4 0 2013-12-19 19:13:58.161
!MESSAGE [SCR] Component definition XMLs not found in bundle org.eclipse.emf.emfstore.mongodb.server. The component header value is OSGI-INF/provider.xml


But again, the same error. Before you answered I was able to drill down the nullpointer. There is no ResourceSetFactory available.
ResourceSetFactoryProvider.getResourceSetFactory() is null
So it's not able to call the method createResourceSet.
ResourceSetFactoryProvider.getResourceSetFactory().createResourceSet();


Any ideas on that?

Might you provide a eclipse product definition or a launch configuration?

Do i have to prepare mongodb (create db or collections) to get it running?
Re: How to connect EMFStore with MongoDB [message #1222524 is a reply to message #1222134] Fri, 20 December 2013 17:11 Go to previous messageGo to next message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 99
Registered: December 2013
Member

Hi,

From my experience the ResourceSetFactory is null when the mongoEMF services are not working correctly and the factory is never provided. So I think it is still a problem with the run configuration.
I added a launch configuration for the server in the emfstore.mongodb.server plugin, so you can pull and have a look at it.
Besides starting the MongoDB instance you don't have to do any configuration.
I will create further launch configs and a product definition in the upcoming days.


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: How to connect EMFStore with MongoDB [message #1222818 is a reply to message #1222524] Sat, 21 December 2013 13:51 Go to previous messageGo to next message
Phil Wim is currently offline Phil WimFriend
Messages: 89
Registered: October 2013
Member
Hey Johannes,

i just saw it in the repository. I will try it out and post my results.

So far, thanks for your time! Smile
Re: How to connect EMFStore with MongoDB [message #1225984 is a reply to message #1222818] Tue, 31 December 2013 10:22 Go to previous messageGo to next message
Phil Wim is currently offline Phil WimFriend
Messages: 89
Registered: October 2013
Member
Hi Johannes,

finally i got it working. Thanks so much. I was missing exactly these dependencies. I had the sources of these in my workspace. Somehow, they did not work. Then I installed the dependencies bryan hunt suggested at https://github.com/BryanHunt/mongo-emf/wiki (update site http://bryanhunt.github.com/mongo-emf/releases/0.7.1; i had to uncheck the option "group items by category" to see something in the install dialog). Then I updated the launch configuration by simply pressing the button"add required plugins". Eventually I created a product configuration out of my launch conf. Now I have a running server product with everything stored in mongo db. Perfekt!

So, what is next? In order to use EMF instead of an OR-Mapping I need the ability of storing large datasets, querying and aggregating them. Is the EmfStore-Mongo Approach fitting my needs? Do I have to switch to mongoemf api?

If so, can you provide some examples?

I'm currently playing around with
ResourceSetFactoryProvider.getResourceSetFactory().createResourceSet();

Which provides the starting point ResourceSet of mongoemf examples.
Probably then i have to switch to a different api, right?

I wish you all a happy new year
Philippe

[Updated on: Tue, 31 December 2013 10:23]

Report message to a moderator

Re: How to connect EMFStore with MongoDB [message #1227063 is a reply to message #1225984] Fri, 03 January 2014 12:17 Go to previous message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 253
Registered: July 2009
Senior Member
Hi Phil,

Johannes (and the team) are currently on holidays, therefore the delay.
It is always hard to say if something is the right approach for you ;),
maybe you can provide some more insight in your usage scenario? How many
entities do you intend to store (e.g. per project), how many users are
accessing the data and in which frequency?
I can also offer you to discuss your problem in a short telco once I am
back at January 7th, if you cannot disclose too much here.

Cheers,
Maximilian

Am 31.12.2013 17:22, schrieb Phil Wim:
> Hi Johannes,
>
> finally i got it working. Thanks so much. I was missing exactly these
> dependencies. I had the sources of these in my workspace. Somehow, they
> did not work. Then I installed the dependencies bryan hunt suggested at
> https://github.com/BryanHunt/mongo-emf/wiki (update site
> http://bryanhunt.github.com/mongo-emf/releases/0.7.1; i had to uncheck
> the option "group items by category" to see something in the install
> dialog). Then I updated the lunch configuration by simply pressing the
> button"add required plugins". Eventually I created a product
> configuration out of my lunch conf. Now I have a running server product
> with everything stored in mongo db. Perfekt!
>
> So, what is next? In order to use EMF instead of an OR-Mapping I need
> the ability of storing large datasets, querying and aggregating them. Is
> the EmfStore-Mongo Approach fitting my needs? Do I have to switch to
> mongoemf api?
>
> If so, can you provide some examples?
> I'm currently playing around with
> ResourceSetFactoryProvider.getResourceSetFactory().createResourceSet();
> Which provides the starting point ResourceSet of mongoemf examples.
> Probably then i have to switch to a different api, right?
>
> I wish you all a happy new year
> Philippe


--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Previous Topic:[EMFStore] file transfer API
Next Topic:[CDO] Open Resource Dialog
Goto Forum:
  


Current Time: Mon Mar 08 13:45:20 GMT 2021

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

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

Back to the top