mars-sim does not work with openjdk #1

Open
shirishag75 opened this Issue Jan 11, 2017 · 8 comments

Projects

None yet

3 participants

@shirishag75
shirishag75 commented Jan 11, 2017 edited

mars-sim throws an exception with openjdk 8

> mars-sim                                                                                                                         [95%]
11 Jan, 2017 2:26:36 PM(INFO) main.javafx.MarsProjectFX Mars Simulation Project v3.1.0 - Build 3837 - Java 8.0.111 (Thu Nov 24 14:50:47 UTC 2016) - 4 CPU thread(s)
Exception in Application init method
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
	at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application init method
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:912)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
	at org.mars_sim.msp.javafx.MarsProjectFX.init(MarsProjectFX.java:280)
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841)
	... 2 more
Exception running application org.mars_sim.msp.javafx.MarsProjectFX

Hope the above helps.

@mokun
Member
mokun commented Jan 16, 2017

I can experiment with setting up openJDK 8 and openJFK 8 in Eclipse under my windows os to see if they can compile the existing codebase.

If not, we'll have to wait for openJDK 9.

I was Oracle's JDK 9 will introduce some "breaking" changes in the internal API such as how JavaFX's CSS styles are processed and so forth. We may want to delay the adoption of JDK 9 or openJDK 9 even after it is released in order to ensure the code conversion is properly done.

@shirishag75

were you able to get something out of it ?

@mokun
Member
mokun commented Jan 30, 2017 edited

I'm using mostly Windows OS as platform for my work.

I go to ojdkbuild for a ready-to-go windows binary build of OpenJDK 8

The trouble is with finding a windows binary of OpenJFX 8.

I haven't got to the point in which I can compile OpenJFX myself on my machine.

I just found this site where they post the windows binary for OpenJFX 8u60. I wish they continue to post most recent versions.

Let's see if they would work together for replacing Oracle Java 8 when it comes to running mars-sim.

Questions:

Do you already have both OpenJFX 8 and OpenJDK 8 installed on your linux box ?

What's your setup and can you run mars-sim ?

do you have the stack traces to show ?

@shirishag75
shirishag75 commented Jan 30, 2017 edited

@mokun I can answer some of the questions, some I'll need inputs from you to seek and do -

As far as OpenJFX8 and OpenJDK 8 are concerned, I have both . In fact I'm in the midst of upgrading both -

[$] apt-cache policy openjdk-8-jdk openjdk-8-jre
                                                                                    
openjdk-8-jdk:
  Installed: 8u111-b14-3
  Candidate: 8u121-b13-2
  Version table:
     8u121-b13-2 600
        600 http://httpredir.debian.org/debian stretch/main amd64 Packages
          1 http://httpredir.debian.org/debian unstable/main amd64 Packages
 *** 8u111-b14-3 100
        100 /var/lib/dpkg/status
openjdk-8-jre:
  Installed: 8u111-b14-3
  Candidate: 8u121-b13-2
  Version table:
     8u121-b13-2 600
        600 http://httpredir.debian.org/debian stretch/main amd64 Packages
          1 http://httpredir.debian.org/debian unstable/main amd64 Packages
 *** 8u111-b14-3 100
        100 /var/lib/dpkg/status

Although openjfx is also not far behind -

[$] apt-cache policy openjfx libopenjfx-java libopenjfx-jni 
                                                                        
openjfx:
  Installed: 8u111-b14-1
  Candidate: 8u111-b14-1
  Version table:
     8u121-b13-2 1
          1 http://httpredir.debian.org/debian unstable/main amd64 Packages
 *** 8u111-b14-1 600
        600 http://httpredir.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status
libopenjfx-java:
  Installed: 8u111-b14-1
  Candidate: 8u111-b14-1
  Version table:
     8u121-b13-2 1
          1 http://httpredir.debian.org/debian unstable/main amd64 Packages
     8u121-b13-1 1
          1 http://httpredir.debian.org/debian unstable/main i386 Packages
 *** 8u111-b14-1 600
        600 http://httpredir.debian.org/debian stretch/main amd64 Packages
        600 http://httpredir.debian.org/debian stretch/main i386 Packages
        100 /var/lib/dpkg/status
libopenjfx-jni:
  Installed: 8u111-b14-1
  Candidate: 8u111-b14-1
  Version table:
     8u121-b13-2 1
          1 http://httpredir.debian.org/debian unstable/main amd64 Packages
 *** 8u111-b14-1 600
        600 http://httpredir.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status

What's your setup and can you run mars-sim ?

By my setup if you mean hardware - the current system I'm working on is pretty old system. It's a wolfdale dual core processor (45nm socket) . 2 GB DDR2 RAM, 1 TB HDD on 64-bit Debian stretch.

As had shared did try to run but get till -

[$] mars-sim                                                                                                                    
Jan 31, 2017 4:36:51 AM(INFO) main.javafx.MarsProjectFX Mars Simulation Project v3.1.0 - Build 3817 - Java SE 8.0.111 (Thu Nov 24 14:50:47 UTC 2016) - 2 CPU thread(s)
Jan 31, 2017 4:36:52 AM(INFO) main.javafx.MarsProjectFX Starting a new sim in GUI mode in linux
Jan 31, 2017 4:36:56 AM(INFO) ui.javafx.mainmenu.SpinningGlobe JavaFX 3D features supported

It took an inordinate long time for the menu to appear. Clicking on New Sim seems to not go anywhere.

Is there a way to limit memory or something ?

@shirishag75

hs_err_pid21230.log.zip

Output on CLI -

[$] mars-sim                                                                                                                        [4:52:57]
Jan 31, 2017 4:53:02 AM(INFO) main.javafx.MarsProjectFX Mars Simulation Project v3.1.0 - Build 3817 - Java SE 8.0.111 (Thu Nov 24 14:50:47 UTC 2016) - 2 CPU thread(s)
Jan 31, 2017 4:53:02 AM(INFO) main.javafx.MarsProjectFX Starting a new sim in GUI mode in linux
Jan 31, 2017 4:53:07 AM(INFO) ui.javafx.mainmenu.SpinningGlobe JavaFX 3D features supported
Jan 31, 2017 5:02:05 AM(INFO) ui.javafx.mainmenu.MainMenu Creating a new sim in linux
Setting Alpha Base's Objective to Crop Farm
Setting Schiaparelli Point's Objective to Crop Farm
Jan 31, 2017 5:05:22 AM(SEVERE) core.time.UpTimer Too long since last time pulse, clearing update time
Jan 31, 2017 5:05:23 AM(INFO) ui.javafx.MainScene MainScene's initializeScene() is on JavaFX Application Thread Thread
Jan 31, 2017 5:05:44 AM(INFO) core.person.ai.task.ProduceFood ChefBot 006 has an accident while performing food production.
Jan 31, 2017 5:05:44 AM(INFO) core.malfunction.MalfunctionManager An accident occurs in a Lounge
Jan 31, 2017 5:05:44 AM(INFO) core.malfunction.Malfunction Electrical Short - the repair requires the part(s) electrical wire (quantity: 1)
Jan 31, 2017 5:05:44 AM(INFO) ui.javafx.MainScene MainScene's createJFXTabs() is on JavaFX Application Thread Thread
Jan 31, 2017 5:05:44 AM(INFO) ui.javafx.MainScene MainScene's createFXZoomSlider() is on JavaFX Application Thread Thread
Jan 31, 2017 5:05:44 AM(INFO) ui.javafx.MainScene MainScene's prepareOthers() is on JavaFX Application Thread Thread
Jan 31, 2017 5:05:47 AM(SEVERE) ui.swing.sound.OGGSoundClip Unable to open the sourceDataLine: javax.sound.sampled.LineUnavailableException
java.lang.IllegalArgumentException: Master Gain not supported
	at org.classpath.icedtea.pulseaudio.PulseAudioLine.getControl(PulseAudioLine.java:89)
	at org.classpath.icedtea.pulseaudio.PulseAudioSourceDataLine.getControl(PulseAudioSourceDataLine.java:51)
	at org.mars_sim.msp.ui.swing.sound.OGGSoundClip.setGain(OGGSoundClip.java:168)
	at org.mars_sim.msp.ui.swing.sound.OGGSoundClip.initJavaSound(OGGSoundClip.java:466)
	at org.mars_sim.msp.ui.swing.sound.OGGSoundClip.getOutputLine(OGGSoundClip.java:482)
	at org.mars_sim.msp.ui.swing.sound.OGGSoundClip.playStream(OGGSoundClip.java:619)
	at org.mars_sim.msp.ui.swing.sound.OGGSoundClip.access$000(OGGSoundClip.java:34)
	at org.mars_sim.msp.ui.swing.sound.OGGSoundClip$2.run(OGGSoundClip.java:391)
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007ff12d112ef8, pid=24519, tid=0x00007ff14a04f700
#
# JRE version: OpenJDK Runtime Environment (8.0_111-b14) (build 1.8.0_111-8u111-b14-3-b14)
# Java VM: OpenJDK 64-Bit Server VM (25.111-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libjfxwebkit.so+0x1883ef8]
#
# Core dump written. Default location: /home/shirish/games/core or core.24519
#
# An error report file with more information is saved as:
# /home/shirish/games/hs_err_pid24519.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)

The only difference between the errors are the log numbers, other than that, the errors are same.

@shirishag75

mars-configuration-editor

Default configuration editor, I didn't change a thing - just clicked on the bright arrow in the center.

@mokun
Member
mokun commented Jan 31, 2017 edited

ui.swing.sound.OGGSoundClip Unable to open the sourceDataLine: javax.sound.sampled.LineUnavailableException

This tells me your sound card is not being set up properly. Can you double check ?

I thought I once turned off the requiring of having to look for the presence of a sound card in mars-sim. But from the stack trace, it seems mars-sim is still too "sensitive" to the absence of a sound card or any error in sound setting in linux.

Meanwhile, I'll compile a new jar for you to test on your machine and will send you a link soon.

btw, my openJDK and openJFX binary versions are not matched up. This seems to be the reason that throws me errors as I run mars-sim on top of it in windows.

If you can find the compiled windows binary of OpenJFX based on 8u91+, by all means, do you let me know the link.

@mokun
Member
mokun commented Jan 31, 2017

This build is based on r3848 and compressed with 7z :

for debian,
see https://www.dropbox.com/s/z0cp44hzxbs24pi/r3848deb.7z?dl=0

for jar,
see https://www.dropbox.com/s/agwujjbnrkqpcen/r3848.7z?dl=0

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