hbjastad
8 years agoContributor
HeadlessException when deploying war file
I have created a war file using Ready!API, and then I want to deploy it to Jetty. This works fine on a Windows machine, but when I try to do it in Jenkins (running Linux) I get:
[INFO] An exception was caught and reported. Message: java.awt.HeadlessException java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204) at java.awt.Window.<init>(Window.java:536) at java.awt.Frame.<init>(Frame.java:420) at java.awt.Frame.<init>(Frame.java:385) at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1758) at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1833) at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1696) at javax.swing.JOptionPane.getFrameForComponent(JOptionPane.java:1612) at com.jp.protection.gui.dialogs.LicenseErrorDialog.<init>(LicenseErrorDialog.java:49) at com.jp.protection.gui.dialogs.DefaultLicenseAdapter.<init>(DefaultLicenseAdapter.java:56) at com.jp.protection.pub.launch.ProtectionLauncher.initLicenseListener(ProtectionLauncher.java:128) at com.jp.protection.pub.launch.HeadlessProtectionLauncher.init(HeadlessProtectionLauncher.java:189) at com.jp.protection.pub.launch.ProtectionLauncher.init(ProtectionLauncher.java:113) at com.smartbear.ready.license.protection.HeadlessProtectionLauncherAdapter.init(HeadlessProtectionLauncherAdapter.java:93) at com.smartbear.ready.license.protection.SoapuiProtectionSupport.a(SoapuiProtectionSupport.java:124) at com.smartbear.ready.license.protection.SoapuiProtectionSupport.initProtectionLauncher(SoapuiProtectionSupport.java:103) at com.smartbear.ready.license.protection.SoapuiProtectionSupport.<init>(SoapuiProtectionSupport.java:70) at com.smartbear.ready.license.LicenseModule.configure(LicenseModule.java:29) at com.google.inject.PrivateModule.configure(PrivateModule.java:97) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) at com.smartbear.ready.license.headless.HeadlessLicenseInitializerModule.configureModule(HeadlessLicenseInitializerModule.java:47) at com.smartbear.ready.license.LicenseInitializerModule.configureModule(LicenseInitializerModule.java:31) at com.smartbear.ready.license.headless.HeadlessLicenseInitializerModule.configure(HeadlessLicenseInitializerModule.java:39) at com.google.inject.AbstractModule.configure(AbstractModule.java:59) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) at com.google.inject.spi.Elements.getElements(Elements.java:101) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103) at com.google.inject.Guice.createInjector(Guice.java:95) at com.google.inject.Guice.createInjector(Guice.java:72) at com.google.inject.Guice.createInjector(Guice.java:62) at com.eviware.soapui.mockaswar.MockAsWarProServlet$MockServletSoapUIProCore.<init>(MockAsWarProServlet.java:69) at com.eviware.soapui.mockaswar.MockAsWarProServlet.initMockServiceParameters(MockAsWarProServlet.java:33) at com.eviware.soapui.mockaswar.MockAsWarServlet.init(MockAsWarServlet.java:75) at javax.servlet.GenericServlet.init(GenericServlet.java:244) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:640)
I can see that the exception comes when doing some licensing checking, so I have the following questions:
1. Should a war file created with Ready!API be possible to run in Jetty without having a Pro license?
- If yes, then why does it fail on a headless server?
- If no, then why doesn't it fail on a Windows machine?
2. Jenkins has already specified -Djava.awt.headless=true, what else can be done to avoid the exception?