Could not initialize class java.awt.Toolkit

Questions about YourKit Java Profiler
Post Reply
wesley.lago
Posts: 1
Joined: Mon Mar 23, 2015 4:29 pm

Could not initialize class java.awt.Toolkit

Post by wesley.lago »

I'm having trouble starting the yjp.sh, anyone seen this?
/opt/yjp-2014-build-14120/bin/yjp.sh
[YourKit Java Profiler 2014 build 14120] Log file: /opt/liferay/.yjp/log/yjp-26903.log
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 com.yourkit.Main$2.run(a:16)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
at javax.swing.UIManager.getSystemLookAndFeelClassName(UIManager.java:611)
at com.yourkit.Main1.entry(a:69)
... 5 more
Thanks
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Could not initialize class java.awt.Toolkit

Post by Anton Katilin »

Running yjp.sh without parameters launches the profiler UI. It cannot run in headless mode.

Does the system have a display?
What is the content of /opt/liferay/.yjp/log/yjp-26903.log ?
duane
Posts: 1
Joined: Thu May 21, 2015 11:11 pm

Re: Could not initialize class java.awt.Toolkit

Post by duane »

I am also have similar problems running YourKit remotely.

I am connecting the linux system using ssh -X, so there is a XWindows session available. I am able to run other XWindows application such as Firefox just fine.

How can I run YourKit over an XWindows session?

Thanks,
...Duane
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Could not initialize class java.awt.Toolkit

Post by Anton Katilin »

Hi Duane

You should not run the profiler UI remotely. It's a Java UI application and it may not work well this way.

Instead, please run the profiler client on your local machine and use the remote profiling feature to connect to the remote profiled application.

Best regards,
Anton
Post Reply