Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Standalone e4 RCP application, DI doesn't work
Standalone e4 RCP application, DI doesn't work [message #1063437] Thu, 13 June 2013 07:46 Go to next message
Ozgur Cagdas is currently offline Ozgur CagdasFriend
Messages: 32
Registered: May 2013
Member
Hi,

I have an e4 RCP application which uses dependency injection and also depends on the Eclipse Framework. When I export the application as a standalone app, none of the injections happen (i.e. @PostContruct annotated methods are not called).

So, at first place, does the DI function on standalone apps? If yes, what am I missing here? Needless to say, it all works fine when compiled and launched within Eclipse.

Regarding the Eclipse Framework dependency, can I deploy a base Eclipse application together with my app, so it does satisfy dependencies through it? Actually, the Eclipse Framework dependency is at the simplest level, just using the IEclipseContext and couple of other simple structures, so no contribution to UI or use of any complex mechanisms.

Regards,

O.

[Updated on: Fri, 14 June 2013 08:34]

Report message to a moderator

Re: Standalone e4 RCP application with DI [message #1063445 is a reply to message #1063437] Thu, 13 June 2013 08:15 Go to previous messageGo to next message
Eclipse UserFriend
Well it depends what you call framework but you only need what you have as dependencies on your .product file to have the app working. But yes e4 RCP is meant for standalone apps. It's an application framework for people to build upon. Your @PC not being called might be related to how you declare your dependency on javax.annotation.
Re: Standalone e4 RCP application with DI [message #1063576 is a reply to message #1063445] Thu, 13 June 2013 12:45 Go to previous message
Ozgur Cagdas is currently offline Ozgur CagdasFriend
Messages: 32
Registered: May 2013
Member
Thanks very much.

Per your response, I decided to start with a simple e4 RCP test application and see if I could still reproduce the issue. First of all, I got this test up and running and as you said, DI just works brilliantly on the stand alone app and required Eclipse objects (i.e. IEclipseContext instance) get injected too.

I incrementally modified the test project until the point it manifested the same issue as my original app. I don't know if it makes any sense to anyone but having the 'src' folder (and all descendants) selected under the Binary Build page of the plugin.xml seems to cause this issue. Deselecting the 'src' just fixes the problem.

My problem is resolved but if anyone could shed some light on the reason behind this, that'd help others to avoid such a problem in the future.

Regards,

O.

Previous Topic:Jobs API
Next Topic:Inject problem
Goto Forum:
  


Current Time: Fri Apr 26 16:55:38 GMT 2024

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

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

Back to the top