You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "laeubi (via GitHub)" <gi...@apache.org> on 2025/02/20 15:51:42 UTC
[PR] Do not print an error when a wildcard is used in component header [felix-dev]
laeubi opened a new pull request, #383:
URL: https://github.com/apache/felix-dev/pull/383
Currently SCR prints an error if one uses a wildcard in the header but nothing matches. But because fragemnts are not allowed to provide an own header, only the host can enable this.
So this now adds an additional check before logging an error that prevents an error from being printed if a wildcard is provided.
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "stbischof (via GitHub)" <gi...@apache.org>.
stbischof commented on PR #383:
URL: https://github.com/apache/felix-dev/pull/383#issuecomment-2740622615
damn tj was faster with merge ;-)
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "andrew-tram (via GitHub)" <gi...@apache.org>.
andrew-tram commented on PR #383:
URL: https://github.com/apache/felix-dev/pull/383#issuecomment-3074181730
It looks like this was fixed as part of org.apache.felix.scr 2.2.13? When will that be able? I dont see it floating around Orbit or other repos just yet.
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "dpolivaev (via GitHub)" <gi...@apache.org>.
dpolivaev commented on PR #383:
URL: https://github.com/apache/felix-dev/pull/383#issuecomment-2740237484
Is there any movement on it?
Current state produces misleading error messages in eclipse log, and nobody cares there too because they believe it is apache felix issue.
https://github.com/eclipse-lemminx/lemminx/pull/1732
https://github.com/eclipse-lemminx/lemminx/issues/1731
This is how you loose trust.
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "laeubi (via GitHub)" <gi...@apache.org>.
laeubi commented on code in PR #383:
URL: https://github.com/apache/felix-dev/pull/383#discussion_r1965593739
##########
scr/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java:
##########
@@ -270,6 +270,21 @@ protected void initialize(List<ComponentMetadata> cachedComponentMetadata)
URL[] descriptorURLs = findDescriptors(m_bundle, descriptorLocation);
if (descriptorURLs.length == 0)
{
+ if (descriptorLocation.contains("*")) {
+ // 112.4.1 The last component of each path in the Service-Component header may
+ // use wildcards so that Bundle.findEntries can be used to locate the XML
+ // document within the bundle and its fragments. For example:
+ //
+ // Service-Component: OSGI-INF/*.xml
+ //
+ // A Service-Component manifest header specified in a fragment is ignored by
+ // SCR. However, XML documents referenced by a bundle's Service-Component
+ // manifest header may be contained in attached fragments.
+
+ // in case of such wildcard, finding nothing does not mean an error (because it
+ // *might* be found in a fragment that is attached later.
+ continue;
Review Comment:
Done!
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "tjwatson (via GitHub)" <gi...@apache.org>.
tjwatson merged PR #383:
URL: https://github.com/apache/felix-dev/pull/383
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "laeubi (via GitHub)" <gi...@apache.org>.
laeubi commented on PR #383:
URL: https://github.com/apache/felix-dev/pull/383#issuecomment-2740254990
> This is how you loose trust.
Trust in what? This is all open source so "nobody" is just "everybody" ...
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "stbischof (via GitHub)" <gi...@apache.org>.
stbischof commented on PR #383:
URL: https://github.com/apache/felix-dev/pull/383#issuecomment-2677585063
What i the benefit?
We log an error before. Now we also trace the same information additional.
Isnt that just Duplikat?
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "laeubi (via GitHub)" <gi...@apache.org>.
laeubi commented on PR #383:
URL: https://github.com/apache/felix-dev/pull/383#issuecomment-2677558472
@tjwatson @stbischof can this be merged?
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "laeubi (via GitHub)" <gi...@apache.org>.
laeubi commented on PR #383:
URL: https://github.com/apache/felix-dev/pull/383#issuecomment-2677595159
Please notice this line in the PR:
https://github.com/apache/felix-dev/pull/383/files#diff-1cdeca2eb3dfd6054d5c998e7acdafef598a9a30bab68ebc4912aac55d8f74ffR289
so before it always printed an error, now it only prints error if not a wildcard (but a trace message instead).
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "tjwatson (via GitHub)" <gi...@apache.org>.
tjwatson commented on PR #383:
URL: https://github.com/apache/felix-dev/pull/383#issuecomment-2741116970
> damn tj was faster with merge ;-)
Now someone has to sign up to do a release; otherwise we loose all trust ;-)
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "tjwatson (via GitHub)" <gi...@apache.org>.
tjwatson commented on PR #383:
URL: https://github.com/apache/felix-dev/pull/383#issuecomment-2678520926
> Isnt that just Duplikat?
Now that @stbischof made the comment. I think the code could be more clear with the use of `if(*){log.trace}else{log.error}` instead of an extra `continue`.
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Do not print an error when a wildcard is used in component header [felix-dev]
Posted by "tjwatson (via GitHub)" <gi...@apache.org>.
tjwatson commented on code in PR #383:
URL: https://github.com/apache/felix-dev/pull/383#discussion_r1965555288
##########
scr/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java:
##########
@@ -270,6 +270,21 @@ protected void initialize(List<ComponentMetadata> cachedComponentMetadata)
URL[] descriptorURLs = findDescriptors(m_bundle, descriptorLocation);
if (descriptorURLs.length == 0)
{
+ if (descriptorLocation.contains("*")) {
+ // 112.4.1 The last component of each path in the Service-Component header may
+ // use wildcards so that Bundle.findEntries can be used to locate the XML
+ // document within the bundle and its fragments. For example:
+ //
+ // Service-Component: OSGI-INF/*.xml
+ //
+ // A Service-Component manifest header specified in a fragment is ignored by
+ // SCR. However, XML documents referenced by a bundle's Service-Component
+ // manifest header may be contained in attached fragments.
+
+ // in case of such wildcard, finding nothing does not mean an error (because it
+ // *might* be found in a fragment that is attached later.
+ continue;
Review Comment:
Perhaps we should log as TRACE here? By default that should get ignored since the default log level is WARN.
--
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: dev-unsubscribe@felix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org