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

M1 Mac Support #135

Open
mcoughlin opened this issue Aug 27, 2022 · 4 comments
Open

M1 Mac Support #135

mcoughlin opened this issue Aug 27, 2022 · 4 comments

Comments

@mcoughlin
Copy link

It looks like the client does not work on M1 Macs. Has anyone else complained?

Product Distribution Client
Version 2.7.10 2021-06-21

INFO thread=1 Starting
SEVERE thread=1 Exceptions while starting, shutting down
java.sql.SQLException: Error opening connection
at org.sqlite.core.CoreConnection.open(CoreConnection.java:215)
at org.sqlite.core.CoreConnection.(CoreConnection.java:76)
at org.sqlite.jdbc3.JDBC3Connection.(JDBC3Connection.java:25)
at org.sqlite.jdbc4.JDBC4Connection.(JDBC4Connection.java:24)
at org.sqlite.SQLiteConnection.(SQLiteConnection.java:45)
at org.sqlite.JDBC.createConnection(JDBC.java:114)
at org.sqlite.JDBC.connect(JDBC.java:88)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:683)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:253)
at gov.usgs.earthquake.distribution.JDBCNotificationIndex.connect(JDBCNotificationIndex.java:348)
at gov.usgs.earthquake.util.JDBCConnection.startup(JDBCConnection.java:101)
at gov.usgs.earthquake.distribution.JDBCNotificationIndex.startup(JDBCNotificationIndex.java:360)
at gov.usgs.earthquake.distribution.DefaultNotificationReceiver.startup(DefaultNotificationReceiver.java:621)
at gov.usgs.earthquake.distribution.EIDSNotificationReceiver.startup(EIDSNotificationReceiver.java:149)
at gov.usgs.earthquake.distribution.ProductClient.startup(ProductClient.java:241)
at gov.usgs.earthquake.distribution.ProductClient.run(ProductClient.java:370)
at gov.usgs.earthquake.distribution.Bootstrap.main(Bootstrap.java:343)
Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64
at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:333)
at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:64)
at org.sqlite.core.NativeDB.load(NativeDB.java:56)
at org.sqlite.core.CoreConnection.open(CoreConnection.java:211)
... 16 more

@jmfee-usgs
Copy link
Contributor

Hi @mcoughlin , thanks for reporting this issue.

One option is to use an x64 JVM version. this should be available from https://adoptium.net/temurin/releases or via homebrew/sdkman.

I haven't tested mysql connections, but all database code uses JDBC and that may be another option for native M1 support: https://usgs.github.io/pdl/userguide/configureMySQL.html

@mcoughlin
Copy link
Author

Unfortunately it doesn't look quite so simple:

[Warning] Connection init error: Error creating CORBA ORB or POA: org.omg.CORBA.INITIALIZE: Unable to initialize orb loader (java.lang.NoClassDefFoundError: Could not initialize class org.openorb.orb.config.OpenORBLoader)
org.omg.CORBA.INITIALIZE: Unable to initialize orb loader (java.lang.NoClassDefFoundError: Could not initialize class org.openorb.orb.config.OpenORBLoader)
at org.openorb.orb.core.ORB.set_parameters(ORB.java:1127)
at org.omg.CORBA.ORB.init(ORB.java:296)
at com.isti.openorbutil.OrbManager.initImplementation(OrbManager.java:260)
at com.isti.openorbutil.OrbManager.initImplementation(OrbManager.java:311)
at com.isti.quakewatch.util.QWCorbaConnector$EventChannelConnectThread.connect(QWCorbaConnector.java:1311)
at com.isti.quakewatch.util.QWCorbaConnector$EventChannelConnectThread.run(QWCorbaConnector.java:1197)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.openorb.orb.config.OpenORBLoader
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newConstructorAccessor(MethodHandleAccessorFactory.java:103)
at java.base/jdk.internal.reflect.ReflectionFactory.newConstructorAccessor(ReflectionFactory.java:236)
at java.base/java.lang.reflect.Constructor.acquireConstructorAccessor(Constructor.java:546)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:496)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:341)
at java.base/java.lang.Class.newInstance(Class.java:677)
at org.openorb.orb.core.ORB.set_parameters(ORB.java:1121)
... 5 more
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "EventChannelConnectThread"]
at org.openorb.orb.config.OpenORBLoader.(OpenORBLoader.java:64)
... 16 more

@jmfee-usgs
Copy link
Contributor

This is a security feature of java 17, related to the EIDS client from Java8 and not specific to M1.

Add --add-opens java.base/java.lang=ALL-UNNAMED to your java command used to start PDL

https://geohazards.usgs.gov/pipermail/pdl/2021-December/000063.html

We have a prototype replacement for EIDS using web sockets, but there are many competing priorities

@mcoughlin
Copy link
Author

Perfect thanks @jmfee-usgs. This might be worth adding to the README quick.

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

2 participants