Error on starting spark with start-all.sh - scala

When I try to start the spark with the script start-all.sh it throws an error as
> localhost: failed to launch: nice -n 0 bin/spark-class
> org.apache.spark.deploy.worker.Worker --webui-port 8081
> spark://dev-pipeline-west-eu.jwn4tgenexauzewylryxtm545b.ax.internal.cloudapp.net:7077
> localhost: at
> sun.launcher.LauncherHelper.loadMainClass(java.base#9-internal/LauncherHelper.java:585)
> localhost: at
> sun.launcher.LauncherHelper.checkAndLoadMain(java.base#9-internal/LauncherHelper.java:497)
> localhost: full log in
> /spark-2.1.0-bin-hadoop2.7/logs/spark-shankar-org.apache.spark.deploy.worker.Worker-1-dev-pipeline-west-eu.out
When I looked to the log file available at /spark-2.1.0-bin-hadoop2.7/logs/spark-shankar-org.apache.spark.deploy.worker.Worker-1-dev-pipeline-west-eu.out has following error log.
> Error: A JNI error has occurred, please check your installation and
> try again Exception in thread "main"
> java.lang.ArrayIndexOutOfBoundsException: 64
> at java.util.jar.JarFile.match(java.base#9-internal/JarFile.java:983)
> at java.util.jar.JarFile.checkForSpecialAttributes(java.base#9-internal/JarFile.java:1017)
> at java.util.jar.JarFile.isMultiRelease(java.base#9-internal/JarFile.java:399)
> at java.util.jar.JarFile.getEntry(java.base#9-internal/JarFile.java:524)
> at java.util.jar.JarFile.getJarEntry(java.base#9-internal/JarFile.java:480)
> at jdk.internal.util.jar.JarIndex.getJarIndex(java.base#9-internal/JarIndex.java:114)
What causes the error any idea?

I had the same issue with Ubuntu 16.04.
Updating Java fixed the issue:
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Solution
Use Java version 8 not version 9.
Option 1
One option would be to uninstall Java (version 9) and reinstall Java (version 8). (You can view this posting for installing Java; make sure you make necessary changes so you install version 8.)
Option 2
If you have both installed and you are using Ubuntu, you can use this command:
sudo update-alternatives --config java
To the prompt you will see, respond with the integer associated with Java 8 and press enter.
Form:
http://continualintegration.com/miscellaneous-articles/how-do-you-troubleshoot-the-spark-shell-error-a-jni-error-has-occurred

Related

VS Code remote ssh missing GLIBCXX and GLIBC

I am trying to use the remote development via ssh feature of VS Code. When connecting to the remote server I encounter:
Missing GLIBCXX >= 3.4.18!
>Found versions 3.4.1
> 3.4.2
> ...
> 3.4.13
Missing GLIBC >= 2.17!
Found version ldd (GNU libc) 2.12
On the remote I load the module gcc/7.3.0 and confirm the version:
gcc --version
> gcc (GCC) 7.3.0
and also find:
ldd --version
> ldd (GNU libc) 2.12
In /lib I find libc-2.12.so and find the max version of GLIBC is 2.12:
strings libc-2.12.so | grep GLIB
> GLIBC_2.0
> GLIBC_2.1
> ...
> GLIBC_2.12
However, I am able to find the required versions of the library in another place on the system in /usr/lots/of/directories/gcc/x86_64-pc-linux-gnu/7.3.0:
strings libstdc++.so.6.0.24 | grep GLIB
> GLIBCXX_3.4
> ...
> GLIBCXX_3.4.24
> ...
> GLIBC_2.3.3
so it appears I do have the required versions on the remote. Is it possible to configure either VS Code or the remoter server in order to get the remote development working (ideally without changing bits not in my home directory on the remote)?
check the linux version from your server, you can use lsb_release -a. Then check in the next link if your Linux Server meet the prerequisites.
VSCODE Linux version for Remote Development
In my case im using RedHat 6 which requires a workaround. Unfortunately I dont have root privileges :(

STM32CUBEPGROGRAMMER: You are using OpenJDK, please Install OpenJFX error

STM32CubeProgrammer seems to be installed yet when I try to run the program I come across with this error.
I have OpenJDK, OpenJFX and Oracle installed on my computer.
How can I fix the error?
If you are using macOS please see my installation guide here (tested with macOS Catalina 10.15.1 (19B88).
1.To be sure you use the right java version deinstall all java versions first
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Application\ Support/Oracle/Java/
sudo rm -rf /Library/Java/JavaVirtualMachines
2.Restart your Mac
3.Check if the deinstallation was successful
~ java -version
No Java runtime present, requesting install.
4.Now install " jdk-8u231-macosx-x64 "
5.Check your java version after installation
~ java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
6.Go to the directory where the STM32CubeProgrammer installer is located. For example
~ cd /Users/myName/Desktop/en
7.Install STM32CubeProgrammer
en sudo java -jar SetupSTM32CubeProgrammer-2.2.1.exe
6. The result should be
Command line arguments:
====================
Installation started
Framework: 1.6.0_65-b14-468 (Apple Inc.)
Platform: mac_osx,version=10.15.1,arch=x86,symbolicName=null,javaVersion=1.8.0_231
Installation finished
8.Now you can start STM32CubeProgrammer
I was a little confused too until I noticed that the instructions above instruct you to download a past version of STMCubeProgrammer -> VERSION 2.2
When visiting the download page from the link emailed to you, note that there is a Version: selection box. Open it and choose 2.2 then click the download button. Resume the instructions above and you should be good to go.
Good luck!

SonerQube doesnt start

Sonarqube Startup script does not start ob ubuntu 16.04
Error log shows:
Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run
java.lang.IllegalStateException: SonarQube requires Java 11+ to run
at org.sonar.application.App.checkJavaVersion(App.java:93)
at org.sonar.application.App.start(App.java:56)
at org.sonar.application.App.main(App.java:98)
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 org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Thread.java:748)
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Startup failed: Timed out waiting for a signal from the JVM.
JVM did not exit on request, terminated
JVM Restarts disabled. Shutting down.
<-- Wrapper Stopped
If i run java -version:
java version "11.0.3" 2019-04-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.3+12-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.3+12-LTS, mixed mode)
Open conf/wrapper.conf file
Change wrapper.java.command=java to path where your JavaDK is installed eg. wrapper.java.command=C:\Program Files\Java\jdk-11.0.4\bin\java
I had the same problem a few moments ago, my JAVA_HOME variable pointed to the correct version of my profile, but when I run java -version, it printed 1.8, so I run this command:
update-java-alternatives -l
This showed me all Java versions that were installed on my machine.
After that, I run this another command:
sudo update-java-alternatives -s java-11-oracle
This changed the Java version on my machine and it works just fine.
"Warning Support for Java 8 has been deprecated in SonarQube v7.8 and will be removed in SonarQube v7.9 LTS."
checkout you java -version, and the Supported Platforms requirements: https://docs.sonarqube.org/7.7/requirements/requirements/
Then go to the downloads and choose what is the best for you:
https://www.sonarqube.org/downloads/ (Show all versions)
Check for the JRE version, I have come across the issue where the Java SDK version and JRE -version was different. That may be the issue.
Most user would like to download JDK 11 here as mentioned in recent comments. That should works.
However, I would recommend to install latest version from following link (because you have just downloaded latest sonarqube) for better compatibility.
SDK download link: https://www.oracle.com/java/technologies/javase-downloads.html
FYI,
For mac user,
Install JVM on your machine (I installed it by Homebrew).
brew cask install java
and restarted the sonar by
./sonar.sh restart
it worked for me

Android build Ubuntu 16.04.1 required BlockingQueue

I am trying to build the Android source Build: LMY48M (android-5.1.1_r14) on Ubuntu 16.04.1
Got the following error
out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/util/concurrent/ScheduledThreadPoolExecutor.java:9: warning: [unchecked] unchecked conversion
public ScheduledThreadPoolExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler) { super(0,0,0,(java.util.concurrent.TimeUnit)null,(java.util.concurrent.BlockingQueue)null,(java.util.concurrent.ThreadFactory)null,(java.util.concurrent.RejectedExecutionHandler)null); throw new RuntimeException("Stub!"); }
^
required: BlockingQueue<Runnable>
found: BlockingQueue
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
#### make failed to build some targets (01:15:26 (hh:mm:ss)) ####
I am using OpenJDK-7
P.S: I was intented to build on Ubuntu 14.04, however I am using a skylake processor that doesn't have support on Ubuntu 14.04.
However, I successfully build the same Android build on a virtual box running Ubuntu 14.04 on this same machine.
Any help is appreciated.
Update#2
By following #Nir Duan suggestion, I am using OracleJDK7. but as soon I run make -j32 I am getting this error,
You asked for an OpenJDK 7 build but your version is
java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode).
************************************************************
build/core/main.mk:191: *** stop. Stop.
You're problem is because you need Oracle JDK7 and not OpenJDK-7 when building the source.
Use these commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
The result of $ java -version should be this:
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
(If not look here and change default java version)

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/axis2/transport/SimpleAxis2Server (Unsupported major.minor version 49.0

I'm having problem deploying Axis2 v1.5.3 on my 64 bit Solaris 9 OS, I wonder what should I do in order to successfully run this Axis2 instance with JDK 6 ?
In this OS there are multiple Java JDK version installed but I have already set the env. var to point to the 1.6 binary.
Suddenly I realize that I can always open up the setenv.sh file and then hard code it manually for safer option,
export AXIS2_HOME="/opt/local/sys/axis2-1.5.3"
export JAVA_HOME="/usr/java1.6/bin/java"
export AXIS2_CLASSPATH="$AXIS2_CLASSPATH"
Here's the history log:
npapsg# uname -a
SunOS npapsg.domain.com 5.9 Generic_117171-17 sun4u sparc SUNW,Sun-Fire-280R
npapsg# pwd
/opt/local/sys/axis2-1.5.3/bin
npapsg# ls
axis2.bat axis2server.sh setenv.sh
axis2.sh java2wsdl.bat wsdl2java.bat
axis2server.bat java2wsdl.sh wsdl2java.sh
npapsg# env
TERM=xterm
HOME=/
SHELL=/bin/zsh
USER=root
LOGNAME=root
PATH=/usr/bin:/usr/sbin:/opt/local/bin:/usr/local/bin:/opt/oracle/product/9.2.0/bin:/usr/ucb:/bin:/usr/bin:/etc:/usr/sbin:/usr/bin:/opt/SUNWspro-4.0.1/bin:/usr/ucb:/etc:/usr/ccs/bin:/opt/local/bin:/opt/local/etc:/opt/local/licenses:/usr/local/bin:/usr/local/etc::/usr/cssc/bin::/opt/gnu/bin:/usr/gnu/bin:::/opt/X11R5/bin:/usr/local/X11/R5/bin:/home/products/openwin-3.2/bin:/home/products/openwin-3.2/demo::/opt/SUNWmotif/bin:/opt/java/bin:::/opt/local/cap/bin:/home/products/ddts/sol2x_bin:::.:/usr/openwin/bin
PWD=/opt/local/sys/axis2-1.5.3/bin
SHLVL=1
ORACLE_HOME=/opt/oracle/product/9.2.0
HISTSIZE=1000
_=/usr/bin/env
npapsg# ./setenv.sh
Using AXIS2_HOME: /opt/local/sys/axis2-1.5.3
Using JAVA_HOME: /usr/java1.6/bin/java
npapsg# ./axis2server.sh
Using AXIS2_HOME: /opt/local/sys/axis2-1.5.3
Using JAVA_HOME: /usr/java1.6/bin/java
**Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/axis2/transport/SimpleAxis2Server (Unsupported major.minor version 49.0)**
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
npapsg# /usr/java1.6/bin/java -version
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)
Try to add this bit inside ~/.profile and ~/.bashrc for the user that is going to run this.
export JAVA_HOME=/usr/java1.6
export PATH=$PATH:$JAVA_HOME/bin
Restart the console session and make sure you get java 6 version when you run java -showversion command