Bonjour 服务在 Equinox 中使用 JmDNS 发布,但在 Apache Felix 中不使用 JmDNS 发布

发布于 2024-11-27 21:58:07 字数 24187 浏览 1 评论 0原文

我面临一个奇怪的问题。我已经为 JmDNS 3.1.6 创建了一个 OSGi 捆绑包,并已成功在 Equinox 中使用它来发布服务近两年了。我最近迁移到 Apache Felix。不幸的是,同一个 JmDNS 包尽管安装没有问题,但似乎不再导出任何服务。这是我用来发布服务的代码

private void publishBonjourService() {
    try {

        if (this.jmdns != null) {
            logger.config("deregistering existing service, first");
            jmdns.unregisterService(this.serviceInfo);  
        } else {
            logger.config("publishing service: \"" 
                    + bonjourServiceName + "\"");
            jmdns = JmDNS.create(InetAddress.getLocalHost(), 
                    bonjourServiceName);                
        }

        HashMap<String, Object> props = new HashMap<String, Object>();
        props.put("path", "index.html");

        this.serviceInfo = ServiceInfo.create(
                "_http._tcp.local.", 
                bonjourServiceName, 
                HttpService.WEB_SERVICE_PORT, 
                0, 
                0, 
                props);         
        jmdns.registerService(this.serviceInfo);
        logger.config("service " + bonjourServiceName 
                + " published via JmDNS");
    } catch (Exception e) {
        logger.warning("Caught exception when trying to register "
                + "Bonjour service! (" + e.getMessage() + ")");
    }
}

在我的 Mac 上使用 Bonjour 浏览器我可以看到没有发布任何服务,即使上面的代码执行时没有任何异常。以下是 Felix 对我安装的捆绑包的评价。

   ID|State      |Level|Name
    0|Active     |    0|System Bundle (3.2.2)
    1|Active     |    4|JmDNSTest (0.0.1)
    9|Active     |    2|Noelios Restlet Engine (1.1.0)
   10|Active     |    2|JSON (2.0.0)
   11|Active     |    2|Restlet API (1.1.0)
   12|Active     |    2|Restlet Extension - JSON (1.1.0)
   13|Active     |    2|org.rxtx (2.2.0)
   14|Active     |    2|JmDNS (3.2.2)
   15|Active     |    1|Apache Felix Bundle Repository (1.6.2)
   16|Active     |    1|Apache Felix Configuration Admin Service (1.2.8)
   17|Active     |    1|Apache Felix EventAdmin (1.2.12)
   18|Active     |    1|Apache Felix Declarative Services (1.6.0)
   19|Active     |    1|Apache Felix Gogo Command (0.8.0)
   20|Active     |    1|Apache Felix Gogo Runtime (0.8.0)
   21|Active     |    1|Apache Felix Gogo Shell (0.8.0)

我已经搜索了有关如何在 OSGi 中使用 JmDNS 的教程,但在网上没有找到任何内容。如果有人能给我提示可能是什么问题或为我指明有用资源的方向,我将不胜感激。

预先感谢您的帮助和欢呼, Georg

编辑:我现在已迁移到 Maven 存储库中找到的 JmDNS 3.2.2,并在 Felix 中使用它。我不再直接使用 javax.jmdns.impl 中的类,如我上一篇文章中所示(我已经更新了上面的源代码列表)。然而,仍然没有运气。 JmDNS 似乎以某种方式工作。我已将 JmDNS 的日志记录级别设置为最佳 - 这是我得到的内容的摘录。

        04.08.2011 09:14:29 javax.jmdns.impl.JmDNSImpl <init>
    FEINER: JmDNS instance created
    04.08.2011 09:14:29 javax.jmdns.impl.JmDNSImpl registerServiceType
    FEIN: fusion.http.registering service type: _http._tcp.local. as: _http._tcp.local.
    04.08.2011 09:14:30 javax.jmdns.impl.tasks.state.DNSStateTask run
    FEINER: Prober(fusion.http).run() JmDNS probing fusion.http
    04.08.2011 09:14:30 javax.jmdns.impl.tasks.state.DNSStateTask run
    FEINER: Prober(fusion.http).run() JmDNS probing #probing 1
    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl send
    AM FEINSTEN: send(fusion.http) JmDNS out:dns[query,224.0.0.251:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@685450225 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1259649067 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3599/3600' address: '192.168.178.75']]
        question:      [AllRecords@685450225 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
        authoritative: [IPv4Address@1259649067 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3599/3600' address: '192.168.178.75']
       0: 0000000000010000 000100000873692d 7a6d616338056c6f 63616c0000ff0001     ........ .....si- zmac8.lo cal.....
      20: c00c000100010000 0e100004c0a8b24b                                       ........ .......K

    04.08.2011 09:14:30 javax.jmdns.impl.SocketListener run
    AM FEINSTEN: SocketListener(fusion.http).run() JmDNS in:dns[query,192.168.178.75:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@264587158 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1147629119 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']]
        question:      [AllRecords@264587158 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
        authoritative: [IPv4Address@1147629119 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']
       0: 0000000000010000 000100000873692d 7a6d616338056c6f 63616c0000ff0001     ........ .....si- zmac8.lo cal.....
      20: c00c000100010000 0e100004c0a8b24b                                       ........ .......K

    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleQuery
    FEIN: fusion.http.handle query: dns[query,192.168.178.75:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@264587158 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1147629119 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']]
    04.08.2011 09:14:30 javax.jmdns.impl.tasks.Responder start
    AM FEINSTEN: Responder(fusion.http)start() question=[AllRecords@264587158 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    04.08.2011 09:14:30 javax.jmdns.impl.tasks.Responder start
    AM FEINSTEN: Responder(fusion.http)start() Responder chosen delay=0
    04.08.2011 09:14:30 javax.jmdns.impl.DNSIncoming readAnswer
    FEINER: DNSIncoming() unknown type:TYPE_NSEC index 47
    04.08.2011 09:14:30 javax.jmdns.impl.SocketListener run
    AM FEINSTEN: SocketListener(fusion.http).run() JmDNS in:dns[response,192.168.178.75:5353, length=90, id=0x0, flags=0x8400:r:aa, answers=2
    answers:
        [IPv6Address@1779280140 type: TYPE_AAAA index 28, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '120/120' address: 'fe80:0:0:0:e6ce:8fff:fe26:9ec6%0']
        [IPv4Address@651528505 type: TYPE_A index 1, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '120/120' address: '192.168.178.75']]
        answer:        [IPv6Address@1779280140 type: TYPE_AAAA index 28, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '120/120' address: 'fe80:0:0:0:e6ce:8fff:fe26:9ec6%0']
        answer:        [IPv4Address@651528505 type: TYPE_A index 1, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '120/120' address: '192.168.178.75']
       0: 0000840000000002 000000010853492d 5a4d414338056c6f 63616c00001c8001     ........ .....SI- ZMAC8.lo cal.....
      20: 000000780010fe80 000000000000e6ce 8ffffe269ec6c00c 0001800100000078     ...x.... ........ ...&.... .......x
      40: 0004c0a8b24bc00c 002f800100000078 0008c00c00044000 0008                 .....K.. ./.....x ......@. ..

    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleRecord
    FEIN: fusion.http handle response: [IPv6Address@1779280140 type: TYPE_AAAA index 28, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '119/120' address: 'fe80:0:0:0:e6ce:8fff:fe26:9ec6%0']
    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleRecord
    FEIN: fusion.http handle response cached record: null
    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleRecord
    FEIN: fusion.http handle response: [IPv4Address@651528505 type: TYPE_A index 1, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '119/120' address: '192.168.178.75']
    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleRecord
    FEIN: fusion.http handle response cached record: null
    04.08.2011 09:14:31 javax.jmdns.impl.tasks.state.DNSStateTask run
    FEINER: Prober(fusion.http).run() JmDNS probing fusion.http
    04.08.2011 09:14:31 javax.jmdns.impl.tasks.state.DNSStateTask run
    FEINER: Prober(fusion.http).run() JmDNS probing #probing 2
    04.08.2011 09:14:31 javax.jmdns.impl.JmDNSImpl send
    AM FEINSTEN: send(fusion.http) JmDNS out:dns[query,224.0.0.251:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@1653858092 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1512109123 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']]
        question:      [AllRecords@1653858092 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
        authoritative: [IPv4Address@1512109123 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']
       0: 0000000000010000 000100000873692d 7a6d616338056c6f 63616c0000ff0001     ........ .....si- zmac8.lo cal.....
      20: c00c000100010000 0e100004c0a8b24b                                       ........ .......K

    04.08.2011 09:14:31 javax.jmdns.impl.SocketListener run
    AM FEINSTEN: SocketListener(fusion.http).run() JmDNS in:dns[query,192.168.178.75:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@696551663 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1010440244 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']]
        question:      [AllRecords@696551663 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
        authoritative: [IPv4Address@1010440244 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']
       0: 0000000000010000 000100000873692d 7a6d616338056c6f 63616c0000ff0001     ........ .....si- zmac8.lo cal.....
      20: c00c000100010000 0e100004c0a8b24b                                       ........ .......K

编辑:这是我的 Felix 实例的 jstack 输出的摘录(我已排除所有列为可运行或定时等待的线程):

Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.1-b02-383 mixed mode):

"Thread-40" daemon prio=5 tid=7fa7be0ac800 nid=0x10ad9a000 in Object.wait() [10ad99000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at EDU.oswego.cs.dl.util.concurrent.CyclicBarrier.doBarrier(Unknown Source)
    - locked <7f36e5728> (a org.apache.felix.eventadmin.impl.tasks.Rendezvous)
    at EDU.oswego.cs.dl.util.concurrent.CyclicBarrier.barrier(Unknown Source)
    at org.apache.felix.eventadmin.impl.tasks.Rendezvous.waitForRendezvous(Rendezvous.java:55)
    at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:272)
    at org.apache.felix.eventadmin.impl.EventAdminImpl.handleEvent(EventAdminImpl.java:165)
    at org.apache.felix.eventadmin.impl.EventAdminImpl.sendEvent(EventAdminImpl.java:108)
    at org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator.sendEvent(EventAdminSecurityDecorator.java:94)
    at com.xxx.yyy.commons.OSGiEventHub.sendEvent(OSGiEventHub.java:200)
    at com.xxx.yyy.can.connections.impl.CANConnectionLog.receiveCANMessages(CANConnectionLog.java:288)
    at com.xxx.yyy.can.connections.impl.CANConnectionMessageAgent.run(CANConnectionMessageAgent.java:70)
    - locked <7f45fe3c8> (a com.bosch.fusion.can.connections.impl.CANConnectionMessageAgent)

"Thread-35" daemon prio=5 tid=7fa7bfa67000 nid=0x10a88b000 waiting on condition [10a88a000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-34" daemon prio=5 tid=7fa7be012800 nid=0x10a788000 waiting on condition [10a787000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-33" daemon prio=5 tid=7fa7c00dd800 nid=0x10a685000 waiting on condition [10a684000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-32" daemon prio=5 tid=7fa7c3001800 nid=0x10a582000 waiting on condition [10a581000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-31" daemon prio=5 tid=7fa7c1801800 nid=0x10a47f000 waiting on condition [10a47e000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-30" daemon prio=5 tid=7fa7c3001000 nid=0x10a37c000 waiting on condition [10a37b000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-29" daemon prio=5 tid=7fa7be016800 nid=0x10bcc7000 waiting on condition [10bcc6000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-28" daemon prio=5 tid=7fa7bc82b000 nid=0x10bbc4000 waiting on condition [10bbc3000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-27" daemon prio=5 tid=7fa7bfa2f000 nid=0x10bac1000 waiting on condition [10bac0000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-26" daemon prio=5 tid=7fa7be016000 nid=0x108ff2000 waiting on condition [108ff1000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)


"SCR Component Actor" daemon prio=5 tid=7fa7bc87f800 nid=0x109fa2000 in Object.wait() [109fa1000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f46fb9f0> (a java.util.LinkedList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.scr.impl.ComponentActorThread.run(ComponentActorThread.java:76)
    - locked <7f46fb9f0> (a java.util.LinkedList)
    at java.lang.Thread.run(Thread.java:680)

"CM Event Dispatcher" daemon prio=5 tid=7fa7c0116800 nid=0x109e9e000 in Object.wait() [109e9d000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e1090> (a java.util.LinkedList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:76)
    - locked <7f44e1090> (a java.util.LinkedList)
    at java.lang.Thread.run(Thread.java:680)

"CM Configuration Updater" daemon prio=5 tid=7fa7c0116000 nid=0x109d9b000 in Object.wait() [109d9a000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e53a0> (a java.util.LinkedList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:76)
    - locked <7f44e53a0> (a java.util.LinkedList)
    at java.lang.Thread.run(Thread.java:680)

"FelixPackageAdmin" daemon prio=5 tid=7fa7bc876000 nid=0x109b07000 in Object.wait() [109b06000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e5c20> (a org.apache.felix.framework.PackageAdminImpl)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.framework.PackageAdminImpl.run(PackageAdminImpl.java:350)
    - locked <7f44e5c20> (a org.apache.felix.framework.PackageAdminImpl)
    at java.lang.Thread.run(Thread.java:680)

"FelixStartLevel" daemon prio=5 tid=7fa7bc873000 nid=0x109a04000 in Object.wait() [109a03000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e22d8> (a java.util.ArrayList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:244)
    - locked <7f44e22d8> (a java.util.ArrayList)
    at java.lang.Thread.run(Thread.java:680)

"FelixDispatchQueue" prio=5 tid=7fa7bfa27000 nid=0x1098e5000 in Object.wait() [1098e4000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e6538> (a java.util.ArrayList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:924)
    - locked <7f44e6538> (a java.util.ArrayList)
    at org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:54)
    at org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:106)
    at java.lang.Thread.run(Thread.java:680)

"Finalizer" daemon prio=8 tid=7fa7c0000000 nid=0x108e34000 in Object.wait() [108e33000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e6520> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
    - locked <7f44e6520> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=7fa7bf93e000 nid=0x108d31000 in Object.wait() [108d30000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
    - locked <7f44e10a8> (a java.lang.ref.Reference$Lock)

"main" prio=5 tid=7fa7bf800800 nid=0x100fb6000 in Object.wait() [100fb5000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f45a6180> (a org.apache.felix.framework.util.ThreadGate)
    at org.apache.felix.framework.util.ThreadGate.await(ThreadGate.java:79)
    - locked <7f45a6180> (a org.apache.felix.framework.util.ThreadGate)
    at org.apache.felix.framework.Felix.waitForStop(Felix.java:922)
    at org.apache.felix.main.Main.main(Main.java:295)

"VM Thread" prio=9 tid=7fa7bf939800 nid=0x108c2e000 runnable 

I'm facing a strange problem. I have created an OSGi bundle for JmDNS 3.1.6 and have successfully used that in Equinox to publish a service for almost two years now. I have recently migrated to Apache Felix. Unfortunately, the same JmDNS bundle, even though it installed without a problem, doesn't seem to export any services anymore. Here's the code I use to publish the service

private void publishBonjourService() {
    try {

        if (this.jmdns != null) {
            logger.config("deregistering existing service, first");
            jmdns.unregisterService(this.serviceInfo);  
        } else {
            logger.config("publishing service: \"" 
                    + bonjourServiceName + "\"");
            jmdns = JmDNS.create(InetAddress.getLocalHost(), 
                    bonjourServiceName);                
        }

        HashMap<String, Object> props = new HashMap<String, Object>();
        props.put("path", "index.html");

        this.serviceInfo = ServiceInfo.create(
                "_http._tcp.local.", 
                bonjourServiceName, 
                HttpService.WEB_SERVICE_PORT, 
                0, 
                0, 
                props);         
        jmdns.registerService(this.serviceInfo);
        logger.config("service " + bonjourServiceName 
                + " published via JmDNS");
    } catch (Exception e) {
        logger.warning("Caught exception when trying to register "
                + "Bonjour service! (" + e.getMessage() + ")");
    }
}

Using Bonjour Browser on my Mac I can see that no service is published, even though the code above executes without any exception. Here's what Felix has to say about my installed bundles.

   ID|State      |Level|Name
    0|Active     |    0|System Bundle (3.2.2)
    1|Active     |    4|JmDNSTest (0.0.1)
    9|Active     |    2|Noelios Restlet Engine (1.1.0)
   10|Active     |    2|JSON (2.0.0)
   11|Active     |    2|Restlet API (1.1.0)
   12|Active     |    2|Restlet Extension - JSON (1.1.0)
   13|Active     |    2|org.rxtx (2.2.0)
   14|Active     |    2|JmDNS (3.2.2)
   15|Active     |    1|Apache Felix Bundle Repository (1.6.2)
   16|Active     |    1|Apache Felix Configuration Admin Service (1.2.8)
   17|Active     |    1|Apache Felix EventAdmin (1.2.12)
   18|Active     |    1|Apache Felix Declarative Services (1.6.0)
   19|Active     |    1|Apache Felix Gogo Command (0.8.0)
   20|Active     |    1|Apache Felix Gogo Runtime (0.8.0)
   21|Active     |    1|Apache Felix Gogo Shell (0.8.0)

I've searched for a tutorial about how to use JmDNS within OSGi in general and haven't found anything on the net. I'd appreciate it if anyone could give me a hint as to what the problem might be or point me in the direction of a helpful resource.

Thanks in advance for your help and cheers,
Georg

Edit: I've now migrated to JmDNS 3.2.2 found in the maven repository and use that in Felix. I'm no longer using the classes in javax.jmdns.impl directly as shown in my previous post (i've updated the source code listing above). However, still no luck. JmDNS seems to work somehow. I've set the logging level for JmDNS to finest - here's an excerpt from what I get.

        04.08.2011 09:14:29 javax.jmdns.impl.JmDNSImpl <init>
    FEINER: JmDNS instance created
    04.08.2011 09:14:29 javax.jmdns.impl.JmDNSImpl registerServiceType
    FEIN: fusion.http.registering service type: _http._tcp.local. as: _http._tcp.local.
    04.08.2011 09:14:30 javax.jmdns.impl.tasks.state.DNSStateTask run
    FEINER: Prober(fusion.http).run() JmDNS probing fusion.http
    04.08.2011 09:14:30 javax.jmdns.impl.tasks.state.DNSStateTask run
    FEINER: Prober(fusion.http).run() JmDNS probing #probing 1
    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl send
    AM FEINSTEN: send(fusion.http) JmDNS out:dns[query,224.0.0.251:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@685450225 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1259649067 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3599/3600' address: '192.168.178.75']]
        question:      [AllRecords@685450225 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
        authoritative: [IPv4Address@1259649067 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3599/3600' address: '192.168.178.75']
       0: 0000000000010000 000100000873692d 7a6d616338056c6f 63616c0000ff0001     ........ .....si- zmac8.lo cal.....
      20: c00c000100010000 0e100004c0a8b24b                                       ........ .......K

    04.08.2011 09:14:30 javax.jmdns.impl.SocketListener run
    AM FEINSTEN: SocketListener(fusion.http).run() JmDNS in:dns[query,192.168.178.75:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@264587158 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1147629119 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']]
        question:      [AllRecords@264587158 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
        authoritative: [IPv4Address@1147629119 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']
       0: 0000000000010000 000100000873692d 7a6d616338056c6f 63616c0000ff0001     ........ .....si- zmac8.lo cal.....
      20: c00c000100010000 0e100004c0a8b24b                                       ........ .......K

    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleQuery
    FEIN: fusion.http.handle query: dns[query,192.168.178.75:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@264587158 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1147629119 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']]
    04.08.2011 09:14:30 javax.jmdns.impl.tasks.Responder start
    AM FEINSTEN: Responder(fusion.http)start() question=[AllRecords@264587158 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    04.08.2011 09:14:30 javax.jmdns.impl.tasks.Responder start
    AM FEINSTEN: Responder(fusion.http)start() Responder chosen delay=0
    04.08.2011 09:14:30 javax.jmdns.impl.DNSIncoming readAnswer
    FEINER: DNSIncoming() unknown type:TYPE_NSEC index 47
    04.08.2011 09:14:30 javax.jmdns.impl.SocketListener run
    AM FEINSTEN: SocketListener(fusion.http).run() JmDNS in:dns[response,192.168.178.75:5353, length=90, id=0x0, flags=0x8400:r:aa, answers=2
    answers:
        [IPv6Address@1779280140 type: TYPE_AAAA index 28, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '120/120' address: 'fe80:0:0:0:e6ce:8fff:fe26:9ec6%0']
        [IPv4Address@651528505 type: TYPE_A index 1, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '120/120' address: '192.168.178.75']]
        answer:        [IPv6Address@1779280140 type: TYPE_AAAA index 28, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '120/120' address: 'fe80:0:0:0:e6ce:8fff:fe26:9ec6%0']
        answer:        [IPv4Address@651528505 type: TYPE_A index 1, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '120/120' address: '192.168.178.75']
       0: 0000840000000002 000000010853492d 5a4d414338056c6f 63616c00001c8001     ........ .....SI- ZMAC8.lo cal.....
      20: 000000780010fe80 000000000000e6ce 8ffffe269ec6c00c 0001800100000078     ...x.... ........ ...&.... .......x
      40: 0004c0a8b24bc00c 002f800100000078 0008c00c00044000 0008                 .....K.. ./.....x ......@. ..

    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleRecord
    FEIN: fusion.http handle response: [IPv6Address@1779280140 type: TYPE_AAAA index 28, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '119/120' address: 'fe80:0:0:0:e6ce:8fff:fe26:9ec6%0']
    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleRecord
    FEIN: fusion.http handle response cached record: null
    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleRecord
    FEIN: fusion.http handle response: [IPv4Address@651528505 type: TYPE_A index 1, class: CLASS_IN index 1-unique, name: SI-ZMAC8.local. ttl: '119/120' address: '192.168.178.75']
    04.08.2011 09:14:30 javax.jmdns.impl.JmDNSImpl handleRecord
    FEIN: fusion.http handle response cached record: null
    04.08.2011 09:14:31 javax.jmdns.impl.tasks.state.DNSStateTask run
    FEINER: Prober(fusion.http).run() JmDNS probing fusion.http
    04.08.2011 09:14:31 javax.jmdns.impl.tasks.state.DNSStateTask run
    FEINER: Prober(fusion.http).run() JmDNS probing #probing 2
    04.08.2011 09:14:31 javax.jmdns.impl.JmDNSImpl send
    AM FEINSTEN: send(fusion.http) JmDNS out:dns[query,224.0.0.251:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@1653858092 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1512109123 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']]
        question:      [AllRecords@1653858092 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
        authoritative: [IPv4Address@1512109123 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']
       0: 0000000000010000 000100000873692d 7a6d616338056c6f 63616c0000ff0001     ........ .....si- zmac8.lo cal.....
      20: c00c000100010000 0e100004c0a8b24b                                       ........ .......K

    04.08.2011 09:14:31 javax.jmdns.impl.SocketListener run
    AM FEINSTEN: SocketListener(fusion.http).run() JmDNS in:dns[query,192.168.178.75:5353, length=48, id=0x0, questions=1, authorities=1
    questions:
        [AllRecords@696551663 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
    authorities:
        [IPv4Address@1010440244 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']]
        question:      [AllRecords@696551663 type: TYPE_ANY index 255, class: CLASS_IN index 1, name: si-zmac8.local.]
        authoritative: [IPv4Address@1010440244 type: TYPE_A index 1, class: CLASS_IN index 1, name: si-zmac8.local. ttl: '3600/3600' address: '192.168.178.75']
       0: 0000000000010000 000100000873692d 7a6d616338056c6f 63616c0000ff0001     ........ .....si- zmac8.lo cal.....
      20: c00c000100010000 0e100004c0a8b24b                                       ........ .......K

Edit: Here's an excerpt of the output of jstack for my Felix instance (I've excluded all threads which are listed as runnable or timed waiting):

Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.1-b02-383 mixed mode):

"Thread-40" daemon prio=5 tid=7fa7be0ac800 nid=0x10ad9a000 in Object.wait() [10ad99000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at EDU.oswego.cs.dl.util.concurrent.CyclicBarrier.doBarrier(Unknown Source)
    - locked <7f36e5728> (a org.apache.felix.eventadmin.impl.tasks.Rendezvous)
    at EDU.oswego.cs.dl.util.concurrent.CyclicBarrier.barrier(Unknown Source)
    at org.apache.felix.eventadmin.impl.tasks.Rendezvous.waitForRendezvous(Rendezvous.java:55)
    at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:272)
    at org.apache.felix.eventadmin.impl.EventAdminImpl.handleEvent(EventAdminImpl.java:165)
    at org.apache.felix.eventadmin.impl.EventAdminImpl.sendEvent(EventAdminImpl.java:108)
    at org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator.sendEvent(EventAdminSecurityDecorator.java:94)
    at com.xxx.yyy.commons.OSGiEventHub.sendEvent(OSGiEventHub.java:200)
    at com.xxx.yyy.can.connections.impl.CANConnectionLog.receiveCANMessages(CANConnectionLog.java:288)
    at com.xxx.yyy.can.connections.impl.CANConnectionMessageAgent.run(CANConnectionMessageAgent.java:70)
    - locked <7f45fe3c8> (a com.bosch.fusion.can.connections.impl.CANConnectionMessageAgent)

"Thread-35" daemon prio=5 tid=7fa7bfa67000 nid=0x10a88b000 waiting on condition [10a88a000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-34" daemon prio=5 tid=7fa7be012800 nid=0x10a788000 waiting on condition [10a787000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-33" daemon prio=5 tid=7fa7c00dd800 nid=0x10a685000 waiting on condition [10a684000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-32" daemon prio=5 tid=7fa7c3001800 nid=0x10a582000 waiting on condition [10a581000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-31" daemon prio=5 tid=7fa7c1801800 nid=0x10a47f000 waiting on condition [10a47e000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-30" daemon prio=5 tid=7fa7c3001000 nid=0x10a37c000 waiting on condition [10a37b000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-29" daemon prio=5 tid=7fa7be016800 nid=0x10bcc7000 waiting on condition [10bcc6000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-28" daemon prio=5 tid=7fa7bc82b000 nid=0x10bbc4000 waiting on condition [10bbc3000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-27" daemon prio=5 tid=7fa7bfa2f000 nid=0x10bac1000 waiting on condition [10bac0000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)

"Thread-26" daemon prio=5 tid=7fa7be016000 nid=0x108ff2000 waiting on condition [108ff1000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <7f45ae1b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)


"SCR Component Actor" daemon prio=5 tid=7fa7bc87f800 nid=0x109fa2000 in Object.wait() [109fa1000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f46fb9f0> (a java.util.LinkedList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.scr.impl.ComponentActorThread.run(ComponentActorThread.java:76)
    - locked <7f46fb9f0> (a java.util.LinkedList)
    at java.lang.Thread.run(Thread.java:680)

"CM Event Dispatcher" daemon prio=5 tid=7fa7c0116800 nid=0x109e9e000 in Object.wait() [109e9d000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e1090> (a java.util.LinkedList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:76)
    - locked <7f44e1090> (a java.util.LinkedList)
    at java.lang.Thread.run(Thread.java:680)

"CM Configuration Updater" daemon prio=5 tid=7fa7c0116000 nid=0x109d9b000 in Object.wait() [109d9a000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e53a0> (a java.util.LinkedList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:76)
    - locked <7f44e53a0> (a java.util.LinkedList)
    at java.lang.Thread.run(Thread.java:680)

"FelixPackageAdmin" daemon prio=5 tid=7fa7bc876000 nid=0x109b07000 in Object.wait() [109b06000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e5c20> (a org.apache.felix.framework.PackageAdminImpl)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.framework.PackageAdminImpl.run(PackageAdminImpl.java:350)
    - locked <7f44e5c20> (a org.apache.felix.framework.PackageAdminImpl)
    at java.lang.Thread.run(Thread.java:680)

"FelixStartLevel" daemon prio=5 tid=7fa7bc873000 nid=0x109a04000 in Object.wait() [109a03000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e22d8> (a java.util.ArrayList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:244)
    - locked <7f44e22d8> (a java.util.ArrayList)
    at java.lang.Thread.run(Thread.java:680)

"FelixDispatchQueue" prio=5 tid=7fa7bfa27000 nid=0x1098e5000 in Object.wait() [1098e4000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e6538> (a java.util.ArrayList)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:924)
    - locked <7f44e6538> (a java.util.ArrayList)
    at org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:54)
    at org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:106)
    at java.lang.Thread.run(Thread.java:680)

"Finalizer" daemon prio=8 tid=7fa7c0000000 nid=0x108e34000 in Object.wait() [108e33000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f44e6520> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
    - locked <7f44e6520> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=7fa7bf93e000 nid=0x108d31000 in Object.wait() [108d30000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
    - locked <7f44e10a8> (a java.lang.ref.Reference$Lock)

"main" prio=5 tid=7fa7bf800800 nid=0x100fb6000 in Object.wait() [100fb5000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7f45a6180> (a org.apache.felix.framework.util.ThreadGate)
    at org.apache.felix.framework.util.ThreadGate.await(ThreadGate.java:79)
    - locked <7f45a6180> (a org.apache.felix.framework.util.ThreadGate)
    at org.apache.felix.framework.Felix.waitForStop(Felix.java:922)
    at org.apache.felix.main.Main.main(Main.java:295)

"VM Thread" prio=9 tid=7fa7bf939800 nid=0x108c2e000 runnable 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

丢了幸福的猪 2024-12-04 21:58:07

您确定设置正确吗?此类问题的最常见原因是: 主机名和防火墙配置错误。

  • 防火墙是最容易诊断的,检查端口5353/udp是否为
    打开。
  • 主机名问题在 Linux 上最常见,这意味着您
    正在侦听与您发布的子网不同的另一个子网。你
    可以在创建 JmDNS 实例时固定主机名或指定 IP 地址。

Are you sure of the setup? The most common reason for this type of issues are: Badly configured hostname and firewall.

  • The firewall is the easiest to diagnose, check that port 5353/udp is
    open.
  • The hostname issue is most common on Linux and means that you
    are listening on another subnet than the one you are publishing. You
    can either fix the hostname of specify an IP address when creating the JmDNS instance.
十二 2024-12-04 21:58:07

您如何检测服务是否已发布?您是从另一个包检查还是从 Gogo shell 检查?如果是前者,您可能会看到一些类空间不兼容,从而过滤了服务。如果是后者,那我就不确定了。如果您还没有这样做,请在Gogo中输入“inspect sc 14”来检查bundle 14的服务能力,看看它是否提供任何服务。

也许我误解了,你是在谈论 DNS 服务还是 OSGi 服务?如果是 DNS,则忽略我的评论。

How are you detecting whether the service is published or not? Are you checking from another bundle or are you checking from the Gogo shell? If the former, maybe you are seeing some class space incompatibility, which filters the service. If the latter, then I'm not sure. If you haven't done so, type "inspect s c 14" in Gogo to check the service capabilities of bundle 14 to see if it provides any services.

Perhaps I am misunderstanding, are you talking about DNS services or OSGi services? If DNS, then disregard my comments.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文