Ebean enhancement Issue #13225
Replies: 3 comments 3 replies
-
|
Did this work before? If so, what changed now that it fails? Or is this a new or old project you are working on and just introduced ebean? |
Beta Was this translation helpful? Give feedback.
-
|
I have the same issue, just did my first installation on a testsystem, where I want to use an import feature of the installation wizard I included in my Play application. It always worked in dev-mode. Now I get this error when running the dist on a server and attempting the import. Doing this db connection at runtime is why I initially created the PR playframework/play-ebean#403 I am on Play 3, Java 21. @mkurz Do you have any idea how this could be solved? I'm not very familiar with the inner workings of Ebean. |
Beta Was this translation helpful? Give feedback.
-
|
I think I found a workaroung, by manually adding the model classes to the /**
* Register the model classes in the provided package in the provided database configuration.
* Side-effect; the method does not return anything,
* it adds the classes to the provided {@link DatabaseConfig} directly.
*
* @param dbConfig DatabaseConfig to register models to
* @param pkg Package containing the model classes (e.g., "com.example.models")
*/
private void registerModelClasses(DatabaseConfig dbConfig, String pkg) {
final var reflectionsConfigBuilder = new ConfigurationBuilder()
.addUrls(ClasspathHelper.forPackage(pkg, environment.classLoader()))
.setScanners(new TypeElementsScanner(), Scanners.TypesAnnotated, Scanners.SubTypes);
final var classNames = new Reflections(reflectionsConfigBuilder)
.getStore()
.getOrDefault(TypeElementsScanner.class.getSimpleName(), Collections.emptyMap())
.keySet();
for (var className : classNames) {
try {
dbConfig.addClass(Class.forName(className, true, environment.classLoader()));
} catch (ClassNotFoundException e) {
throw new RuntimeException("cannot register class [" + className + "] in import ebean server", e);
}
}
} |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've attempted to configure a session-level dynamic database connection. It works as expected in developer mode (sbt run), but fails in production mode (sbt runProd). Additionally, the ebean.mf file is not being generated during project compilation.
Has anyone encountered this issue? Here's the error I received:
My build.sbt
My plugins.sbt
My application.conf
Could anyone please help me to resolve this?
Beta Was this translation helpful? Give feedback.
All reactions