Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » IllegalStateException on accessing EPartService
icon9.gif  IllegalStateException on accessing EPartService [message #965892] Wed, 31 October 2012 15:39 Go to next message
Marko Herchet is currently offline Marko HerchetFriend
Messages: 13
Registered: May 2012
Junior Member
Hi all,

I have a pure e4-application with a Thread that checks the active session in the Background. When this check fails
EPartService.getDirtyParts()

is called.
When this happens while the application is not on top, the call fails with the following StackTrace
java.lang.IllegalStateException: Application does not have an active window
       at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.getActiveWindowService(ApplicationPartServiceImpl.java:36)
       at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.getDirtyParts(ApplicationPartServiceImpl.java:123)
       ...
       ...


Calling the EPartService from the DisplayThread (Display.syncExec...) does not seem to make any difference.
Shouldn't we be able to use the EPartService while the application window is not the active one?

Thanks,
Marko
Re: IllegalStateException on accessing EPartService [message #966275 is a reply to message #965892] Wed, 31 October 2012 22:17 Go to previous messageGo to next message
Eclipse UserFriend
I think this error happens when there is no active window at all in the application. At what point in the lifecycle does that happen? I doubt it is trying to be injected a bit early in the lifecycle.
Re: IllegalStateException on accessing EPartService [message #966772 is a reply to message #965892] Thu, 01 November 2012 08:07 Go to previous messageGo to next message
Marko Herchet is currently offline Marko HerchetFriend
Messages: 13
Registered: May 2012
Junior Member
Window, MainMenu, MainToolbar and two Parts are already visible at the time the exception occurs. I even used a breakpoint right before the
EPartService.getDirtyParts()

call and waited there a few seconds after the initial views became visible.
Re: IllegalStateException on accessing EPartService [message #966920 is a reply to message #966772] Thu, 01 November 2012 10:42 Go to previous message
Eclipse UserFriend
If you could make up a simple minimal project to show the problem it would help us solve it.
Previous Topic:Eclipse4 Model Concept: Model Tree of Fragments? (SOLVED)
Next Topic: No application icon on main windows
Goto Forum:
  


Current Time: Thu Apr 18 11:15:46 GMT 2024

Powered by FUDForum. Page generated in 0.02026 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top