phxql / argon2-jvm

Argon2 Binding for the JVM
GNU Lesser General Public License v3.0
330 stars 32 forks source link

JNA Method not Found #50

Closed tuanpham91 closed 5 years ago

tuanpham91 commented 6 years ago

Sorry If this question not appropriate here, but i used the no-libs version, try to hash something and results into this exception

java.lang.NoSuchMethodError: com.sun.jna.IntegerType.(IJZ)V

at de.mkammerer.argon2.jna.JnaUint32.<init>(JnaUint32.java:22)

What did i do wrong here ? I added the maven dependencies and thats it, i did nothing more. I use windows 7 64bit

phxql commented 6 years ago

Hi,

which JDK version?

tuanpham91 commented 6 years ago

Hi,

my current JDK-Version is 1.8.0_161.

phxql commented 6 years ago

Can you give me the exact version of JNA you're using? For example by running mvn dependency:tree | grep net.java.dev.jna.

tuanpham91 commented 6 years ago

The version of JNA is 4.5.1

phxql commented 6 years ago

I have no idea what is causing this. Is this a bigger codebase or a playground project? I just tested it with

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>de.mkammerer</groupId>
                <artifactId>argon2-jvm</artifactId>
                <version>2.4</version>
            </dependency>

            <dependency>
                <groupId>net.java.dev.jna</groupId>
                <artifactId>jna</artifactId>
                <version>4.5.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

and it works.

tuanpham91 commented 6 years ago

Could it be a dependency conflict with glassfish ? Because this is a glassfish project, i just added the jna-4.5.1.

phxql commented 6 years ago

I have never tested the library inside an application server. These servers do all funny kind of stuff to the classloaders, so maybe that's a general problem with application servers.

phxql commented 6 years ago

This looks like a similiar issue: https://github.com/oshi/oshi/issues/144

phxql commented 5 years ago

@tuanpham91 Any news on this?

tuanpham91 commented 5 years ago

@phxql We chose another algorithm. The last time i tried it still didnt work.

phxql commented 5 years ago

Ok, thanks for the update.