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

Trouble deploying Spring 4 WAR to Weblogic 12c
struts 2 HTTP 404 Error [duplicate]
Java DateFormat for UTC [duplicate]
Changing the content of JFrame is slow or am i just do it wrong?
How do I refresh the db connection using JOOQ
Error: Could not find or load main class welcome.to.java.WelcomeToJava [duplicate]
Java cloner: NoClassDefFoundError
Basic Java App closing with bad exit code
How to detect new methods in JAXB classes
filesystem resolver and transitive dependencies / master configurations
Does install4j support indeterminate progress bar (barber's pole or beach ball)?
Process Mutiple Input Files In MapReduce separately
Java HTTPS all-trusting web service client, PKIX path building failed
how can measure on test code using javancss maven plugin
Social Media Chain Search Algorithm in Java
Handling token with Grails 3

Categories

HOME
log4j
multithreading
testng
keycloak
mockito
single-sign-on
lodash
react-redux
rubygems
youtube-api-v3
rdf
pivotal-cloud-foundry
primary-key
google-translate
opentracing
lldb
swiftlint
crosstab
info.plist
saas
wtx
bcd
google-cloud-endpoints-v2
preg-match-all
scorm2004
catel
winrt-xaml-toolkit
stringtemplate
lxd
form-data
rotational-matrices
normal-distribution
picasso
gulp-sourcemaps
vao
btrace
apple-news
network-flow
clean-architecture
mu
slickedit
lift-json
snmptrapd
memory-alignment
mcafee
blacklist
objective-c-swift-bridge
time-and-attendance
radtreelist
elements
autorest
clang-static-analyzer
nsviewcontroller
bluemix-app-scan
apachebench
php-parse-error
marching-cubes
comobject
mutation-observers
jqgrid-formatter
quicklisp
appfabric-cache
generic-programming
proj4js
notify
gadt
tt-news
android-nested-fragment
castle
google-reader
xceed-datagrid
braille
oracle-warehouse-builder
commoncrypto
back-stack
random-seed
spring-validator
free-variable
multipage
viewswitcher
qtkit
netdna-api
pydot
infobox
android-sdk-2.1
.nettiers
gin
compiler-specific
substrings
virtual-functions
project-hosting
defensive-programming
django-notification
ajax-forms

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App