I am using Ubuntu 14.04 with Oracle JDK 8. I want to inspect performance of my application using VisualVM. I can inspect other applications like JDownloader but I can't inspect my own applications and Eclipse 4.3. Before I made fresh install of Ubuntu, I was using JDK 7 and I have no problem and using it without any configuration. It gives following log.
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor com.sun.tools.visualvm.core.ui.DataSourceWindowManager$1
java.lang.IllegalArgumentException: Unexpected composite type for ThreadInfo
at sun.management.ThreadInfoCompositeData.validateCompositeData(ThreadInfoCompositeData.java:372)
at sun.management.ThreadInfoCompositeData.getInstance(ThreadInfoCompositeData.java:68)
at java.lang.management.ThreadInfo.<init>(ThreadInfo.java:263)
at java.lang.management.ThreadInfo.from(ThreadInfo.java:794)
Caused: 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:483)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory$CompositeBuilderViaFrom.fromCompositeData(DefaultMXBeanMappingFactory.java:1018)
Caused: java.io.InvalidObjectException: Failed to invoke from(CompositeData)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory.invalidObjectException(DefaultMXBeanMappingFactory.java:1457)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory$CompositeBuilderViaFrom.fromCompositeData(DefaultMXBeanMappingFactory.java:1021)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory$CompositeMapping.fromNonNullOpenValue(DefaultMXBeanMappingFactory.java:919)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory$NonNullMXBeanMapping.fromOpenValue(DefaultMXBeanMappingFactory.java:133)
at com.sun.jmx.mbeanserver.ConvertingMethod.fromOpenReturnValue(ConvertingMethod.java:131)
at com.sun.jmx.mbeanserver.MXBeanProxy.invoke(MXBeanProxy.java:168)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:252)
Caused: java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy8.getThreadInfo(Unknown Source)
at com.sun.tools.visualvm.jmx.impl.JmxSupport.isReadOnlyConnection(JmxSupport.java:95)
at com.sun.tools.visualvm.jmx.impl.JmxModelImpl.isTakeThreadDumpSupported(JmxModelImpl.java:311)
at com.sun.tools.visualvm.application.views.threads.ApplicationThreadsViewProvider.resolveThreads(ApplicationThreadsViewProvider.java:65)
at com.sun.tools.visualvm.application.views.threads.ApplicationThreadsViewProvider.supportsViewFor(ApplicationThreadsViewProvider.java:29)
at com.sun.tools.visualvm.application.views.threads.ApplicationThreadsViewProvider.supportsViewFor(ApplicationThreadsViewProvider.java:25)
at com.sun.tools.visualvm.core.ui.DataSourceViewsManager.getViews(DataSourceViewsManager.java:116)
at com.sun.tools.visualvm.core.ui.DataSourceWindowManager.openWindowAndAddView(DataSourceWindowManager.java:169)
at com.sun.tools.visualvm.core.ui.DataSourceWindowManager.access$000(DataSourceWindowManager.java:30)
at com.sun.tools.visualvm.core.ui.DataSourceWindowManager$1.run(DataSourceWindowManager.java:80)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1393)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2005)
you should run visualvm on the same JDK version as your app, look at help->about->details (Java), mine was surprisingly jdk8 instead of jdk13 (I have both), so you can setup JDK version for visualvm manually etc/visualvm.conf, uncomment and setup parameter
visualvm_jdkhome=C:\Program Files\Java\jdk-13
run eclipse and your application with jvm parameters -Duser.language=en -Duser.country=us ...
then you will be able profile with jvisualvm.
for eclise put this two lines in eclipse.ini
-Duser.language=en
-Duser.country=us
maybe your pre installed Ubuntu had languge settings as english and you was ok.
Related
I have been trying to run ciscoASDM. After I run the command javaws startup.jnlp and app opens. After login, it goes freeze at 17%. What may be the problem?
I have java
java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.16.0-openjdk-amd64 1611 /usr/lib/jvm/java-1.16.0-openjdk-amd64
java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64
$ javaws startup.jnlp
selected jre: /usr/lib/jvm/java-8-openjdk-amd64/jre
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
selected jre: /usr/lib/jvm/java-8-openjdk-amd64/jre
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
Codebase matches codebase manifest attribute, and application is signed. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details.
Starting application [com.cisco.launcher.Launcher] ...
asdm.runStartupWizard = true
java.lang.ClassNotFoundException: com.sun.deploy.trace.Trace
at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1640)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.cisco.launcher.i.a(Unknown Source)
at com.cisco.launcher.i.if(Unknown Source)
at com.cisco.launcher.i.a(Unknown Source)
at com.cisco.launcher.s.if(Unknown Source)
at com.cisco.launcher.Launcher.main(Unknown Source)
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 net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:576)
at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:945)
According to this Github issue, Cisco ASDM does not work with OpenJDK 8 because deploy.jar file is missing.
I have Mac OS X 10.13.6. Previously I had the official JDK 8 installed which used to work fine but recently I switched to the Homebrew version and also upgraded to JDK 10. This has suddenly broken my java setup. Now when I try to launch Webstorm I get the following error:
com.intellij.ide.plugins.PluginManager$StartupAbortedException: java.lang.reflect.InvocationTargetException
at com.intellij.ide.plugins.PluginManager.a(PluginManager.java:78)
at java.lang.Thread.run(Thread.java:745)
Caused by: 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.intellij.ide.plugins.PluginManager.a(PluginManager.java:75)
... 1 more
Caused by: java.lang.UnsatisfiedLinkError: /Applications/WebStorm.app/Contents/jdk/Contents/Home/jre/lib/libawt.dylib: dlopen(/Applications/WebStorm.app/Contents/jdk/Contents/Home/jre/lib/libawt.dylib, 1): Library not loaded: /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Versions/A/JavaNativeFoundation
Referenced from: /Applications/WebStorm.app/Contents/jdk/Contents/Home/jre/lib/libawt.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at java.awt.Toolkit$3.run(Toolkit.java:1636)
at java.awt.Toolkit$3.run(Toolkit.java:1634)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
at java.awt.Toolkit.<clinit>(Toolkit.java:1673)
at com.intellij.ui.AppUIUtil.updateFrameClass(AppUIUtil.java:155)
at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:94)
at com.intellij.idea.MainImpl.a(MainImpl.java)
at com.intellij.idea.MainImpl.start(MainImpl.java:43)
... 6 more
The folder /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Versions/A/ is not there and I can't find any instructions online on how to install it. I tried installing Oracle JDK 8 from the official binaries again but the installation fails with no details. I managed to install Oracle JDK 10 from the official binaries but the folder still isn't there. How can I fix this?
Thanks.
So I came across this post that lead me to the solution. I used Pacifist to extract JavaVM.framework from the High Sierra install dmg.
It's a macOS High Sierra 10.13.2
I put export DATABASE_URL=mysql://username:password#localhost:3306/mydb in ~/.bash_profile, restarted the machine and made sure that I get the value when in terminal I run echo $DATABASE_URL.
2.I launch eclipse using sudo ./eclipse
3.Also played around with launchd.conf but apparently that's not supported in the latest version of MacOS.
What am I missing here?
Update 1
When I run ./eclipse I get this error on the console:
java.lang.RuntimeException: Error initializing storage.
at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:77)
at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:295)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: java.io.FileNotFoundException: /Users/myuser/eclipse/configuration/org.eclipse.osgi/.manager/.fileTableLock (Permission denied)
at java.io.RandomAccessFile.open0(Native Method)
at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
at org.eclipse.osgi.internal.location.Locker_JavaNio.lock(Locker_JavaNio.java:36)
at org.eclipse.osgi.storagemanager.StorageManager.lock(StorageManager.java:388)
at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:701)
at org.eclipse.osgi.storage.Storage.getChildStorageManager(Storage.java:1749)
at org.eclipse.osgi.storage.Storage.getInfoInputStream(Storage.java:1766)
at org.eclipse.osgi.storage.Storage.<init>(Storage.java:126)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:75)
... 10 more
I am working on a site where I have to build a module to capture the web screen on click event. I referred few posts in SO and I tried using Robot (java.awt.Robot) and JNA (com.sun.jna.*) and both the cases I was successful when I tried from my local machine or a local tomcat server. It did capture the web page and I am using Java 1.7
When I deployed the code in my Ubuntu (Ubuntu 14.04.4), I started having challenges in both the cases.
With JNA, I keep getting the exception as mentioned below. FYI, I have mentioned the versions of Java that I am using in Ubuntu. I am sure this is something to do with configuration or I am not sure if my Java version is not picked properly by the system. Any guidance will be helpful. I referred through the internet but didnt find any guidance to solve this issue
The Java version I am using is javac 1.7.0_131 ( java-7-openjdk-amd64)
java.lang.UnsatisfiedLinkError: Error looking up function 'GetDesktopWindow': /usr/lib/jvm/default-java/bin/java: undefined symbol: GetDesktopWindow
at com.sun.jna.Function.<init>(Function.java:212) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:541) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:518) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:504) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.sun.jna.Library$Handler.invoke(Library.java:220) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.boot.service.$Proxy118.GetDesktopWindow(Unknown Source) ~[na:na]
at com.boot.service.AuditService.getScreenshot(AuditService.java:133) ~[AuditService.class:na]
at com.boot.service.AuditService.captureScreen(AuditService.java:118) ~[AuditService.class:na]
at com.boot.service.AuditService.captureScreenshotAndStore(AuditService.java:66) ~[AuditService.class:na]
at com.boot.controller.AuditController.captureScreenshotAndStore(AuditController.java:38) ~[AuditController.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_131]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_131]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
When I list my JVM folder, these are the different version of Java I see,
default-java java-1.7.0-openjdk-amd64 java-7-openjdk-amd64 java-7-oracle java-8-oracle
With Robot, it worked good in my local but failed in Ubuntu with the following error.
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_131]
at java.lang.Class.forName(Class.java:195) ~[na:1.7.0_131]
at java.awt.Toolkit$2.run(Toolkit.java:869) ~[na:1.7.0_131]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_131]
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:861) ~[na:1.7.0_131]
I referred few posts which asked to update the headless variable to true. I am using Spring boot and not sure how to set that but I did System.setProperty("java.awt.headless", "false"); as part of the service constructor. It didnt help either
The GetDesktopWindow function is part of the Microsoft Windows API. Running it on a Linux environment won't work. I believe it works on your machine because your PC is a Microsoft Windows OS.
There is an OS independent solution, here on SO that accomplishes your requirements.
Trying to launch a java FX application on a Linux system using X. I get the following stack trace. After a bunch of googling and installing various packages, I am at a loss. Any thoughts?
java -jar tacoma_testing.jar
Prism-ES2 Error : GL_VERSION (major.minor) = 1.4
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.javafx.main.Main.launchApp(Main.java:698)
at com.javafx.main.Main.main(Main.java:871)
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /projects/tacoma/tacoma_regression_testing/jdk1.7.0_25/jre/lib/amd64/libglass.so: libgio-2.0.so.0: cannot open shared object file: No such file or directory
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:281)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:124)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.UnsatisfiedLinkError: /projects/tacoma/tacoma_regression_testing/jdk1.7.0_25/jre/lib/amd64/libglass.so: libgio-2.0.so.0: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1843)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1061)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:200)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:88)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:73)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:80)
at com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:28)
at com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:25)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.glass.ui.gtk.GtkPlatformFactory.<clinit>(GtkPlatformFactory.java:25)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:20)
at com.sun.glass.ui.Application.Run(Application.java:103)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:271)
... 5 more
Redhat is not listed as as supported configuration for JavaFX 2.2.
Nor is running JavaFX in a headless mode.
This may change for Java 8, but Java 8 has not been released yet, so the list of supported configurations for JavaFX running on Java 8 has not been published.
Currently the supported configuration set for Linux is only => Ubuntu 10.4+ gtk2 2.18+ with optional additional requirements for av codecs if you also want media playback support.
So try using a supported Ubuntu system instead of Redhat and you may or may not get that working in a headless environment.
I tested and it works fine with Redhat 6. Redhat 5 seems to be the problem.
Redhat Enterprise Linux 6 support will be added for Java 8 (to be released in the next few weeks).
A RHEL 5.5 support request was closed as won't fix, see RT-22564 "JavaFX Support for Red Hat Enterprise Linux 5.5".
If you can find a way to install gtk2 2.18+ on RHEL 5 you may be able to get it to work, though no promises.