Cannot build server on M1 Mac due to sqlite-jdbc being too old
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 940
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 160
Description
When I setup the server to run from IntelliJ I get the following error:
```
INFO 2022-01-22 10:00:08,902 Starting MAGE server version 1.4.50-V2 (build: runtime) =>[main] Main.main
INFO 2022-01-22 10:00:08,903 Logging level: INFO =>[main] Main.main
INFO 2022-01-22 10:00:08,903 Default charset: UTF-8 =>[main] Main.main
INFO 2022-01-22 10:00:08,905 Reading configuration from path=config/config.xml =>[main] Main.main
INFO 2022-01-22 10:00:08,968 Loading database... =>[main] RepositoryUtil.bootstrapLocalDb
INFO 2022-01-22 10:00:09,441 Done. =>[main] Main.main
INFO 2022-01-22 10:00:09,441 Loading extension packages... =>[main] Main.main
INFO 2022-01-22 10:00:09,441 Done. =>[main] Main.main
INFO 2022-01-22 10:00:09,441 Loading cards... =>[main] Main.main
INFO 2022-01-22 10:00:16,069 DB: need to add 450 new sets =>[main] ExpansionRepository.lambda$saveSets$0
INFO 2022-01-22 10:00:23,417 DB: need to add 56499 new cards =>[main] CardRepository.lambda$saveCards$0
INFO 2022-01-22 10:00:27,431 Done. =>[main] Main.main
INFO 2022-01-22 10:00:27,431 Updating user stats DB... =>[main] Main.main
ERROR 2022-01-22 10:00:27,457 Error creating user_stats repository - =>[main] UserStatsRepository.
java.sql.SQLException: Error opening connection
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:239)
at org.sqlite.SQLiteConnection.(SQLiteConnection.java:61)
at org.sqlite.jdbc3.JDBC3Connection.(JDBC3Connection.java:28)
at org.sqlite.jdbc4.JDBC4Connection.(JDBC4Connection.java:21)
at org.sqlite.JDBC.createConnection(JDBC.java:115)
at org.sqlite.JDBC.connect(JDBC.java:90)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at com.j256.ormlite.jdbc.JdbcConnectionSource.makeConnection(JdbcConnectionSource.java:139)
at com.j256.ormlite.jdbc.BaseJdbcConnectionSource.getReadWriteConnection(BaseJdbcConnectionSource.java:154)
at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:370)
at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:357)
at com.j256.ormlite.table.TableUtils.createTableIfNotExists(TableUtils.java:75)
at mage.cards.repository.RepositoryUtil.isDatabaseObsolete(RepositoryUtil.java:32)
at mage.server.record.UserStatsRepository.(UserStatsRepository.java:39)
at mage.server.record.UserStatsRepository.(UserStatsRepository.java:23)
at mage.server.Main.main(Main.java:169)
Caused by: java.lang.Exception: No native library found for os.name=Mac, os.arch=aarch64, paths=[/Users/alex/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:367)
at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:67)
at org.sqlite.core.NativeDB.load(NativeDB.java:63)
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:235)
... 16 more
```
I was able to get the server running (though I cannot join it locally, idk the issue for that yet) by changing the following line:
https://github.com/magefree/mage/blob/c4a0a18066c8ab5a8ea189f9f0f3d8c352775ccb/Mage.Server/pom.xml#L265
to `3.36.0.2`. This version (the newest) has arm support for Mac.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.