Classpath issues - getJNIEnv failed - java

I have successfully compiled the JNI based Apache libhdfs (C++) on my Hadoop Sandbox / CentOS - no compilation errors or warnings:
g++ test.cpp -o test -I/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151.x86_64/include/
-I/usr/hdp/2.6.3.0-235/usr/include/ -I/usr/hdp/2.6.3.0-235/hadoop/bin
-I/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/include/
-I/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/amd64/
-L/usr/hdp/2.6.3.0-235/hadoop/lib/ -L/usr/hdp/2.6.3.0-235/hadoop/lib/native
-L/usr/hdp/2.6.3.0-235/hadoop/lib/ -L/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/amd64/
-L/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/amd64/server/
-lhdfs -pthread -ljvm
Once I try to run the code, I get the following errors:
[root#sandbox-hdp ~]# ./test
Environment variable CLASSPATH not set!
getJNIEnv: getGlobalJNIEnv failed
Environment variable CLASSPATH not set!
getJNIEnv: getGlobalJNIEnv failed
If I run hadoop classpath in the terminal, I get the following output:
[root#sandbox-hdp ~]# hadoop classpath
/usr/hdp/2.6.3.0-235/hadoop/conf:/usr/hdp/2.6.3.0-
235/hadoop/lib/:/usr/hdp/2.6.3.0-235/hadoop/.//:/usr/hdp/2.6.3.0-235/hadoop-
hdfs/./:/usr/hdp/2.6.3.0-235/hadoop-hdfs/lib/:/usr/hdp/2.6.3.0-235/hadoop-
hdfs/.//:/usr/hdp/2.6.3.0-235/hadoop-yarn/lib/:/usr/hdp/2.6.3.0-235/hadoop-
yarn/.//:/usr/hdp/2.6.3.0-235/hadoop-mapreduce/lib/:/usr/hdp/2.6.3.0-
235/hadoop-mapreduce/.//::jdbc-mysql.jar:mysql-connector-java-
5.1.17.jar:mysql-connector-java-5.1.37.jar:mysql-connector-
java.jar:/usr/hdp/2.6.3.0-235/tez/:/usr/hdp/2.6.3.0-
235/tez/lib/:/usr/hdp/2.6.3.0-235/tez/conf
On the Apache libhdfs page it says:
The most common problem is the CLASSPATH is not set properly when
calling a program that uses libhdfs. Make sure you set it to all the
Hadoop jars needed to run Hadoop itself as well as the right
configuration directory containing hdfs-site.xml. It is not valid to
use wildcard syntax for specifying multiple jars. It may be useful to
run hadoop classpath --glob or hadoop classpath --jar to generate the
correct classpath for your deployment. See Hadoop Commands Reference
for more information on this command.
I do however not get how to proceed after many trial and error attempts, I would therefore appreciate any help that could help me to solve this problem.
Edit: tried the following: CLASSPATH=hadoop classpath ./test
...which gave me the following error: libjvm.so: cannot open shared object file: No such file or directory
I tried the following: export LD_LIBRARY_PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/amd64/server
...and now the error is:
[root#sandbox-hdp ~]# CLASSPATH=$CLASSPATH:`hadoop classpath` ./test
loadFileSystems error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)
hdfsBuilderConnect(forceNewInstance=0, nn=default, port=0, kerbTicketCachePath=(NULL), userName=(NULL)) error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)
hdfsOpenFile(/tmp/testfile.txt): constructNewObjectOfPath error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)

Maybe the following could works for you:
CLASSPATH=$CLASSPATH:`hadoop classpath` ./test
or only this:
CLASSPATH=`hadoop classpath` ./test
Check out JAVA_HOME environment variable, maybe it could alter the java libraries used too.
And finally, a wrapper like the script below could be useful:
#!/bin/bash
export CLASSPATH="AllTheJARs"
ARG0="$0"
EXEC_PATH="$( dirname "$ARG0" )"
"${EXEC_PATH}/test" $#

Related

org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: XMLBeans binding extension not in classpath

I'm trying to generate java code starting from a wsdl file as in the https://axis.apache.org/axis2/java/core/docs/userguide-creatingclients-xmlbeans.html guide.
I created this simple axis2wsdlToJava.bat to be customized for my future edits, but still I can't figure it out why or what dependency is missing.
set JAVA_HOME=C:\PROGRA~1\Java\jdk1.8.0_121
set AXIS2_HOME=C:\Users\conr72\Downloads\axis2-1.8.0
set FILE_NAME=Axis2UserGuide.wsdl
set PACKAGE=org.apache.axis2.axis2userguide
%AXIS2_HOME%\bin\wsdl2java.bat -uri %FILE_NAME% -p %PACKAGE% -d xmlbeans -s -o build\client
I edited the C:\Users\conr72\Downloads\axis2-1.8.0\bin\wsdl2java.bat, adding an echo Using AXIS2_CLASS_PATH: %AXIS2_CLASS_PATH% , to check what is the AXIS2_CLASS_PATH it's using.
And if I run axis2wsdlToJava.bat, I get the following error message:
C:\Users\conr72\Desktop\k8s\workspace\wsdl>C:\Users\conr72\Downloads\axis2-1.8.0\bin\wsdl2java.bat -uri Axis2UserGuide.wsdl -p org.apache.axis2.axis2userguide -d xmlbeans -s -o build\client
Using AXIS2_HOME: C:\Users\conr72\Downloads\axis2-1.8.0
Using JAVA_HOME: C:\PROGRA~1\Java\jdk1.8.0_121
Using AXIS2_CLASS_PATH: C:\Users\conr72\Downloads\axis2-1.8.0;C:\Users\conr72\Downloads\axis2-1.8.0\lib\annotations-13.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\antlr-2.7.7.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\apache-mime4j-core-0.8.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axiom-api-1.3.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axiom-dom-1.3.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axiom-impl-1.3.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axiom-jaxb-1.3.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-adb-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-adb-codegen-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-ant-plugin-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-clustering-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-codegen-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-corba-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-fastinfoset-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-java2wsdl-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-jaxbri-codegen-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-jaxws-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-jibx-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-jibx-codegen-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-json-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-kernel-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-metadata-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-mtompolicy-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-saaj-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-soapmonitor-servlet-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-spring-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-transport-base-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-transport-http-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-transport-jms-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-transport-local-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-transport-mail-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-transport-tcp-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-transport-udp-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-transport-xmpp-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\axis2-xmlbeans-1.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\bcel-6.4.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\checker-qual-3.8.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\codemodel-2.3.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\commons-cli-1.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\commons-codec-1.11.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\commons-fileupload-1.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\commons-io-2.11.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\commons-lang3-3.12.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\commons-logging-1.2.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\dtd-parser-1.4.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\encoder-1.2.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\error_prone_annotations-2.5.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\failureaccess-1.0.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\geronimo-annotation_1.0_spec-1.1.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\geronimo-jaxws_2.2_spec-1.2.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\geronimo-ws-metadata_2.0_spec-1.1.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\google-java-format-1.7.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\gson-2.8.7.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\guava-30.1.1-jre.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\httpclient-4.5.13.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\httpcore-4.4.14.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\istack-commons-runtime-3.0.12.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\istack-commons-tools-3.0.12.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\j2objc-annotations-1.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jakarta.activation-1.2.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jakarta.activation-api-1.2.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jakarta.annotation-api-1.3.5.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jakarta.jws-api-2.1.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jakarta.mail-1.6.7.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jakarta.xml.bind-api-2.3.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jakarta.xml.soap-api-1.4.2.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jakarta.xml.ws-api-2.3.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\javac-shaded-9+181-r4173-1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\javax.servlet-api-3.1.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\javax.transaction-api-1.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jaxb-jxc-2.3.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jaxb-runtime-2.3.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jaxb-xjc-2.3.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jaxen-1.2.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jaxws-tools-2.3.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jettison-1.4.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jibx-bind-1.3.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jibx-run-1.3.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\joda-time-2.10.5.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jsr305-3.0.2.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\jsr311-api-1.1.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\kotlin-stdlib-1.4.31.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\kotlin-stdlib-common-1.4.20.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\log4j-api-2.14.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\log4j-core-2.14.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\log4j-jcl-2.14.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\mex-1.8.0-impl.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\moshi-1.12.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\moshi-adapters-1.12.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\neethi-3.1.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\okio-2.10.0.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\qdox-1.12.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\relaxng-datatype-2.3.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\rngom-2.3.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\serializer-2.7.2.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\spring-aop-5.3.9.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\spring-expression-5.3.9.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\spring-jcl-5.3.9.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\stax2-api-4.2.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\tomcat-juli-10.0.8.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\tomcat-tribes-10.0.8.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\txw2-2.3.4.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\woden-core-1.0M10.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\woodstox-core-6.2.6.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\wsdl4j-1.6.3.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\xalan-2.7.2.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\xml-resolver-1.2.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\xmlbeans-3.0.1.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\xmlschema-core-2.2.5.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\xpp3-1.1.3.4.O.jar;C:\Users\conr72\Downloads\axis2-1.8.0\lib\xsom-2.3.4.jar
Retrieving document at 'Axis2UserGuide.wsdl'.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: XMLBeans binding extension not in classpath
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:163)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:54)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.RuntimeException: XMLBeans binding extension not in classpath
at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:90)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:116)
... 2 more
Since I see in the classpath the C:\Users\conr72\Downloads\axis2-1.8.0\lib\xmlbeans-3.0.1.jar; dependency... What am I missing?
While decompiling axis2-codegen-1.8.0
I found out the required class org.apache.axis2.xmlbeans.CodeGenerationUtility from axis2-xmlbeans-1.8.0 is missing.
But in version 1.7.9 that class is present, so I tried copypasting axis2-xmlbeans-1.7.9, renaming it, in the new classpath and it worked out.
From 1.8 onward you also need to add axis2-xmlbeans-codegen to the classpath to run code generation with XML beans.

Debug OpenJDK14 using CLion: failed to load the CMake project

I download the source code of OpenJDK14 and put them in \home\yuanfang\jdk14 and after running bash configure --disable-warnings-as-errors and make images, I build OpenJDK14 successfully, The newly built JDK is in home\yuanfang\jdk14\build\linux-x86_64-server-release\jdk. By the way, I am using Ubuntu 20.04 LTS.
Then I want to debug OpenJDK14 using CLion IDE. I was using CLion 2020.2 and I take the following steps:
After open CLion I choose Create New CMake Project from Sources and choose the directory of \home\yuanfang\jdk14, which is the root directory of the jdk project.
I alter the Run/Debug Configurations to make it look like this:
CLion create a CMakeLists.txt automatically but the file doesn't work, so after googling I find find the correct CMakeLists.txt here at https://github.com/ojdkbuild/ojdkbuild/blob/master/src/java-14-openjdk/CMakeLists.txt. I then rewrite the old CMakeLists.txt using the correct one.
I download the whole repository(that is, github.com/ojdkbuild/ojdkbuild), unzip it and put it into \home\yuanfang\jdk14.
It looks like as follow, the ojdkbuild-master is the newly added folder.
I reload the CMake project, but some CMake error occurs(as follow), why can't CLion find those files? javaI googled but can't find any effective solution. Is there anything I can do or refer to? Thanks in advance.
CMake Error at CMakeLists.txt:19 (include):
include could not find load file:
/home/yuanfang/jdk14/../../resources/cmake/ojdkbuild_common.cmake
CMake Error at CMakeLists.txt:21 (include):
include could not find load file:
/home/yuanfang/jdk14/../../resources/cmake/version.cmake
CMake Error at CMakeLists.txt:93 (add_subdirectory):
add_subdirectory given source
"/home/yuanfang/jdk14/../../deps/rhino/scripting_tasks" which is not an
existing directory.
CMake Error at CMakeLists.txt:98 (ojdkbuild_add_subdirectory):
Unknown CMake command "ojdkbuild_add_subdirectory".
-- Configuring incomplete, errors occurred!
See also "/home/yuanfang/jdk14/cmake-build-debug/CMakeFiles/CMakeOutput.log".
Cannot get compiler information:
Compiler exited with error code 1: /usr/bin/cc -xobjective-c -I/home/yuanfang/jdk14/build/linux-x86_64-server-release/hotspot/variant-server/gensrc/adfiles......./loading/LibraryLoader/jar_src -g -fpch-preprocess -v -dD -E
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-10ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
COLLECT_GCC_OPTIONS='-I' '/home/yuanfang/jdk14/build/linux-x86_64-server-release/hotspot/variant-server/gensrc/adfiles' '-I' '......'-g' '-fpch-preprocess' '-v' '-dD' '-E' '-D' '___CIDR_DEFINITIONS_END' '-mtune=generic' '-march=x86-64'
cc1obj -E -quiet -v #/tmp/cci3XM6r -imultiarch x86_64-linux-gnu -D ___CIDR_DEFINITIONS_END /tmp/compiler-file5929385022787926768 -mtune=generic -march=x86-64 -fpch-preprocess -g -fworking-directory -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -dD
cc: fatal error: cannot execute 'cc1obj': execvp: No such file or directory
compilation terminated.
[Failed to reload]
step: check out this projecdt :https://github.com/ojdkbuild/ojdkbuild.git
step: put the source code of OpenJDK14 in ojdkbuild/src/
step: copy reousrces directory and CMakelists.txt to OpenJDK14
step: recomile openjdk and import project to CLin

Java agent library failed to init: instrument

I'm working on an open-source project called "Cloudnet-v3". I am using a symlink /data on my local machine to the data-point in my IntelliJProjects-Folder.
I got the following startup command:
[java, -XX:+UseG1GC, -XX:MaxGCPauseMillis=50, -XX:-UseAdaptiveSizePolicy, -XX:CompileThreshold=100, -XX:+UnlockExperimentalVMOptions, -XX:+UseCompressedOops, -Dcom.mojang.eula.agree=true, -Djline.terminal=jline.UnsupportedTerminal, -Dfile.encoding=UTF-8, -Dio.netty.noPreferDirect=true, -Dclient.encoding.override=UTF-8, -Dio.netty.maxDirectMemory=0, -Dio.netty.leakDetectionLevel=DISABLED, -Dio.netty.recycler.maxCapacity=0, -Dio.netty.recycler.maxCapacity.default=0, -DIReallyKnowWhatIAmDoingISwear=true, -Dcloudnet.wrapper.receivedMessages.language=english, -Xmx372M, -javaagent: "/data/temp/caches/wrapper.jar", -cp, "/data/launcher/libs/io/kubernetes/client-java/4.0.0/client-java-4.0.0.jar:/data/launcher/libs/io/netty/netty-codec-http/4.1.36.Final/netty-codec-http-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-handler/4.1.36.Final/netty-handler-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-transport-native-epoll/4.1.36.Final/netty-transport-native-epoll-4.1.36.Final-linux-x86_64.jar:/data/launcher/libs/io/netty/netty-transport-native-kqueue/4.1.36.Final/netty-transport-native-kqueue-4.1.36.Final-osx-x86_64.jar:/data/launcher/libs/io/kubernetes/client-java-api/4.0.0/client-java-api-4.0.0.jar:/data/launcher/libs/io/kubernetes/client-java-proto/4.0.0/client-java-proto-4.0.0.jar:/data/launcher/libs/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar:/data/launcher/libs/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/data/launcher/libs/org/apache/commons/commons-compress/1.18/commons-compress-1.18.jar:/data/launcher/libs/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar:/data/launcher/libs/com/squareup/okhttp/okhttp-ws/2.7.5/okhttp-ws-2.7.5.jar:/data/launcher/libs/com/google/guava/guava/25.1-jre/guava-25.1-jre.jar:/data/launcher/libs/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/data/launcher/libs/org/bouncycastle/bcprov-ext-jdk15on/1.59/bcprov-ext-jdk15on-1.59.jar:/data/launcher/libs/org/bouncycastle/bcpkix-jdk15on/1.59/bcpkix-jdk15on-1.59.jar:/data/launcher/libs/com/google/protobuf/protobuf-java/3.4.0/protobuf-java-3.4.0.jar:/data/launcher/libs/com/google/code/gson/gson/2.8.2/gson-2.8.2.jar:/data/launcher/libs/io/netty/netty-codec/4.1.36.Final/netty-codec-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-transport-native-unix-common/4.1.36.Final/netty-transport-native-unix-common-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-transport/4.1.36.Final/netty-transport-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-buffer/4.1.36.Final/netty-buffer-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-resolver/4.1.36.Final/netty-resolver-4.1.36.Final.jar:/data/launcher/libs/io/netty/netty-common/4.1.36.Final/netty-common-4.1.36.Final.jar:/data/launcher/libs/io/sundr/builder-annotations/0.9.2/builder-annotations-0.9.2.jar:/data/launcher/libs/io/swagger/swagger-annotations/1.5.12/swagger-annotations-1.5.12.jar:/data/launcher/libs/com/squareup/okhttp/logging-interceptor/2.7.5/logging-interceptor-2.7.5.jar:/data/launcher/libs/com/squareup/okhttp/okhttp/2.7.5/okhttp-2.7.5.jar:/data/launcher/libs/joda-time/joda-time/2.9.3/joda-time-2.9.3.jar:/data/launcher/libs/org/joda/joda-convert/1.2/joda-convert-1.2.jar:/data/launcher/libs/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/data/launcher/libs/org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar:/data/launcher/libs/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar:/data/launcher/libs/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:/data/launcher/libs/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:/data/launcher/libs/org/bouncycastle/bcprov-jdk15on/1.59/bcprov-jdk15on-1.59.jar:/data/launcher/libs/io/sundr/sundr-core/0.9.2/sundr-core-0.9.2.jar:/data/launcher/libs/io/sundr/sundr-codegen/0.9.2/sundr-codegen-0.9.2.jar:/data/launcher/libs/io/sundr/resourcecify-annotations/0.9.2/resourcecify-annotations-0.9.2.jar:/data/launcher/libs/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar:/data/launcher/versions/3.0.0-RELEASE-e48128a/driver.jar:/data/temp/caches/wrapper.jar", de.dytanic.cloudnet.wrapper.Main, nogui]
And my current workdir is: /data/temp/services/Lobby-1#4a517311-09e6-4f77-89a5-64b4bc15399a
So whenever I am in the workdir and execute the given command, it fails with the following error: Error opening zip file or JAR manifest missing :
Error occurred during initialization of VM
agent library failed to init: instrument Full Log
Now I am wondering because it's working in the automatic-environment but there are no changes to the master-Branch Source e.g. a changed Path to /data/launcher instead of launcher (System.getProperty("cloudnet.launcher.dir", "/data/launcher"))[https://github.com/CloudNetService/CloudNet-v3/blob/master/cloudnet-launcher/src/main/java/de/dytanic/cloudnet/launcher/Constants.java].
A short lookup: ls -laR /Users/.../Documents/IdeaProjects/cloudnet-parent/data
javaagent option is misused. Correct syntax is
-javaagent:/data/temp/caches/wrapper.jar

Java: Class not found for PageRank algorithm in Apache Hadoop

I am trying to run PageRank algorithm in Apache Hadoop (2.6.5) cluster (1 master 2 slaves). I am using the program in this repository - https://github.com/danielepantaleone/hadoop-pagerank.git. I was able to compile all the sources using this command -
sudo javac -classpath ${HADOOP_CLASSPATH} -d ./build src/it/uniroma1/hadoop/pagerank/PageRank.java src/it/uniroma1/hadoop/pagerank/job1/PageRankJob1Mapper.java src/it/uniroma1/hadoop/pagerank/job1/PageRankJob1Reducer.java src/it/uniroma1/hadoop/pagerank/job2/PageRankJob2Mapper.java src/it/uniroma1/hadoop/pagerank/job2/PageRankJob2Reducer.java src/it/uniroma1/hadoop/pagerank/job3/PageRankJob3Mapper.java
I created the jar file using this command sudo jar -cf build/pagerank.jar build/.
I am trying to run the program just like the wordcount example like this -
sudo bin/hadoop jar hadoop-pagerank/build/pagerank.jar PageRank --
input /usr/local/hdfs/web-Google.txt --output /usr/local/hdfs-out-PR
Sometimes I get an error like this -
Exception in thread "main" java.lang.NoClassDefFoundError: PageRank (wrong name: it/uniroma1/hadoop
/pagerank/PageRank)
and sometimes I get an error like this - Exception in thread "main" java.lang.ClassNotFoundException: PageRank for different types of compilation.
I am not sure what am I doing wrong. Can anyone please help me in proper steps to compile and run the program in Hadoop ? I dont have any pom.xml file and I am able to run the provided wordcount example jar.
You have to use package name before the name of the class,
it means you have to use :
it.uniroma1.hadoop.pagerank.PageRank
rather than PageRank
in your command.
like this :
hadoop jar hadoop-pagerank/build/pagerank.jar it.uniroma1.hadoop.pagerank.PageRank --input /usr/local/hdfs/web-Google.txt --output /usr/local/hdfs-out-PR

Command: java -jar [...] Fails with Error Message

I am running java 1.8.0_65 on Windows 7.
I create a JAR and run it with the following command:
java -jar printxml.jar
And get this error:
Error: Could not find or load main class printxml.PrintXml
Here is my command to create the JAR:
jar cmfev manifest.txt printxml.jar printxml.PrintXml #filelist.txt
Contents of file "manifest.txt":
Class-Path: C:\Users\Me\SQLSER~1\JDBC\jtds-1.3.1.jar
I checked whether printxml.PrintXml class is in the JAR via this command:
jar tvf printxml.jar printxml/PrintXml.class
The command succeeded, i.e. PrintXml class is in the JAR.
I then checked if the PrintXml class in the JAR has a "main" method via this command:
javap -classpath printxml.jar -public printxml.PrintXml
The command succeeded and its output included...
public static void main(java.lang.String[]);
Searching the Internet, I found only the obvious answers, like:
Your classpath is wrong.
Your class doesn't have a "main" method.
Can someone please tell me how to resolve this problem?
Thanks,
Avi.
As Homer Simpson would say: D'OH
The value of the Class-Path entry in file "manifest.txt" is wrong!
It needs to be a URL!
So I changed it to:
file:/C:/Users/Me/SQLSER~1/JDBC/jtds-1.3.1.jar
Hey presto! No more error message. Now it runs!
Thanks to all who helped. ;-)

Categories

Resources