Use MOngo-EMF inside a JEE app

86 views
Skip to first unread message

Patrizio

unread,
Sep 10, 2013, 9:22:10 AM9/10/13
to mong...@googlegroups.com
Hi Bryan, I'm experimenting with the Mongo-EMF framework and I'm wandering if it is possible to use it inside a JEE application with EJB,JSF and so on...
I'd like to use EMF for my domain model, and use your persistence framework to store model instances in MongoDB. If this is possible, I'd like to have your expert advice on which is the preferred method to gather all the dependencies that must be included in the enterprise application. I was thinking to Maven, but this requires the conversion of p2 repo to a maven repo, or at least the deployment of all required bundles to a maven repository (eg. using the to-eclipse goal), what do you think about this ? Thanks a lot for your help

Bryan Hunt

unread,
Sep 10, 2013, 9:08:58 PM9/10/13
to mong...@googlegroups.com
Build and deploy are not my strongest skill set.  In fact, I generally hate all build systems :)  If you are using p2/PDE, there is a way to export your target platform to a directory.  Would that help you deploy the bundles?  If you want to go the maven route, I would suggest modifying my projects to use Tycho to build.  I don't have any objections to putting my bundles in a Maven repo, I just don't have the cycles right now to do this.  Contributions are welcome!

Bryan

On Sep 10, 2013, at 8:22 AM, Patrizio <patrizio....@gmail.com> wrote:

Hi Bryan, I'm experimenting with the Mongo-EMF framework and I'm wandering if it is possible to use it inside a JEE application with EJB,JSF and so on...
I'd like to use EMF for my domain model, and use your persistence framework to store model instances in MongoDB. If this is possible, I'd like to have your expert advice on which is the preferred method to gather all the dependencies that must be included in the enterprise application. I was thinking to Maven, but this requires the conversion of p2 repo to a maven repo, or at least the deployment of all required bundles to a maven repository (eg. using the to-eclipse goal), what do you think about this ? Thanks a lot for your help

--
You received this message because you are subscribed to the Google Groups "MongoEMF" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoemf+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Patrizio

unread,
Sep 12, 2013, 6:53:11 AM9/12/13
to mong...@googlegroups.com
Hi Bryan, thx for replying to my post. Let me better explain what I would try to do. 
I'd like to use the mongo-emf framework inside an enterprise application developed as a st of OSGi bundles and deployed on a WebSPhere Liberty Profile runtime. For this to work, I need to add a bundle repository that contains all the bundles required by the framework. Can you point me to the minimum set of bundles I need to have mongo-emf work ? I guess they are the same set of bundles required to run the framwork in a "standalone" java application, is this correct ?

Thanks again for your help

Patrizio

Bryan Hunt

unread,
Sep 12, 2013, 9:46:10 AM9/12/13
to mong...@googlegroups.com
Ok, here's the minimum list of bundles you need other than the base OSGi framework bundle - I have based this list off of my soon to be released 0.8.0 version:

  • com.google.guava
  • com.ibm.icu
  • javax.xml
  • org.eclipse.ant.core
  • org.eclipse.compare.core
  • org.eclipse.core.contenttype
  • org.eclipse.core.expressions
  • org.eclipse.core.filesystem
  • org.eclipse.core.jobs
  • org.eclipse.core.resources
  • org.eclipse.core.runtime
  • org.eclispe.core.varaibles
  • org.eclipse.emf.common
  • org.eclipse.emf.ecore
  • org.eclipse.emf.exore.xcore.lib
  • org.eclipse.emf.exore.xmi
  • org.eclipse.equinox.common
  • org.eclipse.equinox.cm
  • org.eclipse.equinox.ds
  • org.eclipse.equinox.preferences
  • org.eclipse.equinox.registry
  • org.eclipse.equinox.util
  • org.eclipse.osgi.services
  • org.eclipse.xtext.xbase.lib
  • MongoDB driver
  • org.eclipselabs.emongo.api
  • org.eclipselabs.emongo.components
  • org.eclipselabs.emodeling.api
  • org.eclipselabs.modeling.components
  • org.eclipselabs.mongoemf.builders
  • org.eclipselabs.mongoemf.converter
  • org.eclipselabs.mongoemf.core
  • org.eclipselabs.mongoemf.handlers
  • org.eclipselabs.mongoemf.query.mongodb (assuming you want to use native MongoDB queries and not the simple queries - my recommendation)
  • org.eclipselabs.mongoemf.streams

Patrizio

unread,
Sep 12, 2013, 12:40:51 PM9/12/13
to mong...@googlegroups.com
Thanks for the list! I've checked on my platform and this is the set of bundles that I have (and don't) have. Are they at the right version? 
How could I get the missing ones?

Thanks again
Patrizio

com.google.guava
com.google.guava_12.0.0.v201212092141.jar
com.ibm.icu
com.ibm.icu_4.4.2.v20110823.jar
javax.xml
javax.xml_1.3.4.v201005080400.jar
org.eclipse.ant.core
org.eclipse.ant.core_3.2.401.v20121204-162022.jar
org.eclipse.compare.core
org.eclipse.compare.core_3.5.200.v20120522-1148.jar
org.eclipse.core.contenttype
org.eclipse.core.contenttype_3.4.200.v20120523-2004.jar
org.eclipse.core.expressions
org.eclipse.core.expressions_3.4.401.v20120912-155018.jar
org.eclipse.core.filesystem
org.eclipse.core.filesystem.linux.x86_64_1.2.0.v20120522-1137.jar
org.eclipse.core.jobs_3.5.300.v20120912-155018.jar
org.eclipse.core.resources
org.eclipse.core.resources_3.8.1.v20121114-124432.jar
org.eclipse.core.runtime
org.eclipse.core.runtime_3.8.0.v20120912-155025.jar
org.eclispe.core.varaibles
(I don't have this bundle in my platform)
org.eclipse.emf.common
org.eclipse.emf.common_2.9.0.v20130528-0742.jar
org.eclipse.emf.common_2.9.1.v20130827-0309.jar
org.eclipse.emf.ecore
org.eclipse.emf.ecore_2.9.0.v20130528-0742.jar
org.eclipse.emf.ecore_2.9.1.v20130827-0309.jar
org.eclipse.emf.exore.xcore.lib
org.eclipse.emf.ecore.xcore.lib_1.0.0.v20130612-0809.jar
org.eclipse.emf.exore.xmi
org.eclipse.emf.ecore.xmi_2.9.0.v20130528-0742.jar
org.eclipse.emf.ecore.xmi_2.9.1.v20130827-0309.jar
org.eclipse.equinox.common
org.eclipse.equinox.common_3.6.100.v20120522-1841.jar
(I don't have this bundle in my platform)
org.eclipse.equinox.ds
org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar
org.eclipse.equinox.preferences
org.eclipse.equinox.preferences_3.5.1.v20121031-182809.jar
org.eclipse.equinox.registry
org.eclipse.equinox.registry_3.5.200.v20120522-1841.jar
org.eclipse.equinox.util
org.eclipse.equinox.util_1.0.400.v20120917-192807.jar
org.eclipse.osgi.services
org.eclipse.osgi.services_3.3.100.v20120522-1822.jar
org.eclipse.xtext.xbase.lib
org.eclipse.xtext.xbase.lib_2.4.2.v201306120542.jar
MongoDB driver
org.mongodb.mongo-java-driver_2.11.1.RELEASE.jar
org.eclipselabs.emongo.api
org.eclipselabs.emongo.api_1.0.0.201309071633.jar
org.eclipselabs.emongo.components
org.eclipselabs.emongo.components_1.0.0.201309071633.jar
org.eclipselabs.emodeling.api
org.eclipselabs.emodeling.api_1.0.0.201307280847.jar
org.eclipselabs.modeling.components
org.eclipselabs.emodeling.components_1.0.0.201307280847.jar
org.eclipselabs.mongoemf.builders
org.eclipselabs.mongoemf.builders_0.8.0.201307282032.jar
org.eclipselabs.mongoemf.converter
org.eclipselabs.mongoemf.converter_0.8.0.201307282032.jar
org.eclipselabs.mongoemf.core
org.eclipselabs.mongoemf.core_0.8.0.201307282032.jar
org.eclipselabs.mongoemf.handlers
org.eclipselabs.mongoemf.handlers_0.8.0.201307282032.jar
org.eclipselabs.mongoemf.query.mongodb (assuming you want to use native MongoDB queries and not the simple queries - my recommendation)
(I have only the 'simple' jar in my platform)
org.eclipselabs.mongoemf.query.simple_0.8.0.201307282032.jar
org.eclipselabs.mongoemf.streams
org.eclipselabs.mongoemf.streams_0.8.0.201307282032.jar

Patrizio

unread,
Sep 17, 2013, 10:49:15 AM9/17/13
to mong...@googlegroups.com
Hi Bryan

I'm making progress with your framework.. thanks for your help!
Now I'm experimenting a bit with the new 0.8.0 version, but I have some troubles in adapting the test case documented here MongoEMF outside OSGI
Can you give me some hints about the usage of the refactored classes outside an OSGi runtime?

Thanks again

Patrizio

Bryan Hunt

unread,
Sep 17, 2013, 11:15:12 AM9/17/13
to mong...@googlegroups.com
Hi Patrizio,

The general idea is that you need to stitch the components together that would normally be done by OSGi declarative services.  You will have to trace your way through the source code looking particularly at the bind() functions.  For example, starting with the MongoURIHandlerImpl, it needs stream factories. Looking at the DefaultStreamFactory, it needs a DBObjectBuilderFactory, EObjectBuilderFactory, and a QueryEngine.  Also have a look at the service declarations in the xml files to see which references are required and which are optional.

This is a non-trivial task, but I think it can be done.  If you have specific questions about the source, please let me know.

Bryan
Reply all
Reply to author
Forward
0 new messages