Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserProvider class not found - Play 2.4.x with Ebean 6.8.1 and play-ebean-2.0.0 #423

Closed
corrspt opened this issue Sep 24, 2015 · 12 comments
Closed

Comments

@corrspt
Copy link

corrspt commented Sep 24, 2015

Hi

I've been trying to setup Ebean 6.8.1 with the latest Play Framework, which was made possible yesterday with update of the play-ebean (version 2.0.0) plugin. I'm having trouble with the @ WhoUpdated / @ WhoCreatedAnnotation, because Ebean says it cannot find my Class

ebean.currentUserProvider=com.myproject.ebean.UserIdProvider

This is the Stacktrace

Caused by: java.lang.ClassNotFoundException: com.myproject.ebean.UserIdProvider
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.avaje.ebean.util.ClassUtil.newInstance(ClassUtil.java:17)

I did some debugging and found out that the classloader used had this info - Which does not seem to include my src directories (app/conf/test) and so makes sense that it cannot find my class.

PlayDependencyClassLoader{
file:/Users/useruser/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.6.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-enhancer/jars/play-enhancer-1.1.0.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/twirl-api_2.11/jars/twirl-api_2.11-1.1.1.jar, 
file:/Users/useruser/.ivy2/cache/org.apache.commons/commons-lang3/jars/commons-lang3-3.4.jar, 
file:/Users/useruser/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.1.jar, 
file:/Users/useruser/.ivy2/local/com.typesafe.play/play-ebean_2.11/1.0.1-SNAPSHOT/jars/play-ebean_2.11.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-java-jdbc_2.11/jars/play-java-jdbc_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-jdbc_2.11/jars/play-jdbc_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-jdbc-api_2.11/jars/play-jdbc-api_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play_2.11/jars/play_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/build-link/jars/build-link-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-exceptions/jars/play-exceptions-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/org.javassist/javassist/bundles/javassist-3.19.0-GA.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-iteratees_2.11/jars/play-iteratees_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/org.scala-stm/scala-stm_2.11/jars/scala-stm_2.11-0.7.jar,
file:/Users/useruser/.ivy2/cache/com.typesafe/config/bundles/config-1.3.0.jar,
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-json_2.11/jars/play-json_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-functional_2.11/jars/play-functional_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-datacommons_2.11/jars/play-datacommons_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/joda-time/joda-time/jars/joda-time-2.8.1.jar, 
file:/Users/useruser/.ivy2/cache/org.joda/joda-convert/jars/joda-convert-1.7.jar, 
file:/Users/useruser/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.6.jar, 
file:/Users/useruser/.ivy2/cache/com.fasterxml.jackson.core/jackson-core/bundles/jackson-core-2.5.4.jar, 
file:/Users/useruser/.ivy2/cache/com.fasterxml.jackson.core/jackson-annotations/bundles/jackson-annotations-2.5.4.jar, 
file:/Users/useruser/.ivy2/cache/com.fasterxml.jackson.core/jackson-databind/bundles/jackson-databind-2.5.4.jar, 
file:/Users/useruser/.ivy2/cache/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/bundles/jackson-datatype-jdk8-2.5.4.jar, 
file:/Users/useruser/.ivy2/cache/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/bundles/jackson-datatype-jsr310-2.5.4.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-netty-utils/jars/play-netty-utils-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.12.jar, 
file:/Users/useruser/.ivy2/cache/org.slf4j/jul-to-slf4j/jars/jul-to-slf4j-1.7.12.jar, 
file:/Users/useruser/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.12.jar, 
file:/Users/useruser/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.1.jar, 
file:/Users/useruser/.ivy2/cache/ch.qos.logback/logback-core/jars/logback-core-1.1.3.jar, 
file:/Users/useruser/.ivy2/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.1.3.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.akka/akka-actor_2.11/jars/akka-actor_2.11-2.3.11.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.akka/akka-slf4j_2.11/jars/akka-slf4j_2.11-2.3.11.jar, 
file:/Users/useruser/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.10.jar, 
file:/Users/useruser/.ivy2/cache/xerces/xercesImpl/jars/xercesImpl-2.11.0.jar, 
file:/Users/useruser/.ivy2/cache/xml-apis/xml-apis/jars/xml-apis-1.4.01.jar, 
file:/Users/useruser/.ivy2/cache/javax.transaction/jta/jars/jta-1.1.jar, 
file:/Users/useruser/.ivy2/cache/com.google.inject/guice/jars/guice-4.0.jar, 
file:/Users/useruser/.ivy2/cache/javax.inject/javax.inject/jars/javax.inject-1.jar, 
file:/Users/useruser/.ivy2/cache/aopalliance/aopalliance/jars/aopalliance-1.0.jar, 
file:/Users/useruser/.ivy2/cache/com.google.inject.extensions/guice-assistedinject/jars/guice-assistedinject-4.0.jar, 
file:/Users/useruser/.ivy2/cache/com.jolbox/bonecp/bundles/bonecp-0.8.0.RELEASE.jar, 
file:/Users/useruser/.ivy2/cache/com.zaxxer/HikariCP/bundles/HikariCP-2.3.7.jar, 
file:/Users/useruser/.ivy2/cache/com.h2database/h2/jars/h2-1.4.187.jar, 
file:/Users/useruser/.ivy2/cache/tyrex/tyrex/jars/tyrex-1.0.1.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-java_2.11/jars/play-java_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/org.scala-lang.modules/scala-java8-compat_2.11/bundles/scala-java8-compat_2.11-0.3.0.jar, 
file:/Users/useruser/.ivy2/cache/org.yaml/snakeyaml/bundles/snakeyaml-1.15.jar, 
file:/Users/useruser/.ivy2/cache/org.hibernate/hibernate-validator/jars/hibernate-validator-5.0.3.Final.jar, 
file:/Users/useruser/.ivy2/cache/javax.validation/validation-api/jars/validation-api-1.1.0.Final.jar, 
file:/Users/useruser/.ivy2/cache/com.fasterxml/classmate/bundles/classmate-1.0.0.jar, 
file:/Users/useruser/.ivy2/cache/org.jboss.logging/jboss-logging/jars/jboss-logging-3.2.1.Final.jar, 
file:/Users/useruser/.ivy2/cache/org.springframework/spring-context/jars/spring-context-4.1.6.RELEASE.jar, 
file:/Users/useruser/.ivy2/cache/org.springframework/spring-core/jars/spring-core-4.1.6.RELEASE.jar, 
file:/Users/useruser/.ivy2/cache/org.springframework/spring-beans/jars/spring-beans-4.1.6.RELEASE.jar, 
file:/Users/useruser/.ivy2/cache/org.reflections/reflections/jars/reflections-0.9.9.jar, 
file:/Users/useruser/.ivy2/cache/com.google.guava/guava/bundles/guava-18.0.jar, 
file:/Users/useruser/.ivy2/cache/com.google.code.findbugs/annotations/jars/annotations-2.0.1.jar, 
file:/Users/useruser/.ivy2/cache/net.jodah/typetools/bundles/typetools-0.4.1.jar, 
file:/Users/useruser/.ivy2/cache/com.google.code.findbugs/jsr305/jars/jsr305-2.0.3.jar, 
file:/Users/useruser/.ivy2/cache/org.apache.tomcat/tomcat-servlet-api/jars/tomcat-servlet-api-8.0.21.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-jdbc-evolutions_2.11/jars/play-jdbc-evolutions_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/org.avaje.ebeanorm/avaje-ebeanorm/jars/avaje-ebeanorm-6.8.1.jar, 
file:/Users/useruser/.ivy2/cache/org.jetbrains/annotations/jars/annotations-13.0.jar, 
file:/Users/useruser/.ivy2/cache/javax.persistence/persistence-api/jars/persistence-api-1.0.jar, 
file:/Users/useruser/.ivy2/cache/org.avaje.ebeanorm/avaje-ebeanorm-agent/jars/avaje-ebeanorm-agent-4.7.1.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-server_2.11/jars/play-server_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-netty-server_2.11/jars/play-netty-server_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/io.netty/netty/bundles/netty-3.10.3.Final.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.netty/netty-http-pipelining/jars/netty-http-pipelining-1.1.4.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-cache_2.11/jars/play-cache_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/net.sf.ehcache/ehcache-core/jars/ehcache-core-2.6.11.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-java-ws_2.11/jars/play-java-ws_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-ws_2.11/jars/play-ws_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/com.ning/async-http-client/jars/async-http-client-1.9.21.jar, 
file:/Users/useruser/.ivy2/cache/oauth.signpost/signpost-core/jars/signpost-core-1.2.1.2.jar, 
file:/Users/useruser/.ivy2/cache/oauth.signpost/signpost-commonshttp4/jars/signpost-commonshttp4-1.2.1.2.jar, 
file:/Users/useruser/.ivy2/cache/org.apache.httpcomponents/httpcore/jars/httpcore-4.0.1.jar, 
file:/Users/useruser/.ivy2/cache/org.apache.httpcomponents/httpclient/jars/httpclient-4.0.1.jar, 
file:/Users/useruser/.ivy2/cache/com.typesafe.play/play-java-jpa_2.11/jars/play-java-jpa_2.11-2.4.2.jar, 
file:/Users/useruser/.ivy2/cache/org.hibernate.javax.persistence/hibernate-jpa-2.1-api/jars/hibernate-jpa-2.1-api-1.0.0.Final.jar, 
file:/Users/useruser/.ivy2/cache/org.postgresql/postgresql/jars/postgresql-9.4-1201-jdbc41.jar, 
file:/Users/useruser/.ivy2/cache/org.flywaydb/flyway-play_2.11/jars/flyway-play_2.11-2.1.0.jar, 
file:/Users/useruser/.ivy2/cache/org.flywaydb/flyway-core/jars/flyway-core-3.1.jar, 
file:/Users/useruser/.ivy2/cache/org.bitbucket.b_c/jose4j/jars/jose4j-0.4.1.jar, 
file:/Users/useruser/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.2.jar, 
file:/Users/useruser/.ivy2/cache/org.hamcrest/hamcrest-all/jars/hamcrest-all-1.3.jar, 
file:/Users/useruser/.ivy2/cache/io.katharsis/katharsis-core/jars/katharsis-core-0.9.4.jar, 
file:/Users/useruser/.ivy2/cache/com.ninja-squad/DbSetup/jars/DbSetup-1.6.0.jar, 
file:/Users/useruser/.ivy2/cache/org.jmockit/jmockit/jars/jmockit-1.19.jar}

I've tried setting the ServerConfig class with the implementation of my UserProvider on application startup but to no avail. Any ideas?

I've found this discussion regarding the use of Class.forName in play framework / libraries if that helps.

@dastultz
Copy link
Contributor

On Thu, Sep 24, 2015 at 5:44 AM, corrspt notifications@github.com wrote:

Hi

I've been trying to setup Ebean 6.8.1 with the latest Play Framework,
which was made possible yesterday with update of the play-ebean (version
2.0.0) plugin. I'm having trouble with the @ WhoUpdated / @
WhoCreatedAnnotation, because Ebean says it cannot find my Class

Hi. Rob, the main developer is on vacation ("holiday") for a another week.
I don't know how to help on this one.

/Daryl

@corrspt
Copy link
Author

corrspt commented Sep 25, 2015

Hi Daryl, thanks for replying!

Well, Rob certainly deserves his vacations so we'll just wait for him to come back 👍

Meanwhile, from the discussions I found on the link I posted before, it seems the solution would be (somehow) to pass a classloader instance to the ClassUtil class. I'm not quite sure how would we do that without code (for instance in an application bootstrap process).

I did try somethings on Play's onStart / beforeStart methods (like creating an instance of the UserProvider and setting it up in the serverConfig) but sometime later some code would again initialize the EbeanServer from the properties file (and this time around it didn't use my UserProvider instance). I thought it should only create the EbeanServer once but it seems not.

@rbygrave
Copy link
Member

I've tried setting the ServerConfig class with the implementation of my UserProvider on application startup but to no avail. Any ideas?

Can you should how you went about doing that. Did you use ServerConfig.setCurrentUserProvider() ?

@corrspt
Copy link
Author

corrspt commented Oct 1, 2015

Hey Rob, welcome back, hope you had a nice vacation!

I apparently deleted the branch with this experiment, dumb me. I was trying to replicate the behavior again but I've stumbled upon a different error (one I remember I had before I reached the point which led to me create the issue).

As I said, I'm using the Play-Framework with the Play-ebean plugin

Plugins.sbt
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "2.0.0")

I've used this as an implementation of the CurrentUserProvider

package com.myproject.ebean;
public class UserIdProvider implements CurrentUserProvider {

    public UserIdProvider() {}

    @Override
    public Object currentUser() {
        return Session.getCurrentAccountId(); //Returns a long
    }

}

I've tried both approaches, having this in my ebean.properties:
ebean.currentUserProvider=com.myproject.ebean.UserIdProvider

And something like this (application.conf)
application.global=com.myproject.global.Global

And the content of the class being something like this

import play.*;

public class Global extends GlobalSettings {

    public void onStart(Application app) {

    ServerConfig config = new ServerConfig();
    config.setName("default");
    config.loadFromProperties();
    config.setCurrentUserProvider(new UserIdProvider());
    config.setDefaultServer(true);

    EbeanServerFactory.create(config);
    }

}

The thing I've noticed is that I've had various troubles trying to make Ebean work standalone, meaning without the play-ebean plugin (especially the enhancer part, I've even built from source the eclipse plugin at it was logging that enhancements were being made, but the play application did not pick them up. I suppose it's because it uses some sort of different mechanism to load classes). I've had this on the onStart as well

if (!AgentLoader.loadAgentFromClasspath("avaje-ebeanorm-agent",
                "debug=9;packages=com.myproject.models.**")) {
            throw new RuntimeException("Could not load the Ebean Enhancer Agent");
        }

I'm now getting this stack trace.

2) Error injecting constructor, java.lang.RuntimeException: Error reading annotations for com.myproject.models.Position
  at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:36)
  at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:33)
  while locating play.db.ebean.EbeanDynamicEvolutions
  at play.db.ebean.EbeanModule.bindings(EbeanModule.java:23):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
  while locating play.api.db.evolutions.DynamicEvolutions
  while locating play.api.db.evolutions.ApplicationEvolutionsProvider
  at play.api.db.evolutions.EvolutionsModule.bindings(EvolutionsModule.scala:22):
Binding(class play.api.db.evolutions.ApplicationEvolutions to ProviderConstructionTarget(class play.api.db.evolutions.ApplicationEvolutionsProvider) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
  while locating play.api.db.evolutions.ApplicationEvolutions
Caused by: java.lang.RuntimeException: Error reading annotations for com.myproject.models.Position
    at com.avaje.ebeaninternal.server.deploy.parse.ReadAnnotations.readInitial(ReadAnnotations.java:58)
    at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.createDeployBeanInfo(BeanDescriptorManager.java:1037)
    at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityDeploymentInitial(BeanDescriptorManager.java:533)
    at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:280)
    at com.avaje.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:129)
    at com.avaje.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:124)
    at com.avaje.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:41)
    at com.avaje.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
    at com.avaje.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
    at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:53)
    at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:39)
    at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$$52c94231.newInstance(<generated>)
    at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
    at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
    at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321)
    at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:316)
    at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:53)
    at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:53)
    at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:44)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
    at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
    at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    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:1092)
    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:96)
    at com.google.inject.Guice.createInjector(Guice.java:73)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
    at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
    at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:153)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:150)
    at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:150)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:121)
    at scala.Option.map(Option.scala:146)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:121)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:119)
    at scala.util.Success.flatMap(Try.scala:230)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:119)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:111)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
    at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.IllegalStateException: No CurrentUserProvider has been set so @WhoModified is not supported
    at com.avaje.ebeaninternal.server.deploy.generatedproperty.GeneratedPropertyFactory.setWhoModified(GeneratedPropertyFactory.java:83)
    at com.avaje.ebeaninternal.server.deploy.parse.AnnotationFields.readField(AnnotationFields.java:216)
    at com.avaje.ebeaninternal.server.deploy.parse.AnnotationFields.parse(AnnotationFields.java:69)
    at com.avaje.ebeaninternal.server.deploy.parse.ReadAnnotations.readInitial(ReadAnnotations.java:55)
    ... 75 more

2 errors
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466) ~[guice-4.0.jar:na]
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184) ~[guice-4.0.jar:na]
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110) ~[guice-4.0.jar:na]
    at com.google.inject.Guice.createInjector(Guice.java:96) ~[guice-4.0.jar:na]
    at com.google.inject.Guice.createInjector(Guice.java:73) ~[guice-4.0.jar:na]
    at com.google.inject.Guice.createInjector(Guice.java:62) ~[guice-4.0.jar:na]
    at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:153) ~[play-server_2.11-2.4.2.jar:2.4.2]
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:150) ~[play-server_2.11-2.4.2.jar:2.4.2]
    at play.utils.Threads$.withContextClassLoader(Threads.scala:21) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:150) ~[play-server_2.11-2.4.2.jar:2.4.2]
    ... 14 common frames omitted

Isn't the Ebean Server supposed to be a singleton? The problem here seems to be that my server configuration is being discarded and a new one is being created. Any ideas?

@rbygrave
Copy link
Member

rbygrave commented Oct 1, 2015

> The problem here seems to be that my server configuration is being
discarded and a new one is being created. Any ideas?

I think what you are doing in public class Global is in conflict with
Play's DefaultEbeanConfig (
https://github.com/playframework/play-ebean/blob/master/play-ebean/src/main/java/play/db/ebean/DefaultEbeanConfig.java
).

That is, I think that DefaultEbeanConfig.parse() method is where the
ServerConfig is created for the EbeanServer instance rather than the Global.

> I've tried both approaches, having this in my
ebean.properties: ebean.currentUserProvider=com.myproject.ebean.UserIdProvider

What happens in that case?

On 1 October 2015 at 20:38, corrspt notifications@github.com wrote:

Hey Rob, welcome back, hope you had a nice vacation!

I apparently deleted the branch with this experiment, dumb me. I was
trying to replicate the behavior again but I've stumbled upon a different
error (one I remember I had before I reached the point which led to me
create the issue).

As I said, I'm using the Play-Framework with the Play-ebean plugin

Plugins.sbt
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "2.0.0")

I've used this as an implementation of the CurrentUserProvider

package com.myproject.ebean;public class UserIdProvider implements CurrentUserProvider {

public UserIdProvider() {}

@Override
public Object currentUser() {
    return Session.getCurrentAccountId(); //Returns a long
}

}

I've tried both approaches, having this in my ebean.properties:
ebean.currentUserProvider=com.myproject.ebean.UserIdProvider

And something like this (application.conf)
application.global=com.myproject.global.Global

And the content of the class being something like this

import play.*;
public class Global extends GlobalSettings {

public void onStart(Application app) {

ServerConfig config = new ServerConfig();
config.setName("default");
config.loadFromProperties();
config.setCurrentUserProvider(new UserIdProvider());
config.setDefaultServer(true);

EbeanServerFactory.create(config);
}

}

The thing I've noticed is that I've had various troubles trying to make
Ebean work standalone, meaning without the play-ebean plugin (especially
the enhancer part, I've even built from source the eclipse plugin at it was
logging that enhancements were being made, but the play application did not
pick them up. I suppose it's because it uses some sort of different
mechanism to load classes). I've had this on the onStart as well

if (!AgentLoader.loadAgentFromClasspath("avaje-ebeanorm-agent",
"debug=9;packages=com.myproject.models.**")) {
throw new RuntimeException("Could not load the Ebean Enhancer Agent");
}

I'm now getting this stack trace.

  1. Error injecting constructor, java.lang.RuntimeException: Error reading annotations for com.myproject.models.Position
    at play.db.ebean.EbeanDynamicEvolutions.(EbeanDynamicEvolutions.java:36)
    at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:33)
    while locating play.db.ebean.EbeanDynamicEvolutions
    at play.db.ebean.EbeanModule.bindings(EbeanModule.java:23):
    Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
    while locating play.api.db.evolutions.DynamicEvolutions
    while locating play.api.db.evolutions.ApplicationEvolutionsProvider
    at play.api.db.evolutions.EvolutionsModule.bindings(EvolutionsModule.scala:22):
    Binding(class play.api.db.evolutions.ApplicationEvolutions to ProviderConstructionTarget(class play.api.db.evolutions.ApplicationEvolutionsProvider) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
    while locating play.api.db.evolutions.ApplicationEvolutions
    Caused by: java.lang.RuntimeException: Error reading annotations for com.myproject.models.Position
    at com.avaje.ebeaninternal.server.deploy.parse.ReadAnnotations.readInitial(ReadAnnotations.java:58)
    at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.createDeployBeanInfo(BeanDescriptorManager.java:1037)
    at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityDeploymentInitial(BeanDescriptorManager.java:533)
    at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:280)
    at com.avaje.ebeaninternal.server.core.InternalConfiguration.(InternalConfiguration.java:129)
    at com.avaje.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:124)
    at com.avaje.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:41)
    at com.avaje.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:108)
    at com.avaje.ebean.EbeanServerFactory.create(EbeanServerFactory.java:67)
    at play.db.ebean.EbeanDynamicEvolutions.start(EbeanDynamicEvolutions.java:53)
    at play.db.ebean.EbeanDynamicEvolutions.(EbeanDynamicEvolutions.java:39)
    at play.db.ebean.EbeanDynamicEvolutions$$FastClassByGuice$$52c94231.newInstance()
    at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
    at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
    at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321)
    at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:316)
    at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:53)
    at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:53)
    at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:44)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
    at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
    at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    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:1092)
    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:96)
    at com.google.inject.Guice.createInjector(Guice.java:73)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
    at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
    at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:153)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:150)
    at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:150)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:121)
    at scala.Option.map(Option.scala:146)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:121)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:119)
    at scala.util.Success.flatMap(Try.scala:230)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:119)
    at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:111)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
    at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
    Caused by: java.lang.IllegalStateException: No CurrentUserProvider has been set so @WhoModified is not supported
    at com.avaje.ebeaninternal.server.deploy.generatedproperty.GeneratedPropertyFactory.setWhoModified(GeneratedPropertyFactory.java:83)
    at com.avaje.ebeaninternal.server.deploy.parse.AnnotationFields.readField(AnnotationFields.java:216)
    at com.avaje.ebeaninternal.server.deploy.parse.AnnotationFields.parse(AnnotationFields.java:69)
    at com.avaje.ebeaninternal.server.deploy.parse.ReadAnnotations.readInitial(ReadAnnotations.java:55)
    ... 75 more

2 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466) ~[guice-4.0.jar:na]
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184) ~[guice-4.0.jar:na]
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110) ~[guice-4.0.jar:na]
at com.google.inject.Guice.createInjector(Guice.java:96) ~[guice-4.0.jar:na]
at com.google.inject.Guice.createInjector(Guice.java:73) ~[guice-4.0.jar:na]
at com.google.inject.Guice.createInjector(Guice.java:62) ~[guice-4.0.jar:na]
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126) ~[play_2.11-2.4.2.jar:2.4.2]
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93) ~[play_2.11-2.4.2.jar:2.4.2]
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21) ~[play_2.11-2.4.2.jar:2.4.2]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:153) ~[play-server_2.11-2.4.2.jar:2.4.2]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:150) ~[play-server_2.11-2.4.2.jar:2.4.2]
at play.utils.Threads$.withContextClassLoader(Threads.scala:21) ~[play_2.11-2.4.2.jar:2.4.2]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:150) ~[play-server_2.11-2.4.2.jar:2.4.2]
... 14 common frames omitted

Isn't the Ebean Server supposed to be a singleton? The problem here seems
to be that my server configuration is being discarded and a new one is
being created. Any ideas?


Reply to this email directly or view it on GitHub
#423 (comment)
.

@corrspt
Copy link
Author

corrspt commented Oct 1, 2015

Makes sense what you say about the ServerConfig being created there on DefaultEbeanConfig.java

I've tried again setting the currentUserProvider in the ebean.properties file (which is under my conf directory) but to no avail. I do get the same error as before.

One interesting thing though, I added that same property in the application.conf and now I get a:

Caused by: Configuration error: Configuration error[null]
    at play.api.Configuration$.configError(Configuration.scala:178)
    at play.api.Configuration.reportError(Configuration.scala:829)
    at play.Configuration.reportError(Configuration.java:351)
    at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.parse(DefaultEbeanConfig.java:81)
    at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.get(DefaultEbeanConfig.java:60)
    at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.get(DefaultEbeanConfig.java:44)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
    at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
    at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)

Trying to figure out what I can do through the application.conf file, maybe that's the trick.

@rbygrave
Copy link
Member

rbygrave commented Oct 1, 2015

> I do get the same error as before.

What was that error?

On 1 October 2015 at 21:16, corrspt notifications@github.com wrote:

Makes sense what you say about the ServerConfig being created there on
DefaultEbeanConfig.java

I've tried again setting the currentUserProvider in the ebean.properties
file (which is under my conf directory) but to no avail. I do get the same
error as before.

One interesting thing though, I added that same property in the
application.conf and now I get a:

Caused by: Configuration error: Configuration error[null]
at play.api.Configuration$.configError(Configuration.scala:178)
at play.api.Configuration.reportError(Configuration.scala:829)
at play.Configuration.reportError(Configuration.java:351)
at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.parse(DefaultEbeanConfig.java:81)
at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.get(DefaultEbeanConfig.java:60)
at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.get(DefaultEbeanConfig.java:44)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)

Trying to figure out what I can do through the application.conf file,
maybe that's the trick.


Reply to this email directly or view it on GitHub
#423 (comment)
.

@corrspt
Copy link
Author

corrspt commented Oct 1, 2015

Sorry Rob, should've made it more clear. Thanks for the help (and sorry for making your life harder)

This error

Caused by: java.lang.IllegalStateException: No CurrentUserProvider has been set so @WhoModified is not supported

@rbygrave
Copy link
Member

rbygrave commented Dec 7, 2015

I'm not sure where we are at with this issue. If this issue relates to the need to use the context classLoader to create the CurrentUserProvider instance when using properties ... then this might be fixed with #476.

@corrspt
Copy link
Author

corrspt commented Dec 9, 2015

Sorry for the late reply @rbygrave. Thanks for remembering this.

I'm using the play-ebean plugin which in the latest stable release uses version 6.8.1 of Ebean (I see that they have a 3.0.0M1 release on github which seems to upgrade to version 6.10.3 of Ebean, I could try that). I can try to fork the play-ebean and upgrade locally to check if things work, but then I couldn't deploy to Heroku because of the fork not being on maven central, I think!

Can I just include the latest ebean on my build.sbt to try it out? I understand this might not be your area of expertise, but I ask anyway as you may know. I'll try opening an issue with play-ebean to know more about how to upgrade the included library.

I'm currently short on time, but I would like to give feedback on this. The biggest hurdle is how to upgrade to the latest ebean.

Thanks again for the great work on Ebean, I'm very fond of it.

EDIT:
I've opened an issue with play-ebean to check if someone can help me out on this.

@rbygrave
Copy link
Member

how to upgrade to the latest ebean.

Yes. You might be able to just include the latest ebean on my build.sbt. There was a need to fork the play-ebean project as there was some API changes that occurred so some changes were needed in play-ebean ... it might be that is not required now and that just getting the newer dependency will be sufficient.

So yes, not sure I'm afraid.

@corrspt
Copy link
Author

corrspt commented Feb 14, 2016

Sorry for the very very late reply to this. I've tried to upgrade Ebean directly on my play project (overriding the one used by play ebean) and it works so I tried this afterward and the problem didn't occur, so I'm closing this issue.

I can't upgrade yet because the code I had to generate the ddl migrations is not recognizing my previous migration files, but that is probably some mistake I did, I presume.

Thanks a lot for everything @rbygrave

@corrspt corrspt closed this as completed Feb 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants