[2.5 Java] Which mongo plugin?

375 views
Skip to first unread message

Enrico Morelli

unread,
Mar 7, 2016, 10:20:27 AM3/7/16
to play-framework
Until Play 2.5 I used jongo + play-jongo to use MongoDB. With 2.5 which is the plugin I've to use to connect to Mongo?

Greg Methvin

unread,
Mar 7, 2016, 1:01:57 PM3/7/16
to play-framework
It seems like it only works for 2.4 but there is an open issue for it.

The migration for Play modules is not as much as it was in 2.4, so it should not be too difficult for library authors to update.

On Mon, Mar 7, 2016 at 7:20 AM, Enrico Morelli <enrico....@gmail.com> wrote:
Until Play 2.5 I used jongo + play-jongo to use MongoDB. With 2.5 which is the plugin I've to use to connect to Mongo?

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/cda0d599-022d-448f-bb20-390518677de8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Senior Software Engineer

Enrico Morelli

unread,
Mar 8, 2016, 4:23:11 AM3/8/16
to play-framework


On Monday, March 7, 2016 at 7:01:57 PM UTC+1, Greg Methvin wrote:
It seems like it only works for 2.4 but there is an open issue for it.

The migration for Play modules is not as much as it was in 2.4, so it should not be too difficult for library authors to update.



I opened the issue ;-)

Play! is a wonderful and modern framework, but I think should have an official  MongoDB plugin like the various SQL ORM linked in the documentation.

Greg Methvin

unread,
Mar 9, 2016, 8:11:46 PM3/9/16
to play-framework
Honestly, we would rather officially support fewer of those ORMs, just because having to update, maintain, and document them is a pretty significant burden on the Play team. The ideal is that we make it easy enough to integrate with Play that the library authors can easily update things without our help. Usually, if the library is well-maintained, it will be updated within a week or two of the release.

For a lot of third-party libraries it's not difficult to integrate with Play yourself. Usually the only things you need to do are create a component to integrate with the application lifecycle and maybe create a few bindings for dependency injection.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Igmar Palsenberg

unread,
Mar 10, 2016, 12:52:43 PM3/10/16
to play-framework
 
Honestly, we would rather officially support fewer of those ORMs, just because having to update, maintain, and document them is a pretty significant burden on the Play team. The ideal is that we make it easy enough to integrate with Play that the library authors can easily update things without our help. Usually, if the library is well-maintained, it will be updated within a week or two of the release.

For a lot of third-party libraries it's not difficult to integrate with Play yourself. Usually the only things you need to do are create a component to integrate with the application lifecycle and maybe create a few bindings for dependency injection.

It would be nice if this was documented somewhere, or an example on Github. Making a library DI aware is sometime a real challenge. And a "how to make it work nicely with Play" would be a nice thing to have.


Igmar 

Will Sargent

unread,
Mar 10, 2016, 11:26:57 PM3/10/16
to play-fr...@googlegroups.com
It would be nice if this was documented somewhere, or an example on Github. Making a library DI aware is sometime a real challenge. And a "how to make it work nicely with Play" would be a nice thing to have.

Igmar Palsenberg

unread,
Mar 11, 2016, 2:56:07 AM3/11/16
to play-framework
 
It would be nice if this was documented somewhere, or an example on Github. Making a library DI aware is sometime a real challenge. And a "how to make it work nicely with Play" would be a nice thing to have.


That's more targeted at old Play plugins to become DI modules. I'm talking about having an existing Java library, taking it apart, make it DI ready, and if applicable, also make it asynchronous.

That's quite hard, especially if you haven't done that a lot. At least, on the library I tried :-)


Igmar

Enrico Morelli

unread,
Mar 11, 2016, 8:22:05 AM3/11/16
to play-framework


On Thursday, March 10, 2016 at 2:11:46 AM UTC+1, Greg Methvin wrote:
Honestly, we would rather officially support fewer of those ORMs, just because having to update, maintain, and document them is a pretty significant burden on the Play team. The ideal is that we make it easy enough to integrate with Play that the library authors can easily update things without our help. Usually, if the library is well-maintained, it will be updated within a week or two of the release.

For a lot of third-party libraries it's not difficult to integrate with Play yourself. Usually the only things you need to do are create a component to integrate with the application lifecycle and maybe create a few bindings for dependency injection.



But what are  the differences between 2.4 and 2.5 modules? I tried a lot of 2.4 modules on 2.5 and the majority of them didn't works.
I have read the module documentation and, e.g., the JongoModule.java follow the specification but it's evicted by Play! 2.5.

So
there might  be some difference that is not included in the documentation?

Igmar Palsenberg

unread,
Mar 11, 2016, 8:52:03 AM3/11/16
to play-framework

But what are  the differences between 2.4 and 2.5 modules? I tried a lot of 2.4 modules on 2.5 and the majority of them didn't works.
I have read the module documentation and, e.g., the JongoModule.java follow the specification but it's evicted by Play! 2.5.

So
there might  be some difference that is not included in the documentation?

Modules don't exist anymore in 2.5. A "module" in 2.5 is just a bunch of classes that are bound in DI.


Igmar

Enrico Morelli

unread,
Mar 11, 2016, 9:04:13 AM3/11/16
to play-framework


Thanks for information, but then the documentation is incorrect because on https://playframework.com/documentation/2.5.x/JavaPlayModules I read: "in 2.5.x, Plugins have been replaced with Play modules.".

Please, my head is near to explode :-o , where I can find instruction to be able to use/create 2.5 libraries?

Igmar Palsenberg

unread,
Mar 11, 2016, 9:18:54 AM3/11/16
to play-framework
 
Thanks for information, but then the documentation is incorrect because on https://playframework.com/documentation/2.5.x/JavaPlayModules I read: "in 2.5.x, Plugins have been replaced with Play modules.".

The documentation is fine : Plugins are out, modules are in. A "module" is just classes bound in DI.


Igmar

Enrico Morelli

unread,
Mar 11, 2016, 10:24:05 AM3/11/16
to play-framework

Ok, I'm going crazy.  So in the 2.5 documentation the example is:

public class MyModule extends play.api.inject.Module {
   
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
       
return seq(
                bind
(MyApi.class).toSelf()
       
);
   
}
}


The JongoModule is the following:

public class JongoModule extends Module {

   
@Override
   
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
       
return seq(bind(PlayJongo.class).toSelf());
   
}
}

 
which may be the incompatibility? What other things I've to check?

raunak

unread,
Mar 11, 2016, 8:33:28 PM3/11/16
to play-framework
I'm a bit confused. Is there an error you're getting Enrico whilst using PlayJongo?

Enrico Morelli

unread,
Mar 14, 2016, 4:38:15 AM3/14/16
to play-framework


On Saturday, March 12, 2016 at 2:33:28 AM UTC+1, raunak wrote:
I'm a bit confused. Is there an error you're getting Enrico whilst using PlayJongo?

Yes. The module is evicted by Play.

[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn]     * com.typesafe.play:play-netty-server_2.11:2.4.2 -> 2.5.0 (caller: docarchive:docarchive_2.11:1.0-SNAPSHOT, uk.co.panaxiom:play-jongo_2.11:1.0.1-jongo1.2)
[warn]     * com.typesafe.play:play-java_2.11:2.4.2 -> 2.5.0 (caller: com.typesafe.play:filters-helpers_2.11:2.5.0, docarchive:docarchive_2.11:1.0-SNAPSHOT, com.typesafe.play:play-java-jdbc_2.11:2.5.0, uk.co.panaxiom:play-jongo_2.11:1.0.1-jongo1.2, com.typesafe.play:play-java-ws_2.11:2.5.0)

If I remove PlayJongo from build.sbt all works fine.

Igmar Palsenberg

unread,
Mar 14, 2016, 5:47:36 AM3/14/16
to play-framework

Yes. The module is evicted by Play.

[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn]     * com.typesafe.play:play-netty-server_2.11:2.4.2 -> 2.5.0 (caller: docarchive:docarchive_2.11:1.0-SNAPSHOT, uk.co.panaxiom:play-jongo_2.11:1.0.1-jongo1.2)
[warn]     * com.typesafe.play:play-java_2.11:2.4.2 -> 2.5.0 (caller: com.typesafe.play:filters-helpers_2.11:2.5.0, docarchive:docarchive_2.11:1.0-SNAPSHOT, com.typesafe.play:play-java-jdbc_2.11:2.5.0, uk.co.panaxiom:play-jongo_2.11:1.0.1-jongo1.2, com.typesafe.play:play-java-ws_2.11:2.5.0)

If I remove PlayJongo from build.sbt all works fine.

Looks like it depends on Play 2.4, which isn't compatible with 2.5 on a binary level.  

Greg Methvin

unread,
Mar 14, 2016, 6:14:23 AM3/14/16
to play-framework
An eviction warning in sbt just tells you it is using the newer version of those libraries. It's quite possible everything works just fine if play-jongo doesn't happen to use any of the things that changed between the releases, though it would obviously be better if they built off Play 2.5 so you know for sure.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Enrico Morelli

unread,
Mar 14, 2016, 6:26:25 AM3/14/16
to play-framework


You are ready. I recompiled using 2.5 libraries and it works fine.

Thanks
Reply all
Reply to author
Forward
0 new messages