Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Hudson » Slave on Raspberry PI (Could not initialize class com.sun.jna.Native)
Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1032850] Wed, 03 April 2013 14:10 Go to next message
Christian Schulz is currently offline Christian Schulz
Messages: 25
Registered: March 2013
Junior Member
Hello,

I have some problems with Raspberry PI running. I am using it with Raspian to run a slave.

I got following message, when the job is finished:

FATAL: Remote call on Raspberry failed

java.io.IOException: Remote call on Raspberry failed
        at hudson.remoting.Channel.call(Channel.java:652)
        at hudson.Launcher$RemoteLauncher.kill(Launcher.java:771)
        at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:459)
        at hudson.model.Run.run(Run.java:1390)
        at hudson.matrix.MatrixRun.run(MatrixRun.java:142)
        at hudson.model.ResourceController.execute(ResourceController.java:82)
        at hudson.model.Executor.run(Executor.java:137)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
        at org.hudsonci.plugins.jna.JnaNativeMacSupport.<clinit>(JnaNativeMacSupport.java:74)
        at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
        at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1723)
        at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:69)
        at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:247)
        at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:245)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:244)
        at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:600)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1888)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1888)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
        at hudson.remoting.UserRequest.deserialize(UserRequest.java:171)
        at hudson.remoting.UserRequest.perform(UserRequest.java:91)
        at hudson.remoting.UserRequest.perform(UserRequest.java:41)
        at hudson.remoting.Request$2.run(Request.java:276)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)


Can anyone help me?
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1033184 is a reply to message #1032850] Thu, 04 April 2013 00:17 Go to previous messageGo to next message
Steve Christou is currently offline Steve Christou
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

I believe this could be an issue where the jna plugin fails to detect the right linux OS. If you take a look at the error message there is JnaNativeMacSupport. I assume you're using raspbian?

/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1033187 is a reply to message #1032850] Thu, 04 April 2013 00:22 Go to previous messageGo to next message
Christian Schulz is currently offline Christian Schulz
Messages: 25
Registered: March 2013
Junior Member
It could be possible, but I don't find any solution to get rid of the error message. All is working "fine" til the finish of a job.

Yes I am using Raspbian. Smile
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1033815 is a reply to message #1033187] Thu, 04 April 2013 17:20 Go to previous messageGo to next message
Steve Christou is currently offline Steve Christou
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

Until the job finishes? So it successfully executes on the raspberry pi it just fails to give the information back to the master machine? Hmmm, I'm wondering if it's a bug with transferring back the information from the slave node to the master machine.

/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1033839 is a reply to message #1033815] Thu, 04 April 2013 17:53 Go to previous messageGo to next message
Christian Schulz is currently offline Christian Schulz
Messages: 25
Registered: March 2013
Junior Member
Yes correct. I don't know exactly what is going wrong. I haven't tested it yet on another system, but I would wonder if there are similar problems.

Is there any possibility to activate a debug output?
To see more verbose details what the slave is doing?
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1033841 is a reply to message #1033839] Thu, 04 April 2013 17:56 Go to previous messageGo to next message
Steve Christou is currently offline Steve Christou
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

There's 2 places to check for verbose output:

On the master you can go to http://localhost:8080/log/all

For slave machines you can go to: http://localhost:8080/computer/COMPUTER_NAME/log
where COMPUTER_NAME is the name of the slave machine.


/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1033848 is a reply to message #1033815] Thu, 04 April 2013 18:07 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 420
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Basically, what happening is when the build finishes, Hudson tries to kill all the processes started by the job. For this it uses Native support to find the process. BTW, this error is not happening on Raspberry PI, but on the master. Hudson is preparing to load the Native Support and send it to Raspberry PI to execute. Though the message says "Remote call on Raspberry failed", it appears while master load and prepare the remote call it failed.

Which machine your Hudson master is installed, MAC? Do you have the JNA support plugin installed correctly?

The error says "Could not initialize class com.sun.jna.Native", java.lang.NoClassDefFoundErro. Looking at jna.Native, it could happen if the Java does not have AWT.








Winston Prakash
Eclipse Hudson team
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1037322 is a reply to message #1032850] Tue, 09 April 2013 12:19 Go to previous messageGo to next message
Christian Schulz is currently offline Christian Schulz
Messages: 25
Registered: March 2013
Junior Member
@Steve Christou:
Thanks for the links but I know them and there are not more detailed messages available.
Is there no option to say log everything you do hudson?

@Winston Prakash:
The master is a debian machine and it works with debian slaves (x64, x32/Debian 6 and 7).
Only the raspberry as slave makes trouble.
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1037440 is a reply to message #1037322] Tue, 09 April 2013 15:05 Go to previous messageGo to next message
Christian Schulz is currently offline Christian Schulz
Messages: 25
Registered: March 2013
Junior Member
So and again I found a stacktrace. Smile

Apr 9, 2013 5:57:27 PM hudson.node_monitors.AbstractNodeMonitorDescriptor$Record run
WARNING: Failed to monitor Raspberry for Free Swap Space
java.io.IOException: Remote call on Raspberry failed
	at hudson.remoting.Channel.call(Channel.java:652)
	at hudson.node_monitors.SwapSpaceMonitor$1.monitor(SwapSpaceMonitor.java:80)
	at hudson.node_monitors.SwapSpaceMonitor$1.monitor(SwapSpaceMonitor.java:78)
	at hudson.node_monitors.AbstractNodeMonitorDescriptor$Record.run(AbstractNodeMonitorDescriptor.java:197)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
	at org.hudsonci.plugins.jna.JnaNativeMacSupport.<clinit>(JnaNativeMacSupport.java:74)
	at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
	at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1710)
	...


Quote:
Do you have the JNA support plugin installed correctly?

How can I check it?


EDIT:
I thought after installing the package libjna-java on the master the stacktrace changed. But I can't reproduce it.
Apr 9, 2013 6:28:58 PM hudson.node_monitors.AbstractNodeMonitorDescriptor$Record run
WARNING: Failed to monitor Raspberry for Free Swap Space
java.io.IOException: Remote call on Raspberry failed
	at hudson.remoting.Channel.call(Channel.java:652)
	at hudson.node_monitors.SwapSpaceMonitor$1.monitor(SwapSpaceMonitor.java:80)
	at hudson.node_monitors.SwapSpaceMonitor$1.monitor(SwapSpaceMonitor.java:78)
	at hudson.node_monitors.AbstractNodeMonitorDescriptor$Record.run(AbstractNodeMonitorDescriptor.java:197)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.hudsonci.plugins.jna.JnaNativeMacSupport
	at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
	at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1710)
	...


EDIT2:
One interesting thing which is reproducable for me. If I am to fast to show the status of nodes or refresh the state I got following stack:
Apr 9, 2013 6:49:21 PM hudson.node_monitors.AbstractNodeMonitorDescriptor$Record run
WARNING: Failed to monitor Raspberry for Free Swap Space
java.io.IOException: Remote call on Raspberry failed
	at hudson.remoting.Channel.call(Channel.java:652)
	at hudson.node_monitors.SwapSpaceMonitor$1.monitor(SwapSpaceMonitor.java:80)
	at hudson.node_monitors.SwapSpaceMonitor$1.monitor(SwapSpaceMonitor.java:78)
	at hudson.node_monitors.AbstractNodeMonitorDescriptor$Record.run(AbstractNodeMonitorDescriptor.java:197)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/hudson-remoting3412967974061669945/com/sun/jna/linux-arm/libjnidispatch.so: /tmp/hudson-remoting3412967974061669945/com/sun/jna/linux-arm/libjnidispatch.so: cannot open shared object file: No such file or directory
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1646)


Trying it again and I get the second stack shown in this post.
In my opinion there is a timing problem. The system tries to load the file before it is available.

I press refresh node status, after it there is a new folder hudson-remotingXXX, which contains the class StaticLoggerBinder. Then a new folder appears hudson-remotingXXX containing the required library.

[Updated on: Tue, 09 April 2013 15:50]

Report message to a moderator

Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1037729 is a reply to message #1037440] Wed, 10 April 2013 00:14 Go to previous messageGo to next message
Steve Christou is currently offline Steve Christou
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

According to this stackoverflow thread: http://stackoverflow.com/questions/14635999/jna-native-support-com-sun-jna-linux-arm-libjnidispatch-so-not-found-in-resou it looks like you need to build the jna.jar on your raspberry pi. If you look inside the jna.jar file you will not see a linux-arm version, only linux-amd64 and linux-i386 version, so build the jna code (https://github.com/twall/jna and run ant), then rename the old jna.jar to jna.jar.old (in case this does not work Smile ) and then use the one just built. I'm trying to find my raspberry pi so I could verify that fixes the issue.

Thanks,
Steve.


/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1038260 is a reply to message #1037729] Wed, 10 April 2013 16:30 Go to previous messageGo to next message
Christian Schulz is currently offline Christian Schulz
Messages: 25
Registered: March 2013
Junior Member
Hum ... I think they had another problem than me.
In my case the library will be extracted/copied or whatever to the place where the system expects it, but too late.
The system/hudson tries to access it before the copy/extract or whatever progress is finished.

That results into the exception, that the system can't load the library.
After loading I get the other exception when initialize the class "Could not initialize class org.hudsonci.plugins.jna.JnaNativeMacSupport".

The file command returns following output:
/tmp/hudson-remoting3153146400750408175/com/sun/jna/linux-arm/libjnidispatch.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xb2fe121fc0b27c6562e0a73bda21e2bc23193938, not stripped

So I would say it is the right library. Smile

EDIT:
nm shows following output http://paste.ubuntu.com/5695943/.
In this case I don't use the code bbcode. Smile

[Updated on: Wed, 10 April 2013 16:53]

Report message to a moderator

Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1039657 is a reply to message #1038260] Fri, 12 April 2013 12:08 Go to previous messageGo to next message
Christian Schulz is currently offline Christian Schulz
Messages: 25
Registered: March 2013
Junior Member
I don't know if the information is useful, but Jenkins can handle the Raspberry. Perhaps you can find something in its codebase.
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1141195 is a reply to message #1039657] Wed, 16 October 2013 22:22 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 420
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Ah!, finally it was a static initializer that is causing the library to load (related to Mac Support). Fixed it JNA Native Access Plugin v. 3.0.4

Winston Prakash
Eclipse Hudson team
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1154813 is a reply to message #1141195] Fri, 25 October 2013 13:23 Go to previous messageGo to next message
Christian Schulz is currently offline Christian Schulz
Messages: 25
Registered: March 2013
Junior Member
Yeah seems to be working now. Smile
No exception and all node data are available. Smile
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1155289 is a reply to message #1154813] Fri, 25 October 2013 20:44 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 420
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Glad to hear that. Would help if you could write a small note on how to use Raspberry PI as Hudson node at http://wiki.eclipse.org/Distributed_builds

Winston Prakash
Eclipse Hudson team
Re: Slave on Raspberry PI (Could not initialize class com.sun.jna.Native) [message #1219963 is a reply to message #1155289] Sat, 07 December 2013 13:05 Go to previous message
Christian Schulz is currently offline Christian Schulz
Messages: 25
Registered: March 2013
Junior Member
Hey Winston,

I am sorry for my late response. Have overseen the notifcation.
There is nothing special for Raspberry PI at the moment. So I don't know exactly what I shall write. Smile
Previous Topic:Schedule Hudson on a VM via cron
Next Topic:Hudson 3.1.1 CR release
Goto Forum:
  


Current Time: Sun Sep 21 18:32:25 GMT 2014

Powered by FUDForum. Page generated in 0.02230 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software