Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 386712

Summary: eclipse hangs when opening XML Schema editor
Product: [WebTools] WTP Source Editing Reporter: Willem Van Asperen <willem>
Component: wst.xsdAssignee: wst.xsd <wst.xsd-inbox>
Status: CLOSED DUPLICATE QA Contact: Keith Chong <keith.chong.ca>
Severity: blocker    
Priority: P3 CC: thatnitind, willem
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
thread dump from visualvm none

Description Willem Van Asperen CLA 2012-08-06 18:06:42 EDT
When I open a relatively simple XSD, eclipse shows the usual overview of the XSD file, but then hangs.

I can not select anything in the editor window. I cannot close that window or switch to the Source tab.

I can still select another file from the project explorer, but cannot open it. The menu also still seems to function, but anything selected there does not work (for instance, XSD > Zoom in). The CPU is not doing anything.

I can close eclipse and then the eclipse window dissapears. Having started eclipse from the command line, it does not finish however. I have to manually Ctrl-C kill it.

There is nothing in the log file.

I had the same with Indigo, tried to fix it, came into a lot of problems, could not rollback and then moved to Juno. Now I run into the same problem again...
Comment 1 Willem Van Asperen CLA 2012-08-06 18:08:53 EDT
Oh, I forgot:

This is a vanilla download of Eclipse J2EE package with only subversive and M2 installed.
Comment 2 Willem Van Asperen CLA 2012-08-06 18:16:44 EDT
And some other behaviour:

- Try to open an xsd
- eclipse hangs
- When I click [x] to close eclipse any pending user actions (like Project > Properties from the menu or switch to the Source tab in the XML Schema editor) suddenly become active
- Cancel the close
- Open a Java file
- It shows up
- I can enter text but not put the cursor anywhere with my mouse...
- Click [x]
- All pending user actions are executed
- Click [x]
- eclipse closes the normal way
- but the process does not finish; I do not get a command prompt and have to Ctrl-C eclipse again

Hope this helps.
Comment 3 Willem Van Asperen CLA 2012-08-06 18:31:59 EDT
Just for the sake of it:

- Uninstalled subclipse -- same issue
- Tried a vanilla Eclipse J2EE installation with virgin workspace -- same issue when I create a new Java project and add a new XML Schema
Comment 4 Willem Van Asperen CLA 2012-08-06 18:35:12 EDT
(sorry, that should be Subversive)
Comment 5 Nitin Dahyabhai CLA 2012-08-06 22:32:34 EDT
Willem, can you capture a stack trace while it's unresponsive?

http://wiki.eclipse.org/index.php/How_to_report_a_deadlock
Comment 6 Willem Van Asperen CLA 2012-08-07 02:25:24 EDT
Created attachment 219604 [details]
thread dump from visualvm
Comment 7 Nitin Dahyabhai CLA 2012-08-07 10:51:57 EDT
Well that's interesting, your main/UI thread is waiting for some sort of printer information.


"main" prio=10 tid=0x00007f0534008000 nid=0x6bc8 runnable [0x00007f0538798000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.gtk.OS._gtk_enumerate_printers(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_enumerate_printers(OS.java:9220)
	at org.eclipse.swt.printing.Printer.getPrinterList(Printer.java:100)
	at org.eclipse.gef.ui.actions.PrintAction.calculateEnabled(PrintAction.java:45)
	at org.eclipse.gef.ui.actions.WorkbenchPartAction.isEnabled(WorkbenchPartAction.java:123)
	at org.eclipse.jface.commands.ActionHandler.isEnabled(ActionHandler.java:141)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.canExecute(E4HandlerProxy.java:59)
	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:210)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.canExecute(HandlerServiceImpl.java:110)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.canExecuteItem(HandledContributionItem.java:865)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$2(HandledContributionItem.java:854)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$3.run(HandledContributionItem.java:211)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateItemEnablement(HandledContributionItem.java:238)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$ToolItemUpdateTimer.run(HandledContributionItem.java:144)
	at org.eclipse.swt.widgets.Display.timerProc(Display.java:4121)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2332)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3177)
...
Comment 8 Nitin Dahyabhai CLA 2012-08-07 10:57:55 EDT
See bug 153936 comment 44 for a workaround.

*** This bug has been marked as a duplicate of bug 153936 ***
Comment 9 Willem Van Asperen CLA 2012-08-07 11:25:58 EDT
This indeed is a "printer API" problem. Thanks for pointing me to this solution:

put 
-Dorg.eclipse.swt.internal.gtk.disablePrinting
in the eclipse.ini and your'e done.

thanks.