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

JNA loader constraint violation with MariaDB & waffle-jna #22479

Closed
rusher opened this issue Jan 16, 2024 · 5 comments · Fixed by #22505
Closed

JNA loader constraint violation with MariaDB & waffle-jna #22479

rusher opened this issue Jan 16, 2024 · 5 comments · Fixed by #22505
Assignees
Milestone

Comments

@rusher
Copy link

rusher commented Jan 16, 2024

Description

when loading latest mariadb connector version (3.3.2), connection throw an error

Unexpected driver error occurred while connecting to the database
  loader constraint violation: loader org.jkiss.dbeaver.registry.driver.DriverClassLoader @76f31bcb wants to load class com.sun.jna.Pointer. A different class with the same name was previously loaded by org.eclipse.osgi.internal.loader.EquinoxClassLoader @4cf5d999. (com.sun.jna.Pointer is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4cf5d999, parent loader 'platform')

This is a problem, because since a few version, mariadb 3.3.2 has a waffle-jna dependency. So this always occurs for all connections, even if GSS authentication is not used.

Waffle-jna dependency and seems incompatible with dbeaver (reading from #8247), i've tryed to checking "ignore transcient dependencies" that permit connection when not using GSS authentication.
When needing GSS authentication, adding waffle artificts manually without JNA, that results in error" com/sun/jna/ptr/IntByReference", probably because JNA version doesn't match.

DBeaver Version

23.3.2.202401072024

Operating System

windows 11

Database and driver

mariadb database 10.11 and java connector 3.3.2

Steps to reproduce

No response

Additional context

This is similar to #8247 and #15289

@LonwoLonwo
Copy link
Member

Hello @rusher

Did you do these steps?

You will need to add both waffle and caffeine artifacts separately.
Another workaround: download them and add them as jar files.

@rusher
Copy link
Author

rusher commented Jan 17, 2024

yes, i've been adding all the jars separatly adding :

org.mariadb.jdbc:mariadb-java-client:3.3.2
com.github.waffle:waffle-jna:3.3.0
org.slf4j:jcl-over-slf4j:2.0.7
org.slf4j:slf4j-api:2.0.7
com.github.ben-manes.caffeine:caffeine:2.9.3
org.checkerframework:checker-qual:3.32.0
com.google.errorprone:error_prone_annotations:2.10.0
net.java.dev.jna:jna-platform:5.13.0

jars and downloading them

see
artifacts

but that's still result (when using GSSAPI, normal authentication connection work then ok) in:

connection
probably because JNA jar version is not compatible with net.java.dev.jna:jna-platform:5.13.0.

@LonwoLonwo
Copy link
Member

Thanks for the answer. We will look at it.

@serge-rider
Copy link
Member

The problem cause by JNA dependency in MySQL driver extension.
We could try to fix it by moving all JNA interaction to another plugin so classes won't conflict.

@serge-rider serge-rider added this to the 23.3.4 milestone Jan 18, 2024
@serge-rider serge-rider self-assigned this Jan 18, 2024
serge-rider added a commit that referenced this issue Jan 18, 2024
@serge-rider serge-rider added sp:2 and removed sp:3 labels Jan 18, 2024
serge-rider added a commit that referenced this issue Jan 24, 2024
* #22479 Remove JNA deps from MySQL, PostgreSQL an Oracle. Win registry read moved to the registry bundle.

* Query manager - project search fix
@rusher
Copy link
Author

rusher commented Jan 25, 2024

correction confirmed thanks !

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

Successfully merging a pull request may close this issue.

4 participants