VisualVM can not start - java

I have a remote Debian Squeeze server. I've installed Oracle JDK 1.7.0_07 manually and configured alternatives to every binary in jdk/bin path. Also i exported the global JAVA_HOME variable.
# java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Server VM (build 23.3-b01, mixed mode)
#
Server has Gnome on board and I'm connecting with putty and X-Windows forwarding enabled.
But when I'm trying to launch VisualVM with jvisualvm command I just get nothing with 5-10 sec pause:
# jvisualvm
#
And when I try to show help, I see an Exception:
# jvisualvm --help
Usage: /usr/java/jdk1.7.0_07/bin/../lib/visualvm//platform/lib/nbexec {options} arguments
General options:
--help show this help
--jdkhome <path> path to Java(TM) 2 SDK, Standard Edition
-J<jvm_option> pass <jvm_option> to JVM
--cp:p <classpath> prepend <classpath> to classpath
--cp:a <classpath> append <classpath> to classpath
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.core.startup.Splash$SplashComponent
at org.netbeans.core.startup.Splash.<init>(Splash.java:111)
at org.netbeans.core.startup.Splash.getInstance(Splash.java:64)
at org.netbeans.core.startup.Main.setStatusText(Main.java:47)
at org.netbeans.core.startup.NbEvents.setStatusText(NbEvents.java:384)
at org.netbeans.core.startup.NbEvents.logged(NbEvents.java:159)
at org.netbeans.Events.log(Events.java:127)
at org.netbeans.core.startup.ModuleList.readInitial(ModuleList.java:129)
at org.netbeans.core.startup.ModuleSystem.readList(ModuleSystem.java:241)
at org.netbeans.core.startup.CLICoreBridge.usage(CLICoreBridge.java:69)
at org.netbeans.CLIHandler.showHelp(CLIHandler.java:125)
at org.netbeans.CLIHandler.checkHelp(CLIHandler.java:179)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:530)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:346)
at org.netbeans.MainImpl.execute(MainImpl.java:151)
at org.netbeans.MainImpl.main(MainImpl.java:46)
at org.netbeans.Main.main(Main.java:39)
I googled that exception and found out that the libxtst-dev library is missing, but I installed it previously.
So what is the problem, how can I figure out what is going wrong?
UPDATE:
I'm working under root.
I don't have other versions of JDK in the system, the default OpenJDK was removed with apt-get purge.
My CLASSPATH system variable is empty, is it a problem?
UPDATE2:
libXtst is in /usr/lib
root#test:/usr/lib# ls -la /usr/lib | grep libXtst
-rw-r--r-- 1 root root 26666 Июн 23 2010 libXtst.a
lrwxrwxrwx 1 root root 16 Окт 7 01:18 libXtst.so -> libXtst.so.6.1.0
lrwxrwxrwx 1 root root 16 Окт 6 20:26 libXtst.so.6 -> libXtst.so.6.1.0
-rw-r--r-- 1 root root 23616 Июн 23 2010 libXtst.so.6.1.0
libXext is also in /usr/lib
root#test:~# ls -la /usr/lib | grep libXext
-rw-r--r-- 1 root root 118668 Июл 11 2010 libXext.a
lrwxrwxrwx 1 root root 16 Окт 6 22:26 libXext.so -> libXext.so.6.4.0
lrwxrwxrwx 1 root root 16 Май 21 13:42 libXext.so.6 -> libXext.so.6.4.0
-rw-r--r-- 1 root root 74432 Июл 11 2010 libXext.so.6.4.0
root#test:~#
here is output for command jvisualvm -J-Dnetbeans.logger.console=true
root#test:~# jvisualvm -J-Dnetbeans.logger.console=true
-------------------------------------------------------------------------------
>Log Session: Monday, October 8, 2012 10:48:32 PM MSK
>System Info:
Product Version = Java VisualVM
Operating System = Linux version 2.6.32-5-amd64 running on i386
Java; VM; Vendor = 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01; Oracle Corporation
Runtime = Java(TM) SE Runtime Environment 1.7.0_07-b10
Java Home = /usr/java/jdk1.7.0_07/jre
System Locale; Encoding = ru_RU (visualvm); UTF-8
Home Directory = /root
Current Directory = /root
User Directory = /root/.visualvm/7u6
Cache Directory = /root/.visualvm/7u6/var/cache
Installation = /usr/java/jdk1.7.0_07/lib/visualvm/visualvm
/usr/java/jdk1.7.0_07/lib/visualvm/profiler
/usr/java/jdk1.7.0_07/lib/visualvm/platform
Boot & Ext. Classpath = /usr/java/jdk1.7.0_07/jre/lib/resources.jar:/usr/java/jdk1.7.0_07/jre/lib/rt.jar:/usr/java/jdk1.7.0_07/jre/lib/sunrsasign.jar:/usr/java/jdk1.7.0_07/jre/lib/jsse.jar:/usr/java/jdk1.7.0_07/jre/lib/jce.jar:/usr/java/jdk1.7.0_07/jre/lib/charsets.jar:/usr/java/jdk1.7.0_07/jre/lib/jfr.jar:/usr/java/jdk1.7.0_07/jre/classes:/usr/java/jdk1.7.0_07/jre/lib/ext/zipfs.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/dnsns.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/localedata.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/sunpkcs11.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/sunec.jar:/usr/java/jdk1.7.0_07/jre/lib/ext/sunjce_provider.jar
Application Classpath = /usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/boot.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/org-openide-modules.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/org-openide-util.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/org-openide-util-lookup.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/boot_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/boot_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-modules_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-modules_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-util_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-util-lookup_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-util-lookup_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/lib/locale/org-openide-util_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/dt.jar:/usr/java/jdk1.7.0_07/lib/tools.jar
Startup Classpath = /usr/java/jdk1.7.0_07/lib/visualvm/platform/core/org-openide-filesystems.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/core.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/locale/core_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/locale/org-openide-filesystems_ja.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/locale/core_zh_CN.jar:/usr/java/jdk1.7.0_07/lib/visualvm/platform/core/locale/org-openide-filesystems_zh_CN.jar:/usr/java/jdk1.7.0_07/bin/../lib/visualvm/visualvm/core/com-sun-tools-visualvm-modules-startup.jar:/usr/java/jdk1.7.0_07/bin/../lib/visualvm/visualvm/core/locale/com-sun-tools-visualvm-modules-startup_ja.jar:/usr/java/jdk1.7.0_07/bin/../lib/visualvm/visualvm/core/locale/core_visualvm.jar:/usr/java/jdk1.7.0_07/bin/../lib/visualvm/visualvm/core/locale/com-sun-tools-visualvm-modules-startup_zh_CN.jar
-------------------------------------------------------------------------------
java.lang.UnsatisfiedLinkError: /usr/java/jdk1.7.0_07/jre/lib/i386/xawt/libmawt.so: libXext.so.6: Unable to open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1846)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:77)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
at org.netbeans.core.startup.Main.start(Main.java:203)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:84)
at java.lang.Thread.run(Thread.java:722)
UPDATE 3
I downloaded Java demos and tried to launch SwingSet2:
root#test:/tmp/jdk1.7.0_06# java -jar demo/jfc/SwingSet2/SwingSet2.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/java/jdk1.7.0_07/jre/lib/i386/xawt/libmawt.so: libXext.so.6: unbale to open shared object file: no such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1846)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1648)
at java.awt.Toolkit.<clinit>(Toolkit.java:1670)
at java.awt.Component.<clinit>(Component.java:595)
UPDATE 4
finally my mistake was in the version of JDK, see accepted answer.

I think you found the correct answer when you googled for the exception. libXtst.so.6 is missing, it should be in /usr/lib directory. Are you sure that it is installed? Can you run any other Java GUI application like SwingSet2? Can you run VisualVM with -J-Dnetbeans.logger.console=true and post the output?
jvisualvm -J-Dnetbeans.logger.console=true

Resolution for MAC: [In my case nothing was happening when I was trying to open the app]
Goto Application folder, Show Contents -> Resources/visualvm/etc/visualvm.conf
Example:
/Applications/VisualVM.app/Contents/Resources/visualvm/etc/visualvm.conf
Uncomment "visualvm_jdkhome" and replace the value with the correct JDK home path.
Example:
visualvm_jdkhome="/Users/username/tools/jdk-11.0.10.jdk/Contents/Home"
Try opening the app again, It should open.

Related

Building OpenJDK Panama 19

i wanted to build OpenJDK panama for Windows 11 WSL from site:
uname Linux DESKTOP-LCGGQ32 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
git clone https://github.com/openjdk/panama-foreign
cd panama-foreign
On Windows 11 WSL I tried Commands:
./configure --with-boot-jdk=/mnt/c/Tools/jdk-17 --with-libclang="/mnt/c/Tools/LLVM" --with-toolchain-version=2019
Then
make
it fails on make
as shown below:
Building target 'default (exploded-image)' in configuration 'windows-x86_64-server-release'
Compiling 1 files for BUILD_TOOLS_HOTSPOT
Compiling 8 files for BUILD_TOOLS_LANGTOOLS
<3>init: (11742) ERROR: UtilAcceptVsock:244: accept4 failed 110
<3>init: (11743) ERROR: UtilAcceptVsock:244: accept4 failed 110
make[3]: *** [CompileToolsHotspot.gmk:47: /mnt/c/repo/panama-foreign/build/windows-x86_64-server-release/buildtools/buildtools/hotspot_tools_classes/_the.BUILD_TOOLS_HOTSPOT_batch] Error 255
make[2]: *** [make/Main.gmk:95: buildtools-hotspot] Error 2
make[2]: *** Waiting for unfinished jobs....
make[3]: *** [ToolsLangtools.gmk:37: /mnt/c/repo/panama-foreign/build/windows-x86_64-server-release/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch] Error 255
make[2]: *** [make/Main.gmk:74: buildtools-langtools] Error 2
ERROR: Build failed for target 'default (exploded-image)' in configuration 'windows-x86_64-server-release' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target buildtools_buildtools_hotspot_tools_classes__the.BUILD_TOOLS_HOTSPOT_batch:
<3>init: (11742) ERROR: UtilAcceptVsock:244: accept4 failed 110
* For target buildtools_langtools_tools_classes__the.BUILD_TOOLS_LANGTOOLS_batch:
<3>init: (11743) ERROR: UtilAcceptVsock:244: accept4 failed 110
* All command lines available in /mnt/c/repo/panama-foreign/build/windows-x86_64-server-release/make-support/failure-logs.
=== End of repeated output ===
No indication of failed target found.
HELP: Try searching the build log for '] Error'.
HELP: Run 'make doctor' to diagnose build problems.
make[1]: *** [/mnt/c/repo/panama-foreign/make/Init.gmk:315: main] Error 2
make: *** [/mnt/c/repo/panama-foreign/make/Init.gmk:186: default] Error 2
Configuration summary:
Name: windows-x86_64-server-release
Debug level: release
HS debug level: product
JVM variants: server
JVM features: server: 'cds compiler1 compiler2 epsilongc g1gc jfr jni-check jvmci jvmti management parallelgc serialgc services shenandoahgc vm-structs zgc'
OpenJDK target: OS: windows, CPU architecture: x86, address length: 64
Version string: 19-internal-adhoc.root.panama-foreign (19-internal)
Source date: Determined at build time
Tools summary:
Environment: wsl2 version 5.10.16.3-microsoft-standard-WSL2, #1 SMP Fri Apr 2 22:23:49 UTC 2021 (Ubuntu 20.04.4 LTS); windows version 10.0.22000.556; prefix "/mnt"; root "\wsl.localhost\Ubuntu-20.04"
Boot JDK: java version "17" 2021-09-14 LTS Java(TM) SE Runtime Environment (build 17+35-LTS-2724) Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing) (at /mnt/c/tools/jdk-17)
Toolchain: microsoft (Microsoft Visual Studio 2019)
C Compiler: Version 19.29.30136 (at /mnt/c/progra~2/micros~2/2019/profes~1/vc/tools/msvc/1429~1.301/bin/hostx86/x64/cl.exe)
C++ Compiler: Version 19.29.30136 (at /mnt/c/progra~2/micros~2/2019/profes~1/vc/tools/msvc/1429~1.301/bin/hostx86/x64/cl.exe)
Build performance summary:
Build jobs: 15
Memory limit: 15858 MB
WARNING: The result of this configuration has overridden an older
configuration. You should run 'make clean' to make sure you get a
proper build. Failure to do so might result in strange build problems.
cat: standard output: No such file or directory
I have looked the failure logs
File1:
buildtools_buildtools_hotspot_tools_classes__the.BUILD_TOOLS_HOTSPOT_batch.cmdline
/mnt/c/repo/panama-foreign/build/windows-x86_64-server-release/fixpath exec /mnt/c/tools/jdk-19/bin/javac.exe -J-XX:+UseSerialGC -J-Xms32M -J-Xmx512M -J-XX:TieredStopAtLevel=1 -g -Xlint:all -source 18 -target 18 -Xlint:-options -implicit:none -Xprefer:source -XDignore.symbol.file=true -encoding ascii -Werror -d /mnt/c/repo/panama-foreign/build/windows-x86_64-server-release/buildtools/buildtools/hotspot_tools_classes #/mnt/c/repo/panama-foreign/build/windows-x86_64-server-release/buildtools/buildtools/hotspot_tools_classes/_the.BUILD_TOOLS_HOTSPOT_batch.filelist
File2:
buildtools_langtools_tools_classes__the.BUILD_TOOLS_LANGTOOLS_batch.cmdline
/mnt/c/repo/panama-foreign/build/windows-x86_64-server-release/fixpath exec /mnt/c/tools/jdk-19/bin/javac.exe -J-XX:+UseSerialGC -J-Xms32M -J-Xmx512M -J-XX:TieredStopAtLevel=1 -g -Xlint:all -source 18 -target 18 -Xlint:-options -implicit:none -Xprefer:source -XDignore.symbol.file=true -encoding ascii -Werror -d /mnt/c/repo/panama-foreign/build/windows-x86_64-server-release/buildtools/langtools_tools_classes #/mnt/c/repo/panama-foreign/build/windows-x86_64-server-release/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch.filelist
Seems like the problem is because of WSL
https://github.com/microsoft/WSL/issues/6420
But i dont know how to fix this issue for panama.

Using tcnative module on AIX for HTTP2 on Tomcat

Has anyone successfully got the HTTP/2 connector working in Tomcat9 on AIX (e.g. powerpc-ibm-aix7.2.5.0)?
I followed the instructions here to build the tcnative module (using tomcat-native-1.2.24-src that comes with Tomcat 9.0.37, APR 1.5.2, OpenSSL 1.0.2, IBM Java 1.8.0_261) i.e.
$ ./configure --with-apr=/opt/freeware/bin/apr-1-config --with-java-home=/app/java8_64/ --with-ssl=yes --prefix=/app/tomcat
followed by
make && make install
This creates the expected entries in /app/tomcat/lib, i.e.
-rw-r--r-- 1 usrxxx grpxxxx 3440287 Mar 03 16:47 libtcnative-1.a
-rwxr-xr-x 1 usrxxx grpxxxx 1057 Mar 03 16:47 libtcnative-1.la
lrwxrwxrwx 1 usrxxx grpxxxx 23 Mar 03 16:47 libtcnative-1.so -> libtcnative-1.so.0.2.24
lrwxrwxrwx 1 usrxxx grpxxxx 23 Mar 03 16:47 libtcnative-1.so.0 -> libtcnative-1.so.0.2.24
-rwxr-xr-x 1 usrxxx grpxxxx 1372146 Mar 03 16:47 libtcnative-1.so.0.2.24
but when Tomcat starts I get
04-Mar-2021 15:30:00.752 WARNING [main] org.apache.catalina.core.AprLifecycleListener.init The Apache Tomcat Native library failed to load. The error reported was [tcnative-1 (Not found in java.library.path)]
java.lang.UnsatisfiedLinkError: tcnative-1 (Not found in java.library.path)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1462)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1414)
at java.lang.System.loadLibrary(System.java:584)
at org.apache.tomcat.jni.Library.<init>(Library.java:69)
at org.apache.tomcat.jni.Library.initialize(Library.java:206)
at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:198)
...
04-Mar-2021 15:30:01.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.library.path=/app/java8_64/jre/lib/ppc64/compressedrefs:/app/java8_64/jre/lib/ppc64:/app/java8_64/jre/lib/ppc64/j9vm:/app/java8_64/jre/lib/ppc64:/app/java8_64/jre/../lib/ppc64:/app/java8_64/jre/lib/icc:/opt/freeware/lib:/opt/freeware/lib64:/usr/lib:/usr/lib64:/app/tomcat/lib:/usr/lib64:/usr/lib
...
04-Mar-2021 15:30:02.233 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]] org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not available
at org.apache.catalina.connector.Connector.initInternal(Connector.java:1024)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:533)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1057)
Edit - based on suggestions from Piotr and Lorinczy:
Tried adding tcnative-1.so as a symlink - same error
Copied libtcnative-1.* to the bin folder. Still failing but new error (progress!?). Possible 32bit v 64bit issue?
09-Mar-2021 10:10:07.116 WARNING [main] org.apache.catalina.core.AprLifecycleListener.init The Apache Tomcat Native library failed to load. The error reported was [/app/apache-tomcat-9.0.37/bin/libtcnative-1.a ( 0509-022 Cannot load module /app/apache-tomcat-9.0.37/bin/libtcnative-1.a.
0509-026 System error: Cannot run a file that does not have a valid format.)]
java.lang.UnsatisfiedLinkError: /app/apache-tomcat-9.0.37/bin/libtcnative-1.a ( 0509-022 Cannot load module /app/apache-tomcat-9.0.37/bin/libtcnative-1.a.
0509-026 System error: Cannot run a file that does not have a valid format.)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1462)
...
All the dependencies seem to be available
$ldd libtcnative-1.so.0.2.24
libtcnative-1.so.0.2.24 needs:
/usr/lib/libssl.so
/usr/lib/libcrypto.so
/opt/freeware/lib/libapr-1.so
/usr/lib/libpthread.a(shr_xpg5.o)
/usr/lib/libc.a(shr.o)
/opt/freeware/lib/libgcc_s.a(shr.o)
/usr/lib/libcrypto.a(libcrypto.so.1.0.2)
/unix
/usr/lib/libpthreads.a(shr_comm.o)
/usr/lib/libcrypt.a(shr.o)
but the dump command seems to support the 32 v 64 bit theory:
$ dump -H -X64 libtcnative-1.so.0.2.24
libtcnative-1.so.0.2.24:
dump: libtcnative-1.so.0.2.24: 0654-108 file is not valid in the current object file mode.
Use the -X option to specify the desired object mode.
$ dump -H -X32 libtcnative-1.so.0.2.24
libtcnative-1.so.0.2.24:
***Loader Section***
Loader Header Information
VERSION# #SYMtableENT #RELOCent LENidSTR
0x00000001 0x00000364 0x00000771 0x00000084
#IMPfilID OFFidSTR LENstrTBL OFFstrTBL
0x00000007 0x0000aacc 0x00006406 0x0000ab50
***Import File Strings***
INDEX PATH BASE MEMBER
0 /opt/freeware/lib:/usr/lib:/lib
1 libssl.so
2 libcrypto.so
3 libapr-1.so
4 libpthread.a shr_xpg5.o
5 libc.a shr.o
6 libgcc_s.a shr.o
It looks like only the 32-bit version of APR is currently available on the server also. I will update once I can get the 64-bit version installed.
Further Updates
The commands I am trying now are:
$ export CFLAGS=-maix64
$ export OBJECT_MODE=64
$ ./configure --with-apr=/opt/freeware/bin/apr-1-config_64 --with-java-home=/app/java8_64/ --with-ssl=/usr/include/openssl --prefix=/app/tomcat
$ make && make install
No errors but same outcome however. This doesn't seem to build a 64 bit version of the tomcat native module (if that is the issue).

tomcat 8 stopped working after ubuntu update

I have recently updates my ubuntu deskto to 18.04. After this my tomcat is failing at startup. Each time I restart tomcat using the command service tomcat8 restart the log file give the following error -
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.get(LRUHybridCache.java:164)
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:303)
... 135 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119)
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2268)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities$3.run(ClassReflectionHelperUtilities.java:108)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities$3.run(ClassReflectionHelperUtilities.java:104)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities.secureGetDeclaredMethods(ClassReflectionHelperUtilities.java:104)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities.getDeclaredMethodWrappers(ClassReflectionHelperUtilities.java:133)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities.getAllMethodWrappers(ClassReflectionHelperUtilities.java:192)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities.getAllMethodWrappers(ClassReflectionHelperUtilities.java:193)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperImpl$3.compute(ClassReflectionHelperImpl.java:84)
at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperImpl$3.compute(ClassReflectionHelperImpl.java:80)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:115)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
I then installed jdk8 and run update-alternatives command like this -
dimension:bin$ sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1101 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1101 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/bin/javac 1081 manual mode
Press <enter> to keep the current choice[*], or type selection number:
dimension:bin$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
Press <enter> to keep the current choice[*], or type selection number:
When I again restarted the tomcat, I saw the same error. Here are the contents to my jvm folder -
ls -lh /usr/lib/jvm/
total 8.0K
lrwxrwxrwx 1 root root 25 Apr 8 18:46 default-java -> java-1.11.0-openjdk-amd64
lrwxrwxrwx 1 root root 21 Aug 24 23:06 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64
drwxr-xr-x 9 root root 4.0K Oct 4 10:56 java-11-openjdk-amd64
lrwxrwxrwx 1 root root 20 Oct 28 2016 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64
drwxr-xr-x 7 root root 4.0K Oct 4 16:03 java-8-openjdk-amd64
My JAVA_HOME env is currently set to empty.
What should I do to fix my issue.
The java.base part of exception stack trace at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) suggests that you are still running with JDK 11.
Ensure that Tomcat 8 is running with JDK 8. Try debugging the Tomcat startup script with set -x to see how is the Java location determined, maybe it's set in /etc/default/tomcat8?

Unable to find a javac compiler even when JDK present

I'm trying to run an Apache Hive web interface, so I downloaded the lastest version of ant (Ant 1.9.4), and when I execute the command to produce the hive.war file
ANT_LIB=/opt/ant/lib bin/hive --service hwi
I get the following error:
cp=/tmp/Jetty_0_0_0_0_9999_hive.hwi.0.10.0.war__hwi__ae9cmk/jsp
cp=null
work dir=/tmp/Jetty_0_0_0_0_9999_hive.hwi.0.10.0.war__hwi__ae9cmk/jsp
extension dir=/usr/lib/jvm/jdk1.7.0_65/jre/lib/ext:/usr/java/packages/lib/ext
srcDir=/tmp/Jetty_0_0_0_0_9999_hive.hwi.0.10.0.war__hwi__ae9cmk/jsp
compilerTargetVM=1.5
compilerSourceVM=1.5
include=org/apache/jsp/index_jsp.java
15/02/23 09:56:59 ERROR compiler.Compiler: Error compiling file: /tmp/Jetty_0_0_0_0_9999_hive.hwi.0.10.0.war__hwi__ae9cmk/jsp//org/apache/jsp/index_jsp.java [javac] warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
15/02/23 09:56:59 ERROR mortbay.log: /hwi/
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/jdk1.7.0_65/jre"
at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:130)
at org.apache.tools.ant.taskdefs.Javac.findSupportedFileExtensions(Javac.java:984)
at org.apache.tools.ant.taskdefs.Javac.scanDir(Javac.java:961)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:932)
at org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:220)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
I'm executing that code as root. My JAVA_HOME is correctly set at the .bashrc:
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_65
export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec
export HADOOP_CONF_DIR=/etc/hadoop/conf
export PATH=$PATH:$JAVA_HOME/bin
and .bash_profile files:
.bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_65
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export PATH
I want to know why is Ant referencing the javac at "/usr/lib/jvm/jdk1.7.0_65/jre". Moreover, here is my JDK structure:
[root#ip-10-32-205-19 ~]# cd $JAVA_HOME
[root#ip-10-32-205-19 jdk1.7.0_65]# ls -l
total 19760
drwxr-xr-x. 2 root root 4096 Feb 23 04:09 bin
-r--r--r--. 1 root root 3339 Jun 17 2014 COPYRIGHT
drwxr-xr-x. 4 root root 4096 Jun 17 2014 db
drwxr-xr-x. 3 root root 4096 Jun 17 2014 include
drwxr-xr-x. 5 root root 4096 Jun 17 2014 jre
drwxr-xr-x. 5 root root 4096 Feb 23 04:09 lib
-r--r--r--. 1 root root 40 Jun 17 2014 LICENSE
drwxr-xr-x. 4 root root 4096 Jun 17 2014 man
-r--r--r--. 1 root root 114 Jun 17 2014 README.html
-rw-r--r--. 1 root root 499 Jun 17 2014 release
-rw-r--r--. 1 root root 19902785 Jun 17 2014 src.zip
-rw-r--r--. 1 root root 110114 Jun 16 2014 THIRDPARTYLICENSEREADME-JAVAFX.txt
-r--r--r--. 1 root root 173559 Jun 17 2014 THIRDPARTYLICENSEREADME.txt
which shows I have the JDK, and not only the JRE installed. I also took a look at similar questions, but none could solve my problem. The Java is 64bits, plus I also ran source for both .bashrc and .bash_profile.
The error message says:
Perhaps JAVA_HOME does not point to the JDK. It is currently set to
"/usr/lib/jvm/jdk1.7.0_65/jre"
However, your .bashrc has:
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_65
You likely need to run source ~/.bashrc in your Bash shell to reset JAVA_HOME to the root of your JDK installation. Then run Ant again.

GSSException: [..] Encryption type AES256CTS mode with HMAC SHA1-96 is not supported/enabled

After setting our domain users to support AES encryption for Kerberos tokens (Windows Server 2008R2), on a web-application server side we get the following exception:
GSSException: Failure unspecified at GSS-API level (Mechanism level:
Encryption type AES256CTS mode with HMAC SHA1-96 is not
supported/enabled)
Strangely we have Java 6 (1.6.0_27) , which means that AES should be supported, according to this document: http://docs.oracle.com/javase/6/docs/technotes/guides/security/jgss/jgss-features.html
Any ideas what's missing in our web-application or Java, or third parties? We are using Spring security Kerberos extension (with minimal code modifications to fit into our current Spring 2.x version and additional authentication requirements).
EDIT (2017-05-06): upcoming JDK versions will have this included. Only a config parameter needs to be set, see JDK-8157561.
Follow this link - Java SE Downloads, scroll down and download the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for your specific JDK version and follow the process in this tutorial titled: 5.4.2. Kerberos and Unlimited Strength Policy.
The basic steps are as follows:
locate your JDK's security directory (showing Unix below):
$ locate 'jre/lib/security' | grep 'lib/security$'
/usr/java/jdk1.7.0_17/jre/lib/security
/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre/lib/security
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/security
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/lib/security
Noting the above, we need to add the downloaded JCE .jar files to /usr/java/jdk1.7.0_17/jre/lib/security.
The JCE .zip file includes the following (showing JDK 1.7's JCE):
$ ls -l UnlimitedJCEPolicy
total 16
-rw-rw-r-- 1 root root 2500 May 31 2011 local_policy.jar
-rw-r--r-- 1 root root 7289 May 31 2011 README.txt
-rw-rw-r-- 1 root root 2487 May 31 2011 US_export_policy.jar
These are the bundled versions with the JDK (again 1.7):
$ ls -l /usr/java/jdk1.7.0_17/jre/lib/security/*.jar
-rw-r--r--. 1 root root 2865 Mar 1 2013 /usr/java/jdk1.7.0_17/jre/lib/security/local_policy.jar
-rw-r--r--. 1 root root 2397 Mar 1 2013 /usr/java/jdk1.7.0_17/jre/lib/security/US_export_policy.jar
We need to move these out of the way and replace them with the included versions in the JCE .zip file. I typically do the following:
$ pushd /usr/java/jdk1.7.0_17/jre/lib/security/
/usr/java/jdk1.7.0_17/jre/lib/security ~
$ mkdir limited
$ mv *.jar limited/
$ cp ~/UnlimitedJCEPolicy/*.jar .
$ ls -l *.jar
-rw-r--r-- 1 root root 2500 Jun 25 12:50 local_policy.jar
-rw-r--r-- 1 root root 2487 Jun 25 12:50 US_export_policy.jar
Restart anything that's making use of JDK (Tomcat, etc.).

Categories

Resources