Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Tuesday, July 12, 2011

!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

This might happen when:
  • sometimes the computer is put for hibernate many times when the eclipse is still working or
  • resources gets called too early before the instance of workspace can be created, or
  • Eclipse did not shutdown correctly.

And eclipse might crash (freeze on splash) with messages like (check workspace\.metadata\.log)

!ENTRY org.eclipse.core.resources 2 10035 2011-07-12 00:32:14.925
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

It might need to starting everything with a new workspace and then set up all the projects again properly (takes hours to do). Some solutions that can be worth trying :
  1.  remove folder workspace\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes
    and restart Eclipse (Referenced here) . Good to rename rather than delete because some also metioned that there was some other problem after that.
  2.  Go to:
    \.metadata\.plugins\org.eclipse.core.resources and remove the file .snap

    Or remove file : .metadata\.plugins\org.eclipse.core.resources\.projects\<project>\.markers.snap . This is a large snapshot file which Eclipse constantly polls for some projects. (Referenced from here )
  3. The third solution (which worked for me) is  when workbench is restarted/quit, then its need to save the workspace, before existing the workbench then the above message comes.
    Overload the preWindowShellClose() method in your of WorkbenchWindowAdvisor. You can save the workspace by using ResourcesPlugin.getWorkspace().save(...) method. (Sited here)
    import org.eclipse.core.resources.ResourcesPlugin;
    import org.eclipse.core.runtime.CoreException;
    import org.eclipse.ui.application.WorkbenchWindowAdvisor;

    public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {

       // other methods...

       @Override
       public boolean preWindowShellClose() {
          try {
             // save the full workspace before quit
             ResourcesPlugin.getWorkspace().save(true, null);
          } catch (final CoreException e) {
             // log exception, if required
          }

          return true;
       }

    }

Thursday, September 23, 2010

Another day of "sigh"

This error/exception belongs to wrong Run Configurations in the project.:



osgi> !SESSION 2010-09-23 17:05:21.083 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product etdeltatm.rcp.ui.product
Command-line arguments: -product etdeltatm.rcp.ui.product -data C:\Documents and Settings\bkhanal\workspace/../runtime-etdeltatm.rcp.ui.product -dev file:C:/Documents and Settings/bkhanal/workspace/.metadata/.plugins/org.eclipse.pde.core/etdeltatm.rcp.ui.product/dev.properties -os win32 -ws win32 -arch x86 -consoleLog -console

!ENTRY org.eclipse.equinox.app 0 0 2010-09-23 17:05:22.614
!MESSAGE Product etdeltatm.rcp.ui.product could not be found.


!ENTRY org.eclipse.osgi 4 0 2010-09-23 17:05:22.661
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: No application id has been found.
at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:236)

My setting was set with an product mode (Program to run:) , and it thus could not start. Changing the Program to run as Run as application and setting the "plugin" tabs to the default mode solved and saved the rest of day. I thought this was worth mentioning, as it was taking almost 3-4 hours of my time and googling the problems, even though there was no problem - just a mis configurations, sighhhh indeed.

Wednesday, September 22, 2010

RCP Resources: continued...

Here I will try to keep some helpful resources for the RCP development:

  • http://obscuredclarity.blogspot.com/2008/11/eclipse-rcp-tutorial-table-of-contents.html
  • http://callocorg.wordpress.com/2010/07/12/adding-eclipse-rcp-views-declaratively-into-ifolderlayout/
  • http://wiki.eclipse.org/index.php/Rich_Client_Platform
  • http://www.eclipse.org/articles/viewArticle/ViewArticle2.html
  • http://weblogs.java.net/blog/scottschram/archive/2005/03/nasa_explores_e.html
  • http://www.eclipse.org/eclipse/platform-text/development/rcp/examples/index.html
  • http://wiki.eclipse.org/Eclipse_RCP_How-to
  • http://wiki.eclipse.org/RCP_Custom_Look_and_Feel
  • http://www.eclipse.org/articles/Article-Forms/article.html
  • http://www.eclipse.org/articles/Article-Forms/article.html
  • http://help.eclipse.org/helios/index.jsp
  • http://sourceforge.net/projects/metaleclipse/
  • http://eclipse.org/community/rcp.php
  • http://www.eclipsezone.com/eclipse/forums/t53312.html
  • http://www.eclipse.org/swt/snippets/ - nice and simple examples of the tools we need.