[
https://issues.apache.org/jira/browse/FELIX-5902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16574390#comment-16574390
]
Carsten Ziegeler edited comment on FELIX-5902 at 8/9/18 7:24 AM:
-----------------------------------------------------------------
I think this need to be fixed in the Log Service. Logging should work for a
starting bundle, otherwise you have no change to log in the
BundleActivator#start method
For this particular error, this could be avoided in LogServiceImpl with
checking that the bundle parameter in getLogger is the same as m_bundle - which
should be the case, but that would just be a workaround. The real fix, as
mentioned above is to allow logging for starting and probably stopping bundles.
I understand that getBundleContext does not work in these states but such a
bundle could get the LogService in that state
was (Author: cziegeler):
I think this need to be fixed in the Log Service. Logging should work for a
starting bundle, otherwise you have no change to log in the
BundleActivator#start method
For this particular error, this could be avoided in LogServiceImpl with
checking that the bundle parameter in getLogger is the same as m_bundle - which
should be the case, but that would just be a workaround. The real fix, as
mentioned above is to allow logging for starting and probably stopping bundles
> java.lang.IllegalArgumentException: Bundle org.apache.felix.scr [81] is not
> resolved.
> -------------------------------------------------------------------------------------
>
> Key: FELIX-5902
> URL: https://issues.apache.org/jira/browse/FELIX-5902
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services (SCR), Log Service
> Affects Versions: log-1.2.0, framework-6.0.0, scr-2.1.2
> Environment: MacOS 10.14, JDK 8, bnd-maven-plugin 4.0.0
> Reporter: Rakesh Kumar
> Priority: Blocker
> Fix For: log-1.2.2
>
> Attachments: SCRandLogServiceBundleIds.png, Screenshot 2018-08-08 at
> 7.16.38 AM.png, Screenshot 2018-08-08 at 7.17.09 AM.png
>
>
> I have updated to SCR 2.1.2 with Felix LogService 1.2.0 and getting
> java.lang.IllegalArgumentException: Bundle org.apache.felix.scr [81] is not
> resolved.
> IMHO, this happens due to the
> *org.apache.felix.log.LogServiceImpl*#getLogger(Bundle bundle, String name,
> Class<L> loggerType) checking if the calling Bundle is in *active* or
> *resolved* state. ** Since the SCR bundle is in *starting* state which
> throws the above mentioned exception.
>
> Here is the stack trace.
>
> {code:java}
> java.lang.IllegalArgumentException: Bundle org.apache.felix.scr [81] is not
> resolved.
> at org.apache.felix.log.LogServiceImpl.getLogService(LogServiceImpl.java:153)
> at org.apache.felix.log.LogServiceImpl.getLogger(LogServiceImpl.java:146)
> at
> org.apache.felix.scr.impl.logger.R7LogServiceLogger.<init>(R7LogServiceLogger.java:35)
> at
> org.apache.felix.scr.impl.logger.LogServiceSupport.getLogger(LogServiceSupport.java:69)
> at
> org.apache.felix.scr.impl.logger.LogServiceEnabledLogger.getLogger(LogServiceEnabledLogger.java:106)
> at
> org.apache.felix.scr.impl.logger.AbstractLogger.isLogEnabled(AbstractLogger.java:71)
> at
> org.apache.felix.scr.impl.logger.AbstractLogger.log(AbstractLogger.java:110)
> at org.apache.felix.scr.impl.Activator.restart(Activator.java:143)
> at
> org.apache.felix.scr.impl.config.ScrConfigurationImpl.configure(ScrConfigurationImpl.java:213)
> at
> org.apache.felix.scr.impl.config.ScrConfigurationImpl.start(ScrConfigurationImpl.java:118)
> at org.apache.felix.scr.impl.Activator.start(Activator.java:100)
> at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
> at org.apache.felix.framework.Felix.activateBundle(Felix.java:2398)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:2304)
> at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1535)
> at
> org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
> at java.lang.Thread.run(Thread.java:748){code}
>
> Please look into this as I am blocked due to this.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)