0

I have an eclipse RCP application based on the 3.x API. My application consists of several perspectives where each contains several views and editors. The first perspective starts on the start up of the application and the navigation view is defined in the main plug-in. The problem is with the other perspectives where the views are defined in different plug-ins for a better code maintenance. I add my views within the main plug-in with a perspective extension and the following piece of code:

public class Perspective implements IPerspectiveFactory {
  public void createInitialLayout(IPageLayout layout) {
  layout.addView(NavigationView.ID, IPageLayout.TOP,
      IPageLayout.RATIO_MAX, IPageLayout.ID_EDITOR_AREA);
  }
}

The strange thing is that it all works perfectly when I run the application within eclipse, but as soon as I make a build with Maven/Tycho and execute the created application all the perspectives defined in the plug-ins don't work anymore. The issue is when I add a new perspective this perspective opens but it doesn't contain any views, just a grey background. I already added a few println() statements for debugging purposes and it seems as the Activator of my respective plug-in, which contains the view, is never invoked. That would also explain why I cannot see any views in my perspective because the application cannot find the respective view defined in the view extension of the respective plug-in. I added the following println() statement to my createInitialLayout method from above:

System.err.println(layout.getViewLayout(NavigationView.ID));

The output was null, which strengthen my previous point.

The problem is now what could be the reason for that? Why doesn't my plug-in start? I also already did another experiment where I directly called one of the methods defined in the plug-in and again the Activator of the plug-in wasn't called. The Bundle-ActivationPolicy of the plug-in is set to lazy. Any suggestion what my next steps could be to track the problem down?

Maven/Tycho doesn't report any problems and I use the same target platform for both, eclipse and Maven/Tycho, so I can also exclude any dependency problems.

I really would appreciate any help/support :)

Best regards, Tom

flavio.donze
  • 7,432
  • 9
  • 58
  • 91
tzwickl
  • 1,341
  • 2
  • 15
  • 31
  • Have you tried to use standard eclipse product export functionality? – Alex K. Jun 28 '14 at 18:32
  • @AlexanderGavrilov I just tried it out and there is indeed a problem with the dependencies ... But I cannot figure out how I can resolve this dependency error ... I already checked the target platform, but for me it seems that all required bundles are there. – tzwickl Jul 01 '14 at 11:19
  • 1
    How is your product configuration organized? Based on plugins or features? Are you sure you have included everything in there? Are there any errors in you workspace .metadata/.log file? Have you added a plugin.xml to the build.properties, something like this: `bin.includes = META-INF/,\ .,\ plugin.xml,\ src/main/resources` – Alex K. Jul 01 '14 at 11:28
  • @AlexanderGavrilov My product is based on features and no there aren't any errors in my workspace ... The strange thing is I can execute the product within eclipse and it works as expected ... When I validate my plug-ins under the run configuration it shows that there were no problems detected ... The content of my build.properties looks like this: bin.includes = META-INF/,\ plugin_customization.ini – tzwickl Jul 01 '14 at 11:35
  • 1
    Try adding plugin.xml to the build.properties and see if it helps. – Alex K. Jul 01 '14 at 12:13
  • Thank you so much :) This was exactly the problem :) Now it works ;) – tzwickl Jul 01 '14 at 13:50

0 Answers0