I modified the sample blog app , added tons of tables (with data) / POJOs / DAOs
But I found I cannot start ninja , no matter jetty:run or ninja:run , it reports :
22:31:12.829 INFO Ninja - Using default eh cache implementation. (class ninja.cache.CacheEhCacheImpl)
22:31:13.422 INFO ninja.servlet.NinjaBootstap - Ninja injector started in 1799 ms.
22:31:13.423 INFO ninja.lifecycle.LifecycleServiceImpl - Starting Ninja application...
22:31:15.118 WARN o.e.j.u.component.AbstractLifeCycle - FAILED o.e.j.s.ServletContextHandler@56ac3a89{/,null,STARTING}: ninja.lifecycle.FailedStartException: com.googlecode.flyway.core.api.FlywayException: Found non-empty schema `ninja-data` without metadata table! Use init() first to initialize the metadata table.
ninja.lifecycle.FailedStartException: com.googlecode.flyway.core.api.FlywayException: Found non-empty schema `ninja-data` without metadata table! Use init() first to initialize the metadata table.
at ninja.lifecycle.LifecycleRegister.invokeTarget(LifecycleRegister.java:102) ~[ninja-core-2.5.1.jar:na]
at ninja.lifecycle.LifecycleRegister.start(LifecycleRegister.java:54) ~[ninja-core-2.5.1.jar:na]
at ninja.lifecycle.LifecycleServiceImpl.start(LifecycleServiceImpl.java:78) ~[ninja-core-2.5.1.jar:na]
at ninja.NinjaImpl.start(NinjaImpl.java:115) ~[ninja-core-2.5.1.jar:na]
It instructs me to run init() first .
But where should I put the code ?
The StartupActions.java ?
In application.conf , I set :
ninja.migration.run=false
But still got this error .
In StartupActions.java , I added :
@Start(order = 100)
public void generateDummyDataWhenInTest() {
if (!ninjaProperties.isProd()) {
setupDao.setup();
}
Flyway flyway = new Flyway();
flyway.init();
}
But still the same error ...
What should I do now ? ( ninja 2.5.1 )