Error with JPA since 2.6

225 views
Skip to first unread message

Pflieger Arnaud

unread,
Jun 25, 2017, 7:17:23 PM6/25/17
to Play Framework
Hi,

I just upgraded to 2.6, so first of all thanks for this new version! 

I get this error:
  • 1) Error injecting constructor, com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'jpa'
  • 2017-06-24T21:59:13.290+02:00com.google.inject.CreationException: Unable to create injector, see the following errors:
  • 2017-06-24T21:59:13.290+02:00Oops, cannot start the server.
  • 2017-06-24T21:59:13.291+02:00at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:37)
  • 2017-06-24T21:59:13.291+02:00at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:270)
  • 2017-06-24T21:59:13.291+02:00at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:264)
  • 2017-06-24T21:59:13.291+02:00at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
  • 2017-06-24T21:59:13.291+02:00at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
  • 2017-06-24T21:59:13.291+02:00at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170)
  • 2017-06-24T21:59:13.291+02:00at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152)

If  i get it well, it tries to inject a JPAApi but I don't define one.
I guess it has something to do with persistance unit, I'm using EBean and I don't know how to define one. The documentation mention only Hibernate (https://www.playframework.com/documentation/2.6.x/JavaJPA#Creating-a-Persistence-Unit).
Why was it working before 2.6 ? I'm confused.

Marcos Pereira

unread,
Jun 26, 2017, 6:27:47 PM6/26/17
to play-fr...@googlegroups.com
Hey Pflieger,

Your message is corrupted and I can see the stack trace. Could you please try to post it again?

Best.

--
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-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/012defec-4741-4fb6-b174-a9ae7a2fdffc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcos Pereira
Software Engineer, Lightbend.com

Arnaud Pflieger

unread,
Jul 16, 2017, 12:22:48 PM7/16/17
to Play Framework
I managed to make it work. Sorry for the noise.

Sagar BM

unread,
Aug 3, 2017, 5:11:11 AM8/3/17
to Play Framework
Hi, 
   i am also getting same issue
   i am using play 2.6.1 with ebean

  Error injecting constructor, com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'jpa'
  at play.db.jpa.DefaultJPAConfig$JPAConfigProvider.<init>(DefaultJPAConfig.java:42)
  at play.db.jpa.DefaultJPAConfig$JPAConfigProvider.class(DefaultJPAConfig.java:37)
  while locating play.db.jpa.DefaultJPAConfig$JPAConfigProvider
Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'jpa'
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:264)
at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:270)
at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:37)
at play.db.jpa.DefaultJPAConfig$JPAConfigProvider.<init>(DefaultJPAConfig.java:44)
at play.db.jpa.DefaultJPAConfig$JPAConfigProvider$$FastClassByGuice$$2499574f.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:185)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.ProdServerStart$.start(ProdServerStart.scala:47)
at play.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
at play.core.server.ProdServerStart.main(ProdServerStart.scala)

Sagar BM

unread,
Aug 3, 2017, 5:11:11 AM8/3/17
to Play Framework
how you solved this issue? please help.

Arnaud Pflieger

unread,
Aug 3, 2017, 5:56:45 AM8/3/17
to Play Framework
I added an empty jpa config key in application.conf

jpa {}

Greg Methvin

unread,
Aug 4, 2017, 2:04:45 AM8/4/17
to play-framework
Are you actually using the JPA module? If you're not setting any configuration for it I'd assume you're not using it at all, so the best solution is to remove it from your project (normally it's referenced as javaJpa in your build.sbt).

The fact that it throws an exception if it can't find the "jpa" key is a bug, though, because it's not defined in reference.conf like it should be. That bug will be fixed soon in 2.6.3.

--
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-framework+unsubscribe@googlegroups.com.

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



--
Greg Methvin
Tech Lead - Play Framework

Arnaud Pflieger

unread,
Aug 4, 2017, 3:16:26 AM8/4/17
to Play Framework
I am using JPA


Le vendredi 4 août 2017 08:04:45 UTC+2, Greg Methvin a écrit :
Are you actually using the JPA module? If you're not setting any configuration for it I'd assume you're not using it at all, so the best solution is to remove it from your project (normally it's referenced as javaJpa in your build.sbt).

The fact that it throws an exception if it can't find the "jpa" key is a bug, though, because it's not defined in reference.conf like it should be. That bug will be fixed soon in 2.6.3.
On Thu, Aug 3, 2017 at 2:56 AM, Arnaud Pflieger <pfliege...@gmail.com> wrote:
I added an empty jpa config key in application.conf

jpa {}

Le jeudi 3 août 2017 11:11:11 UTC+2, Sagar BM a écrit :
how you solved this issue? please help.

--
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.

Greg Methvin

unread,
Aug 4, 2017, 3:32:49 AM8/4/17
to play-framework
Ok, because if you use it as mentioned in the docs, you would have already defined jpa.default (so wouldn't need to define the empty jpa object): https://www.playframework.com/documentation/2.6.x/JavaJPA#Creating-a-Persistence-Unit

To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/40a94710-f1fe-4d10-860b-25a6173a9f4f%40googlegroups.com.

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

Arnaud Pflieger

unread,
Aug 4, 2017, 4:50:12 AM8/4/17
to Play Framework
Hm, I don't use a persistence unit actually, I'm using EBean directly with javax.persistence annotations so I guess I don't need the JavaJpa module.

Le vendredi 4 août 2017 09:32:49 UTC+2, Greg Methvin a écrit :
Ok, because if you use it as mentioned in the docs, you would have already defined jpa.default (so wouldn't need to define the empty jpa object): https://www.playframework.com/documentation/2.6.x/JavaJPA#Creating-a-Persistence-Unit
On Fri, Aug 4, 2017 at 12:16 AM, Arnaud Pflieger <pfliege...@gmail.com> wrote:
I am using JPA

Le vendredi 4 août 2017 08:04:45 UTC+2, Greg Methvin a écrit :
Are you actually using the JPA module? If you're not setting any configuration for it I'd assume you're not using it at all, so the best solution is to remove it from your project (normally it's referenced as javaJpa in your build.sbt).

The fact that it throws an exception if it can't find the "jpa" key is a bug, though, because it's not defined in reference.conf like it should be. That bug will be fixed soon in 2.6.3.

On Thu, Aug 3, 2017 at 2:56 AM, Arnaud Pflieger <pfliege...@gmail.com> wrote:
I added an empty jpa config key in application.conf

jpa {}

Le jeudi 3 août 2017 11:11:11 UTC+2, Sagar BM a écrit :
how you solved this issue? please help.

--
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/0d9593d4-940b-4763-a962-311153d3f38a%40googlegroups.com.

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



--
Greg Methvin
Tech Lead - Play Framework

--
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.

Rich Dougherty

unread,
Aug 12, 2017, 2:45:24 AM8/12/17
to play-framework
On Fri, Aug 4, 2017 at 6:03 PM, Greg Methvin <gr...@lightbend.com> wrote:
Are you actually using the JPA module? If you're not setting any configuration for it I'd assume you're not using it at all, so the best solution is to remove it from your project (normally it's referenced as javaJpa in your build.sbt).

The fact that it throws an exception if it can't find the "jpa" key is a bug, though, because it's not defined in reference.conf like it should be. That bug will be fixed soon in 2.6.3.

Play 2.6.3 is out now. If anyone has a chance to check that this works for them now that would be much appreciated. :) 

Cheers
Rich

--
Rich Dougherty
Engineer, Lightbend, Inc

Arnaud Pflieger

unread,
Aug 21, 2017, 6:36:03 PM8/21/17
to Play Framework
I removed the jpa{} key but I didn't reproduced the problem even in 2.6.1 I don't know why
I upgraded to 2.6.3, seems good

Thanks !

Rich Dougherty

unread,
Aug 22, 2017, 6:50:50 PM8/22/17
to play-framework
Thanks for checking, glad it's working for you now :)

--
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-framework+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages