java


Playframework 2.5 SQL error or missing database (no such table: information_schema.sequences)


I have downloaded the Play Java Starter Example from: https://www.playframework.com/download
I need to use sqlite database instead of in-memory h2 database. I have changed the necessary lines inside of application.conf:
default.driver = org.sqlite.JDBC
default.url = "jdbc:sqlite:database.sqlite"
Also added libraryDependencies += "org.xerial" % "sqlite-jdbc" % "3.8.11.2" into build.sbt
When I try to run the application I get the following error:
[info] application - Creating Pool for datasource 'default'
[info] p.a.d.HikariCPConnectionPool - datasource [default] bound to JNDI as DefaultDS
[info] p.a.d.DefaultDBApi - Database [default] connected at jdbc:sqlite:database.sqlite
[warn] o.h.e.j.s.SqlExceptionHelper - SQL Error: 1, SQLState: null
[error] o.h.e.j.s.SqlExceptionHelper - [SQLITE_ERROR] SQL error or missing database (no such table: information_schema.sequences)
[error] application -
Followed by:
! #72oobm82b - Internal server error, for (GET) [/] ->
play.api.UnexpectedException: Unexpected exception[ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, javax.persistence.PersistenceException: [PersistenceUnit: defaultPersistenceUnit] Unable to build Hibernate SessionFactory
at play.db.jpa.DefaultJPAApi$JPAApiProvider.<init>(DefaultJPAApi.java:39)
at play.db.jpa.DefaultJPAApi$JPAApiProvider.class(DefaultJPAApi.java:34)
while locating play.db.jpa.DefaultJPAApi$JPAApiProvider
while locating play.db.jpa.JPAApi
for parameter 1 at controllers.PersonController.<init>(PersonController.java:21)
while locating controllers.PersonController
for parameter 1 at router.Routes.<init>(Routes.scala:32)
while locating router.Routes
while locating play.api.inject.RoutesProvider
while locating play.api.routing.Router
for parameter 0 at play.api.http.JavaCompatibleHttpRequestHandler.<init>(HttpRequestHandler.scala:200)
while locating play.api.http.JavaCompatibleHttpRequestHandler
while locating play.api.http.HttpRequestHandler
for parameter 4 at play.api.DefaultApplication.<init>(Application.scala:221)
at play.api.DefaultApplication.class(Application.scala:221)
while locating play.api.DefaultApplication
while locating play.api.Application
1 error]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:180)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:131)
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:131)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:129)
at scala.util.Success.flatMap(Try.scala:231)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:129)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:121)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, javax.persistence.PersistenceException: [PersistenceUnit: defaultPersistenceUnit] Unable to build Hibernate SessionFactory
at play.db.jpa.DefaultJPAApi$JPAApiProvider.<init>(DefaultJPAApi.java:39)
at play.db.jpa.DefaultJPAApi$JPAApiProvider.class(DefaultJPAApi.java:34)
while locating play.db.jpa.DefaultJPAApi$JPAApiProvider
while locating play.db.jpa.JPAApi
for parameter 1 at controllers.PersonController.<init>(PersonController.java:21)
while locating controllers.PersonController
for parameter 1 at router.Routes.<init>(Routes.scala:32)
while locating router.Routes
while locating play.api.inject.RoutesProvider
while locating play.api.routing.Router
for parameter 0 at play.api.http.JavaCompatibleHttpRequestHandler.<init>(HttpRequestHandler.scala:200)
while locating play.api.http.JavaCompatibleHttpRequestHandler
while locating play.api.http.HttpRequestHandler
for parameter 4 at play.api.DefaultApplication.<init>(Application.scala:221)
at play.api.DefaultApplication.class(Application.scala:221)
while locating play.api.DefaultApplication
while locating play.api.Application
1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:405)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:400)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123)
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:168)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.scala:164)
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:164)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: defaultPersistenceUnit] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:967)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892)
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:58)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
at play.db.jpa.DefaultJPAApi.lambda$start$1(DefaultJPAApi.java:60)
at java.lang.Iterable.forEach(Iterable.java:75)
at play.db.jpa.DefaultJPAApi.start(DefaultJPAApi.java:59)
at play.db.jpa.DefaultJPAApi$JPAApiProvider.<init>(DefaultJPAApi.java:46)
at play.db.jpa.DefaultJPAApi$JPAApiProvider$$FastClassByGuice$$dcd4cdbd.newInstance(<generated>)
Caused by: org.hibernate.exception.GenericJDBCException: Unable to build DatabaseInformation
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
at org.hibernate.tool.schema.internal.Helper.buildDatabaseInformation(Helper.java:140)
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:92)
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:183)
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:309)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:445)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:889)
Caused by: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such table: information_schema.sequences)
at org.sqlite.core.DB.newSQLException(DB.java:890)
at org.sqlite.core.DB.newSQLException(DB.java:901)
at org.sqlite.core.DB.throwex(DB.java:868)
at org.sqlite.core.NativeDB.prepare(Native Method)
at org.sqlite.core.DB.prepare(DB.java:211)
at org.sqlite.jdbc3.JDBC3Statement.executeQuery(JDBC3Statement.java:81)
at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:111)
at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java)
at org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorH2DatabaseImpl.extractMetadata(SequenceInformationExtractorH2DatabaseImpl.java:37)
at org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.initializeSequences(DatabaseInformationImpl.java:65)
The database file database.sqlite is automatically created inside of the root folder with 0 bytes.
Am I missing something?
In SQLite information_schema doesn't exist. The equivalent is its system table sqlite_master. However a table sequences is not available by default. sqlite_master is constructed with the fields:
CREATE TABLE sqlite_master (
type TEXT,
name TEXT,
tbl_name TEXT,
rootpage INTEGER,
sql TEXT
);
Unfortunately it seems you have to do additional work to transition from H2 to SQLite.

Related Links

How to resolv: java.sql.SQLException: setDate, Exception = Invalid year value
My app is force closing when clicking on button to switch to another activity. here i am putting my code
Using xdocreport, is it possible to read drawings from a docx file?
Unable to run identical servlet/hibernate project on my other pc
Serial port with jSSC in linux
compiling error on org.apache.http [duplicate]
Spring Boot JPA - OneToMany relationship causes infinite loop
Black image when drawing Image on Canvas
No such algorithm : SCJCE provider
Java library jvm.dll price [closed]
Create JSON in 2D array to store key value pair
Unable to find button element SELENIUM [closed]
IntelliJ Idea error: Unable to import maven project: See logs for details [duplicate]
Vaadin: Adding placeholder to TextField
Finding min and max using Java
how can i improve the response time of this Jersey REST Web service call?

Categories

HOME
kde
nullpointerexception
relative-path
lodash
grep
youtube-dl
filtering
rdf
twitter-bootstrap-4
serverspec
enterprise-library-5
azure-media-services
fancybox-3
volttron
vb.net-2010
fortumo
lombok
flux
crosstab
newline
gsmcomm
bpel
lightswitch-2013
twilio-api
data-manipulation
overlap
file-format
qwerty
automake
ssjs
cookiecutter-django
particles.js
eigenvalue
checkboxlist
chain-builder
react-scripts
jlink
tropo
carrot
font-size
epson
flow-control
url-pattern
file-writing
multi-level
plottable.js
gridview-sorting
disque
markojs
browser-link
uid
mutation-observers
computer-algebra-systems
iiviewdeckcontroller
oberon
c++03
npapi
mdt
markers
responsive-slides
openexr
tld
doskey
undefined-reference
odata4j
gdata-api
nsobject
data-loss
android-sdk-2.1
visitor-statistic
dbal
ctp4
virtual-functions
anti-piracy
ntvdm.exe

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App