[sip-comm-dev] JmDNS problem - java.lang.NoClassDefFoundError


#1

Greetings!
I am implementing the following draft: http://tools.ietf.org/html/draft-lee-sip-dns-sd-uri-03
As a first step I have to advertise the sip uri. I created a class BonjourService in package net.java.sip.communicator.impl.protocol.sip
This is on the same lines as BonjourService in the existing zeroconf implementation.

This BonjourService class imports jmdns classes like so:
import net.java.sip.communicator.impl.protocol.zeroconf.jmdns.*;

When this BonjourService thread starts, I get the following errors:

03:42:56.677 SEVERE: util.UtilActivator.uncaughtException().58 An uncaught exception occurred in thread=Thread[AccountManager.loadStoredAccounts,5,main] and message was: net/java/sip/communicator/impl/protocol/zeroconf/jmdns/JmDNS
java.lang.NoClassDefFoundError: net/java/sip/communicator/impl/protocol/zeroconf/jmdns/JmDNS
         at net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initSIPBonjour(ProtocolProviderServiceSipImpl.java:957)
         at net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initRegistrarConnection(ProtocolProviderServiceSipImpl.java:1780)
         at net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initialize(ProtocolProviderServiceSipImpl.java:676)
         at net.java.sip.communicator.impl.protocol.sip.ProtocolProviderFactorySipImpl.createService(ProtocolProviderFactorySipImpl.java:238)

Why won't if find the JmDNS class? Since the code compiles properly, I must be missing some configuration.

Any help will be greatly appreciated.

Thank you,

-- Akshat

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Though the sources reside in a single tree and thus compile fine, they
are distributed in multiple bundles. Because the bundles act as type
visibility boundaries, having a class in one bundle doesn't make it
visible to the other bundles - one way to do it is to have its
containing package exported in the manifest of the containing bundle.
The Ant script build.xml in the root of the development tree packages
net.java.sip.communicator.impl.protocol.sip in protocol-sip.jar but it
doesn't include the package
net.java.sip.communicator.impl.protocol.zeroconf.jmdns. You either
have to package net.java.sip.communicator.impl.protocol.zeroconf.jmdns
in protocol-sip.jar or export it from whichever bundle it currently is
into (looking at build.xml and bundle-zeroconf, I guess it went into
protocol-zeroconf.jar). If I'm not mistaken, exporting packages isn't
the way to go with SIP Communicator and you should rather pack your
package into protocol-zip.jar or, if it must stay in
protocol-zeroconf.jar, register a service in protocol-zeroconf.jar and
consume it in protocol-sip.jar.

···

On Sun, Nov 2, 2008 at 10:54 AM, Akshat Sikarwar <as3515@columbia.edu> wrote:

Greetings!
I am implementing the following draft:
http://tools.ietf.org/html/draft-lee-sip-dns-sd-uri-03
As a first step I have to advertise the sip uri. I created a class
BonjourService in package net.java.sip.communicator.impl.protocol.sip
This is on the same lines as BonjourService in the existing zeroconf
implementation.

This BonjourService class imports jmdns classes like so:
import net.java.sip.communicator.impl.protocol.zeroconf.jmdns.*;

When this BonjourService thread starts, I get the following errors:

03:42:56.677 SEVERE: util.UtilActivator.uncaughtException().58 An uncaught
exception occurred in
thread=Thread[AccountManager.loadStoredAccounts,5,main] and message was:
net/java/sip/communicator/impl/protocol/zeroconf/jmdns/JmDNS
java.lang.NoClassDefFoundError:
net/java/sip/communicator/impl/protocol/zeroconf/jmdns/JmDNS
       at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initSIPBonjour(ProtocolProviderServiceSipImpl.java:957)
       at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initRegistrarConnection(ProtocolProviderServiceSipImpl.java:1780)
       at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initialize(ProtocolProviderServiceSipImpl.java:676)
       at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderFactorySipImpl.createService(ProtocolProviderFactorySipImpl.java:238)

Why won't if find the JmDNS class? Since the code compiles properly, I must
be missing some configuration.

Any help will be greatly appreciated.

Thank you,

-- Akshat

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Thanks Emil and Lubomir. Copying the source fixed the problem.

--Akshat

···

On Nov 2, 2008, at 6:07 AM, Emil Ivov wrote:

Hey folks,

Looking through the code now, I don't really remember why we copied it
into our source base. This was most probably because we needed to fix
stuff at the time but I can't really put my finger on the exact
changes.

So anyways, given that this is a separate protocol stack, the best
thing to do would be to package it in an OSGi bundle of its own. This
is only a matter of packaging (no code changes would be required). As
Lubomir mentioned, all that this new bundle would do is declare in its
manifest that it exports the jmdns package.

If this sounds scary (although it really shouldn't) then you could
simply copy the classes from the jmdns directory in the protocol.sip
package. This would give you a quick way to test running code.

Hope this helps
Emil

On Sun, Nov 2, 2008 at 11:16 AM, Lubomir Marinov > <lubomir.marinov@gmail.com> wrote:

Though the sources reside in a single tree and thus compile fine, they
are distributed in multiple bundles. Because the bundles act as type
visibility boundaries, having a class in one bundle doesn't make it
visible to the other bundles - one way to do it is to have its
containing package exported in the manifest of the containing bundle.
The Ant script build.xml in the root of the development tree packages
net.java.sip.communicator.impl.protocol.sip in protocol-sip.jar but it
doesn't include the package
net.java.sip.communicator.impl.protocol.zeroconf.jmdns. You either
have to package net.java.sip.communicator.impl.protocol.zeroconf.jmdns
in protocol-sip.jar or export it from whichever bundle it currently is
into (looking at build.xml and bundle-zeroconf, I guess it went into
protocol-zeroconf.jar). If I'm not mistaken, exporting packages isn't
the way to go with SIP Communicator and you should rather pack your
package into protocol-zip.jar or, if it must stay in
protocol-zeroconf.jar, register a service in protocol-zeroconf.jar and
consume it in protocol-sip.jar.

On Sun, Nov 2, 2008 at 10:54 AM, Akshat Sikarwar >> <as3515@columbia.edu> wrote:

Greetings!
I am implementing the following draft:
http://tools.ietf.org/html/draft-lee-sip-dns-sd-uri-03
As a first step I have to advertise the sip uri. I created a class
BonjourService in package net.java.sip.communicator.impl.protocol.sip
This is on the same lines as BonjourService in the existing zeroconf
implementation.

This BonjourService class imports jmdns classes like so:
import net.java.sip.communicator.impl.protocol.zeroconf.jmdns.*;

When this BonjourService thread starts, I get the following errors:

03:42:56.677 SEVERE: util.UtilActivator.uncaughtException().58 An uncaught
exception occurred in
thread=Thread[AccountManager.loadStoredAccounts,5,main] and message was:
net/java/sip/communicator/impl/protocol/zeroconf/jmdns/JmDNS
java.lang.NoClassDefFoundError:
net/java/sip/communicator/impl/protocol/zeroconf/jmdns/JmDNS
      at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initSIPBonjour(ProtocolProviderServiceSipImpl.java:957)
      at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initRegistrarConnection(ProtocolProviderServiceSipImpl.java:1780)
      at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initialize(ProtocolProviderServiceSipImpl.java:676)
      at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderFactorySipImpl.createService(ProtocolProviderFactorySipImpl.java:238)

Why won't if find the JmDNS class? Since the code compiles properly, I must
be missing some configuration.

Any help will be greatly appreciated.

Thank you,

-- Akshat

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hey folks,

Looking through the code now, I don't really remember why we copied it
into our source base. This was most probably because we needed to fix
stuff at the time but I can't really put my finger on the exact
changes.

So anyways, given that this is a separate protocol stack, the best
thing to do would be to package it in an OSGi bundle of its own. This
is only a matter of packaging (no code changes would be required). As
Lubomir mentioned, all that this new bundle would do is declare in its
manifest that it exports the jmdns package.

If this sounds scary (although it really shouldn't) then you could
simply copy the classes from the jmdns directory in the protocol.sip
package. This would give you a quick way to test running code.

Hope this helps
Emil

···

On Sun, Nov 2, 2008 at 11:16 AM, Lubomir Marinov <lubomir.marinov@gmail.com> wrote:

Though the sources reside in a single tree and thus compile fine, they
are distributed in multiple bundles. Because the bundles act as type
visibility boundaries, having a class in one bundle doesn't make it
visible to the other bundles - one way to do it is to have its
containing package exported in the manifest of the containing bundle.
The Ant script build.xml in the root of the development tree packages
net.java.sip.communicator.impl.protocol.sip in protocol-sip.jar but it
doesn't include the package
net.java.sip.communicator.impl.protocol.zeroconf.jmdns. You either
have to package net.java.sip.communicator.impl.protocol.zeroconf.jmdns
in protocol-sip.jar or export it from whichever bundle it currently is
into (looking at build.xml and bundle-zeroconf, I guess it went into
protocol-zeroconf.jar). If I'm not mistaken, exporting packages isn't
the way to go with SIP Communicator and you should rather pack your
package into protocol-zip.jar or, if it must stay in
protocol-zeroconf.jar, register a service in protocol-zeroconf.jar and
consume it in protocol-sip.jar.

On Sun, Nov 2, 2008 at 10:54 AM, Akshat Sikarwar <as3515@columbia.edu> wrote:

Greetings!
I am implementing the following draft:
http://tools.ietf.org/html/draft-lee-sip-dns-sd-uri-03
As a first step I have to advertise the sip uri. I created a class
BonjourService in package net.java.sip.communicator.impl.protocol.sip
This is on the same lines as BonjourService in the existing zeroconf
implementation.

This BonjourService class imports jmdns classes like so:
import net.java.sip.communicator.impl.protocol.zeroconf.jmdns.*;

When this BonjourService thread starts, I get the following errors:

03:42:56.677 SEVERE: util.UtilActivator.uncaughtException().58 An uncaught
exception occurred in
thread=Thread[AccountManager.loadStoredAccounts,5,main] and message was:
net/java/sip/communicator/impl/protocol/zeroconf/jmdns/JmDNS
java.lang.NoClassDefFoundError:
net/java/sip/communicator/impl/protocol/zeroconf/jmdns/JmDNS
       at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initSIPBonjour(ProtocolProviderServiceSipImpl.java:957)
       at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initRegistrarConnection(ProtocolProviderServiceSipImpl.java:1780)
       at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl.initialize(ProtocolProviderServiceSipImpl.java:676)
       at
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderFactorySipImpl.createService(ProtocolProviderFactorySipImpl.java:238)

Why won't if find the JmDNS class? Since the code compiles properly, I must
be missing some configuration.

Any help will be greatly appreciated.

Thank you,

-- Akshat

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net