Eclipse plugin startup extension does not work with 4.5 M5

Questions about YourKit Java Profiler
Post Reply
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

Eclipse plugin startup extension does not work with 4.5 M5

Post by Andrei.L »

Early startup of yourkit plugin 2015 EAP build 15028 doesn't work with the 4.5 M5: error is logged:

The org.eclipse.ui.IStartup extension from 'com.yourkit.profiler' does not provide a valid 'startup' element.

4.5 M5 made startup extension validation stricter, so please adopt.
Regards,
Andrey
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Eclipse plugin startup extension does not work with 4.5

Post by Anton Katilin »

Hi Andrey

We've tried to reproduce the problem with 4.5 M5.
It prints this message in the log for us too, but not as an error, it's just a plain message, and the plugin works.

What is the exact Eclipse version you're using?

Best regards,
Anton
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

Re: Eclipse plugin startup extension does not work with 4.5

Post by Andrei.L »

Sorry for late reply.
I was using 4.5 M5a and just now updated to the latest i-build from http://download.eclipse.org/eclipse/dow ... 0224-0800/

The exact error is "The org.eclipse.ui.IStartup extension from 'com.yourkit.profiler' does not provide a valid 'startup' element."

The startup extension point since 4.5 M5 can not be empty, it *must* contain startup class and the plugin activator can NOT be IStartup anymore. Both mistakes are still on latest snapshot from yourkit (com.yourkit.profiler_2015.0.15032.0.jar).

An example of *valid* contribution is:

<extension
point="org.eclipse.ui.startup">
<startup
class="de.loskutov.anyedit.actions.internal.AnyeditStartup">
</startup>
</extension>

Because of this, communication between yourkit and Eclipse is broken and one can't jump from the stack trace to the IDE.
Please fix this, the fix is trivial.
Regards,
Andrey
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Eclipse plugin startup extension does not work with 4.5

Post by Anton Katilin »

Hello Andrey
The startup extension point since 4.5 M5 can not be empty, it *must* contain startup class and the plugin activator can NOT be IStartup anymore. Both mistakes are still on latest snapshot from yourkit (com.yourkit.profiler_2015.0.15032.0.jar).
Could you please share a reference to the documentation or change notes etc. which describe this new requirement. According to the existing documentation to the current Eclipse version, the approach we use is also OK.
An example of *valid* contribution is:

<extension
point="org.eclipse.ui.startup">
<startup
class="de.loskutov.anyedit.actions.internal.AnyeditStartup">
</startup>
</extension>
We've tried this variant too, but unfortunately it seems to cause errors in older, pre-4.5 Eclipse versions. We'll double check again.

Best regards,
Anton
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

Re: Eclipse plugin startup extension does not work with 4.5

Post by Andrei.L »

Background: I've hit the same problem Yourkit have now with ma AnyEdit plugin, see http://code.google.com/a/eclipselabs.or ... ail?id=104

The root cause was the removal of legacy compatibility support, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=445484, bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=455165 opened by me, and https://git.eclipse.org/r/#/c/36310.

The specification did not add anything new, it was just made *more strict*: the startup contribution MUST have now "startup" element and this element MUST have "class" attribute, and the "class" cannot be the activator class itself!

Just check the change I've made for AnyEdit (commit: http://code.google.com/a/eclipselabs.or ... 9f8ebee87f) - it works for ALL supported Eclipse versions from 3.6 to 4.5 and it should also work for YourKit in the same way. Make sure the new class implementing IStartup implementation is not obfuscated, public, has no -args public constructor and it should just work.

Regards,
Andrey
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Eclipse plugin startup extension does not work with 4.5

Post by Anton Katilin »

Hi Andrey

Thank you very much for the tips. The next EAP build 15034 will contain the requested fix.

Best regards,
Anton
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Eclipse plugin startup extension does not work with 4.5

Post by Anton Katilin »

Build 15034 is available for download.

Could you please confirm the new plugin is OK.
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

Re: Eclipse plugin startup extension does not work with 4.5

Post by Andrei.L »

Anton Katilin wrote:Build 15034 is available for download.

Could you please confirm the new plugin is OK.
New plugin doesn't show error on startup anymore and the opening the code from profile in the IDE works too.
Tested with the build 4.5.0.I20150224-0800
Thanks.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Eclipse plugin startup extension does not work with 4.5

Post by Anton Katilin »

Hi Andrey

Thank you for your help.

Best regards,
Anton
Post Reply