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

Issue loading sqlite file #30

Open
sudhaharv77 opened this issue Nov 27, 2019 · 4 comments
Open

Issue loading sqlite file #30

sudhaharv77 opened this issue Nov 27, 2019 · 4 comments

Comments

@sudhaharv77
Copy link

I have used openlr to load sqlite file to generate openlr.map.MapDatabase using Spring boot application, I can able to convert if i used normal java project. But if i use with spring boot i am facing the below issue,

Can pleas help, below is the stack trace.

openlr.map.loader.OpenLRMapLoaderException: Cannot load SQLite database
at openlr.map.sqlite.loader.SQLiteMapLoader.load(SQLiteMapLoader.java:73)
at com.stee.trafficdata.service.impl.TrafficDataServiceImpl.loadSqLiteData(TrafficDataServiceImpl.java:72)
at com.stee.trafficdata.starter.TrafficDataStarter.run(TrafficDataStarter.java:20)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:765)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at com.stee.trafficdata.TrafficdataApplication.main(TrafficdataApplication.java:12)
Caused by: java.lang.IllegalStateException: Unable to open database connection.
at openlr.map.sqlite.impl.MapDatabaseImpl.(MapDatabaseImpl.java:179)
at openlr.map.sqlite.loader.SQLiteMapLoader.load(SQLiteMapLoader.java:71)
... 8 more
Caused by: java.sql.SQLException: Cannot change read-only flag after establishing a connection. Use SQLiteConfig#setReadOnly and SQLiteConfig.createConnection().
at org.sqlite.jdbc3.JDBC3Connection.setReadOnly(JDBC3Connection.java:112)
at openlr.map.sqlite.impl.MapDatabaseImpl.getDatabaseConnection(MapDatabaseImpl.java:343)
at openlr.map.sqlite.impl.MapDatabaseImpl.(MapDatabaseImpl.java:175)
... 9 more

@ghost
Copy link

ghost commented Dec 2, 2019

Thanks for the report. Could you help us by posting the code snippet that is causing this exception?

@sudhaharv77
Copy link
Author

sudhaharv77 commented Dec 6, 2019

Hi Stephencurran,

Please find the git repo for the code and image as attached, looking for your suggestions

Here i connected postgres & sqlite(sqlite is file size is big, missed in the project directory)

Along with that i have created another thread(#33).

without spring boot, openlr working fine but(please refer #33)

Thanks

https://github.com/sudhaharv77/tomtomOpenlr

Issue

@ghost
Copy link

ghost commented Dec 6, 2019

Thanks for providing more information and the screenshot. The stack-trace suggests that the map loader is not able to establish a connection to the database.

It would be great if you could check that the file tomtom_dubai.db3

You can find out the schema of the database by opening a shell, changing into the directory containing the database file and executing

sqlite3 tomtom_dubai.db3 .schema

@sudhaharv77
Copy link
Author

Hi, Thanks for your kind response.

Please find the attached screen shot(file not able to attached, because of size).

Here i have 2 things to tell.

 same file i can able to do with normal java project. I just want try to implement spring boot,
that time i face the issue.
i think the db3 file ok. please find attched screen shot
Capture

And also i have serious issue with Decode Method, return response is very slow. Please look my
project in https://github.com/sudhaharv77/trafficdata_JavaOnly
When try to do openlr decoding, its taking more time to return response.
I have 43k records to decode, its take almost 40 mins.
could you please help to sort out the issue.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant