This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 197989 - MainImpl needs to run in headless mode
Summary: MainImpl needs to run in headless mode
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-22 09:12 UTC by stoto79
Modified: 2011-05-03 05:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stoto79 2011-04-22 09:12:04 UTC
JDeveloper is a product that uses Netbinox as its Equinox container. JDeveloper may run in headless mode, in which case all NB startup code that creates GUIs will throw a headless exception (see bug 197411 for example). I have attached one stack trace where this does happens, and, at a minimum, fixing this bug must address this manifestation of the issue. But to fix the entire problem, all calls to code in java.awt.* methods in the startup code might need to be made conditional on whether the product is ran in headless mode. 

[exec] Oracle JDeveloper Deploy 11.1.2.0.0
[exec] Copyright (c) 1997, 2011, Oracle and/or its affiliates. All
rights reserved.
[exec] Exception in thread "main"
java.lang.reflect.InvocationTargetException
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[exec] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

[exec] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

[exec] at java.lang.reflect.Method.invoke(Method.java:597)
[exec] at oracle.ide.osgi.boot.NbLauncher.launchNbMain(NbLauncher.java:219)
[exec] at oracle.ide.osgi.boot.NbLauncher.main(NbLauncher.java:189)
[exec] Caused by: java.awt.HeadlessException
[exec] at
java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
[exec] at java.awt.Window.<init>(Window.java:432)
[exec] at java.awt.Frame.<init>(Frame.java:403)
[exec] at java.awt.Frame.<init>(Frame.java:368)
[exec] at
javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1727)

[exec] at
javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1804)
[exec] at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1673)
[exec] at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:846)
[exec] at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:779)
[exec] at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:741)
[exec] at org.netbeans.MainImpl.execute(MainImpl.java:187)
[exec] at org.netbeans.MainImpl.main(MainImpl.java:81)
[exec] at org.netbeans.Main.main(Main.java:78)
[exec] ... 6 more
[exec] Result: 1
Comment 1 Antonin Nebuzelsky 2011-04-26 20:30:43 UTC
Reassigning to Jarda.
Comment 2 Jaroslav Tulach 2011-04-27 16:26:15 UTC
dialogs supressed in: ergonomics#f732f036f387


however that may not really help in your case. The problem boils down to a bit strange manipulation with locked user directory in your case. That may need completely different fix on your side.
Comment 3 Quality Engineering 2011-05-03 05:26:38 UTC
Integrated into 'main-golden', will be available in build *201105030000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f732f036f387
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #197989: Don't show dialogs when GraphicsEnvironment.isHeadless(). Assume the answer is "no".