[
https://issues.apache.org/jira/browse/KARAF-7129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338778#comment-17338778
]
ASF subversion and git services commented on KARAF-7129:
--------------------------------------------------------
Commit 8c2d5f928b3ddd3b9786e9a6b0b37a38dddaf974 in karaf's branch
refs/heads/main from jbonofre
[ https://gitbox.apache.org/repos/asf?p=karaf.git;h=8c2d5f9 ]
[KARAF-7129] Add RequireService(ConfigurationAdmin.class) on SSH Activator to
track configadmin service
> Fix race condition in org.apache.karaf.shell.ssh.Activator
> ----------------------------------------------------------
>
> Key: KARAF-7129
> URL: https://issues.apache.org/jira/browse/KARAF-7129
> Project: Karaf
> Issue Type: Bug
> Components: karaf
> Affects Versions: 4.2.11
> Reporter: Steven Huypens
> Assignee: Jean-Baptiste Onofré
> Priority: Major
>
> When starting our custom Karaf distribution, we're always seeing this
> stacktrace in the logs. Everything seems to be working, I'm not sure how to
> explain that, but still seems a little bug to me.
>
> {code:java}
> 2021-04-30 12:13:56,385 -
> [o.a.k.f.i.s.FeaturesServiceImpl][features-3-thread-1] INFO -
> org.apache.sshd.sftp/2.5.1 2021-04-30 12:13:56,385 -
> [o.a.k.f.i.s.FeaturesServiceImpl][features-3-thread-1] INFO -
> org.apache.sshd.sftp/2.5.1 2021-04-30 12:13:56,387 -
> [o.a.k.f.i.s.FeaturesServiceImpl][features-3-thread-1] INFO -
> org.apache.karaf.shell.ssh/4.2.11 2021-04-30 12:13:56,399 -
> [o.a.k.s.s.Activator ][activator-1-thread-1] WARN - Error starting activator
> java.lang.IllegalStateException: Service not tracked for class interface
> org.osgi.service.cm.ConfigurationAdmin at
> org.apache.karaf.util.tracker.BaseActivator.getTrackedService(BaseActivator.java:369)
> at
> org.apache.karaf.util.tracker.BaseActivator.ensureStartupConfiguration(BaseActivator.java:154)
> at org.apache.karaf.shell.ssh.Activator.doStart(Activator.java:96) at
> org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:312) at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at
> java.util.concurrent.FutureTask.run(FutureTask.java:266) at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)2021-04-30 12:13:56,426 -
> [o.a.k.s.i.a.o.CommandExtension][features-3-thread-1] INFO - Command
> registration delayed for bundle org.apache.karaf.shell.ssh/4.2.11. Missing
> service: [org.apache.sshd.server.SshServer] {code}
>
> I had a look at the org.apache.karaf.shell.ssh.Activator and I feel like it's
> missing a
> @RequireService(ConfigurationAdmin.class) because that service is required by
> the method
> ensureStartupConfiguration() and the only other Activator using that method
> does have the @RequireService(ConfigurationAdmin.class) .
>
> Also, it might be better to add a null-check for this service in the
> doStart()-method
>
> {code:java}
> ConfigurationAdmin configurationAdmin =
> getTrackedService(ConfigurationAdmin.class);
> if (configurationAdmin == null ) {
> return;
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)