You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "YannLeCorse (via GitHub)" <gi...@apache.org> on 2024/07/31 07:10:37 UTC
[PR] Handle ModuleInstall classes which are related to OSGi modules. [netbeans]
YannLeCorse opened a new pull request, #7624:
URL: https://github.com/apache/netbeans/pull/7624
This PR is to address the issue described in the discussion #7601.
When a Netbeans modules has a `ModuleInstall` class, we are trying to call the `validate` method by reflection.
If the `ModuleInstall` class is related to classes located in an OSGi module, we could face a `NoClassDefFoundError` while calling `c.getDeclaredMethod("validate")` because the OSGi modules have a delayed start, don't have yet been registered to the `ProxyClassPackages` and the systemClassLoader not being yet ready.
As the validate method is called early in the startup process, such relations should be avoid as much as possible but it should not block the startup.
Thus the proposal is to catch the exception and continue the startup process (maybe without having called the validate method).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Handle ModuleInstall classes which are related to OSGi modules. [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #7624:
URL: https://github.com/apache/netbeans/pull/7624#issuecomment-2259952609
As mentioned on the discussion, does using `@OnStart` instead work around your issue? I have doubts that swallowing the exception and not calling the validate method is the right approach here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Handle ModuleInstall classes which are related to OSGi modules. [netbeans]
Posted by "YannLeCorse (via GitHub)" <gi...@apache.org>.
YannLeCorse closed pull request #7624: Handle ModuleInstall classes which are related to OSGi modules.
URL: https://github.com/apache/netbeans/pull/7624
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Handle ModuleInstall classes which are related to OSGi modules. [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #7624:
URL: https://github.com/apache/netbeans/pull/7624#issuecomment-2259952448
CI appears to be stuck atm. Will try later again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Handle ModuleInstall classes which are related to OSGi modules. [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #7624:
URL: https://github.com/apache/netbeans/pull/7624#issuecomment-2260204786
To follow up on the discussion thread, I'm inclined to -1 this change. The issue is fairly easy to work around - see https://github.com/apache/netbeans/discussions/7601#discussioncomment-10199892
My main concern with this PR is with "continue the startup process (maybe without having called the validate method)." If we have any module that relies on OSGi classes and does validation, a refactor of the module install could start silently bypassing validation rather than throwing the exception (correctly IMO given the current limitations).
We should possibly find somewhere to better document this issue. Possibly catch and rethrow the `NoClassDefFoundRethrow` with explanatory text? There are limitations documented with the validation method, that also apply to class initialization time, that might be expanded on?
I would also point out the "Most modules should not need this." in the docs of ModuleInstall. There's probably a better way to achieve what's desired in the application.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists