Could not initialize class com.sun.jna.Native

I have a problem with fisheye. When I want to upload a private key, i get the following error in fisheye.out

2012-09-10 16:46:51,948 ERROR - Error for /admin/servlet.gupld
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
	at com.cenqua.fisheye.util.FileSystemUtils.privatise(FileSystemUtils.java:81)
	at com.atlassian.fecru.security.SshKeyManagerImpl.createPrivateKeyFile(SshKeyManagerImpl.java:97)
	at com.atlassian.fecru.security.SshKeyManagerImpl.saveKeyPair(SshKeyManagerImpl.java:111)
	at com.atlassian.fecru.security.SshKeyManagerImpl.isEncrypted(SshKeyManagerImpl.java:103)
	at com.atlassian.fecru.gwt.servlet.GwtSshKeyUploadServlet.executeAction(GwtSshKeyUploadServlet.java:40)
	at gwtupload.server.UploadAction.doPost(UploadAction.java:162)

What went wrong here?

9 answers

1 accepted

This widget could not be displayed.

I was able to get past the problem like Allan Saddi by upgrading the jna jar to version 3.4.2.

With the old jna jar in place, I would get classdef not found errors if I attempted to upload a public key or test a connection using a FishEye generated key.

You can download the jar file at this URL: https://github.com/twall/jna/blob/3.4.2/dist/jna.jar?raw=true

  1. Download the file. It will be named jna.jar
  2. Rename the jar so you know the version (eg mv jna.jar jna-3.4.2.jar)
  3. Shutdown FishEye
  4. Remove the old jar: (mv [FISHEYE_INSTALL]/lib/jna-3.0.9.jar /some/other/dir
  5. Copy the new jar: (cp jna-3.4.2.jar [FISHEYE_INSTALL]/lib
  6. Start FishEye

At this point I was able to successfully generate a ssh key pair, manually upload the public key to GitHub Enterprise, and add the repository.

worked like a charm!

This widget could not be displayed.
Geoff Crain Atlassian Team Sep 10, 2012

Hi flflfl,

The problem is that we are depending on JNA to set permissions on the newly created SSH key, using for example chmod on unix.

The error shows that the class com.sun.jna.Native is failing to load due to a missing dependency.

Potentially this is due to the JVM that you are using. Can you please let us know what OS and JVM versions you are using?

Also, is there any more stack trace that would suggest what dependency is actually missing?

Cheers,

Geoff

Hi Geoff,

its CentOS 5.8 with jvm: 1.6.0_34, 64Bit. you can find the stacktrace attached (fisheye.log) .

Thanks,
Flo

This widget could not be displayed.

Hi there,

From the looks of the error, there has been an issue importing a library that FishEye is dependent upon so I would suggest checking that you are running your instance on a supported JVM. I'm sorry to say that is just speculation, but certainly something worth investigating.

All the best,
John

Hi John,

its Java 1.6.0_34.

Thanks,
Flo

This widget could not be displayed.

Hello,

We ran into this issue as well and found this thread by searching.

I eventually fixed this by upgrading jna-3.4.0.jar in FishEye to jna-3.4.2.jar. It works for us, but YMMV.

We are using Oracle JDK 1.6.0_35 on RHEL 5, 64-bit. I believe there was a fix to JNA regarding the specific glibc versions used that affect this.
This widget could not be displayed.

I am having the same issue when trying to upload a private key for a Git repo in FishEye.

This is NOT due to a missing library in the JVM. The jna libary is part of the FishEye install. The file is located at [FishEye install dir]/lib/jna-3.4.0.jar.

Besides the stack trace, I occasionally get the following in a popup:

An error has occurred

Error
Could not save private key: POSIX c library "c" was not found
Error 2
Could not save private key: POSIX c library "c" was not found
You are running release CR2.8.1 FE2.8.1 (20120829051639 2012-08-29), please report your release number when reporting bugs.

Got a suggestion or an issue?
Discuss it in our forums or visit our support website for other options.

In the logs I see:

INFO: Initiating Jersey application, version 'Jersey: 1.8-atlassian-6 03/12/2012 02:59 PM'

2012-09-13 12:22:13,373 ERROR - Could not save private key: POSIX c library "c" was not found

2012-09-13 12:22:14,250 ERROR - Could not save private key: POSIX c library "c" was not found

FishEye version:

(Version:2.8.1 Build:20120829051639 2012-08-29

Java version:

[fisheye@fisheye01 lib]$ java -version

java version "1.6.0_35"

Java(TM) SE Runtime Environment (build 1.6.0_35-b10)

Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01, mixed mode)

This widget could not be displayed.

Fine. But why does this seem to be only happening with CentOS ??

I am unable to reproduce this with ubuntu...(same FE version, same oracele jvm,....)

This widget could not be displayed.

Fine. But why does this seem to be only happening with CentOS ??

I am unable to reproduce this with ubuntu...(same FE version, same oracele jvm,....)

This widget could not be displayed.

It also happens in Fedora 17, x86-64 with OpenJDK 1.7.0_09 -icedtea version. However i dont have or use fisheye.

And thanks for the dependency suggession. Worked like charm.

This widget could not be displayed.

happens also with ubuntu 64bit,

java version "1.7.0_25"

OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)

OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

and Fisheye 3.1.3 with jna-3.4.2.
any new ideas how to fix this? I want to add a simple git repo :(.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published 10 hours ago in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

39 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you