[sip-comm-dev] Problem in implementing new services in S-C


#1

Hello, everyone

         I am working to implement a new service, called “DHTAccess”, in SIP Communicator.

       I have created the following packages according to http://www.sip-communicator.org/index.php/Documentation/CreatingServices

              1) net.java.sip.communicator.service.dhtaccess

                            DHTAccessService.java

              2) net.java.sip.communicator.impl.dhtaccess

                            DHTAccessServiceXMLRPCImpl.java

                            DHTAccessActivator.java

                            dhtaccess.manifest.mf

                            dhtaccess.metadata.xml

       Then I invoked methods of DHTAccessService in the package net.java.sip.communicator.impl.protocol.sip

       Next, I changed the “sip.provider.manifest.mf” file, add “net.java.sip.communicator.service.dhtaccess” to its Import-Package.

       Finally, I added a target named as “"bundle-dhtaccess"” to build.xml and added an entry to the existing target “bundles”

       I can build the project successfully. The “dhtaccess.jar” do exist in /sc-bundles/.

       However, when I run the program using “ant run”, the following exception occurred.

     [java] ERROR: Error starting reference:file:sc-bundles/protocol-sip.jar (org.osgi.framework.BundleException: Unresolved package in bundle 15: package; (&(package=net.java.sip.communicator.service.dhtaccess)(version>=0.0.0)))

     [java] org.osgi.framework.BundleException: Unresolved package in bundle 15: package; (&(package=net.java.sip.communicator.service.dhtaccess)(version>=0.0.0))

     [java] at org.apache.felix.framework.Felix._resolveBundle(Felix.java:1650)

     [java] at org.apache.felix.framework.Felix._startBundle(Felix.java:1517)

     [java] at org.apache.felix.framework.Felix.startBundle(Felix.java:1470)

     [java] at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1065)

     [java] at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)

     [java] at java.lang.Thread.run(Unknown Source)

       The content of dhtaccess.manifest.mf is:

Bundle-Activator: net.java.sip.communicator.impl.protocol.sip.SipActivator

Bundle-Name: SIP Communicator SIP Protocol Provider

Bundle-Description: A bundle that implements the Protocol Provider package over SIP.

Bundle-Vendor: sip-communicator.org

Bundle-Version: 0.0.1

Import-Package: org.osgi.framework,

org.w3c.dom,

net.java.sip.communicator.service.configuration,

net.java.sip.communicator.util,

net.java.sip.communicator.util.xml,

net.java.sip.communicator.service.configuration.event,

net.java.sip.communicator.service.protocol,

net.java.sip.communicator.service.protocol.event,

net.java.sip.communicator.service.netaddr,

net.java.sip.communicator.service.media,

net.java.sip.communicator.service.media.event,

javax.net.ssl,

javax.xml.parsers,

javax.xml.transform,

javax.xml.transform.dom,

javax.xml.transform.stream,

org.apache.log4j,

net.java.sip.communicator.service.dhtaccess

       The content of dhtaccess.metadata.xml is:

<?xml version="1.0" encoding="UTF-8"?>

<bundle>

  <component class="net.java.sip.communicator.impl.dhtaccess.DHTAccessServiceXMLRPCImpl">

    <provides service="net.java.sip.communicator.service.dhtaccess.DHTAccessService"/>

  </component>

</bundle>

       Could somebody in this list kindly point out where I am wrong?

       Thanks in advance.

Sincerely yours,

Wang Yao

Mobile Life and New Media Lab.

Beijing University of Posts and Telecommunications


#2

Hi,

try exporting the package net.java.sip.communicator.service.dhtaccess in dhtaccess.manifest.mf.
A package to be imported must be exported from somewhere :slight_smile:

Cheers
damencho

王尧 wrote:

···

Hello, everyone

         I am working to implement a new service, called “DHTAccess”, in SIP Communicator.

       I have created the following packages according to http://www.sip-communicator.org/index.php/Documentation/CreatingServices

              1) net.java.sip.communicator.service.dhtaccess

                            DHTAccessService.java

              2) net.java.sip.communicator.impl.dhtaccess

                            DHTAccessServiceXMLRPCImpl.java

                            DHTAccessActivator.java

                            dhtaccess.manifest.mf

                            dhtaccess.metadata.xml

       Then I invoked methods of DHTAccessService in the package net.java.sip.communicator.impl.protocol.sip

       Next, I changed the “sip.provider.manifest.mf” file, add “net.java.sip.communicator.service.dhtaccess” to its Import-Package.

       Finally, I added a target named as “"bundle-dhtaccess"” to build.xml and added an entry to the existing target “bundles”

       I can build the project successfully. The “dhtaccess.jar” do exist in /sc-bundles/.

       However, when I run the program using “ant run”, the following exception occurred.

     [_java_] ERROR: Error starting reference:file:sc-bundles/protocol-sip.jar (_org.osgi.framework.BundleException_: Unresolved package in bundle 15: package; (&(package=net.java.sip.communicator.service.dhtaccess)(version>=0.0.0)))

     [_java_] _org.osgi.framework.BundleException_: Unresolved package in bundle 15: package; (&(package=net.java.sip.communicator.service.dhtaccess)(version>=0.0.0))

     [_java_] at org.apache.felix.framework.Felix._resolveBundle(_Felix.java:1650_)

     [_java_] at org.apache.felix.framework.Felix._startBundle(_Felix.java:1517_)

     [_java_] at org.apache.felix.framework.Felix.startBundle(_Felix.java:1470_)

     [_java_] at org.apache.felix.framework.Felix.setFrameworkStartLevel(_Felix.java:1065_)

     [_java_] at org.apache.felix.framework.StartLevelImpl.run(_StartLevelImpl.java:258_)

     [_java_] at java.lang.Thread.run(Unknown Source)

       The content of dhtaccess.manifest.mf is:

Bundle-Activator: net.java.sip.communicator.impl.protocol.sip.SipActivator

Bundle-Name: SIP Communicator SIP Protocol Provider

Bundle-Description: A bundle that implements the Protocol Provider package over SIP.

Bundle-Vendor: sip-communicator.org

Bundle-Version: 0.0.1

Import-Package: org.osgi.framework,

org.w3c.dom,

net.java.sip.communicator.service.configuration,

net.java.sip.communicator.util,

net.java.sip.communicator.util.xml,

net.java.sip.communicator.service.configuration.event,

net.java.sip.communicator.service.protocol,

net.java.sip.communicator.service.protocol.event,

net.java.sip.communicator.service.netaddr,

net.java.sip.communicator.service.media,

net.java.sip.communicator.service.media.event,

javax.net.ssl,

javax.xml.parsers,

javax.xml.transform,

javax.xml.transform.dom,

javax.xml.transform.stream,

org.apache.log4j,

net.java.sip.communicator.service.dhtaccess

       The content of dhtaccess.metadata.xml is:

<?xml version="1.0" encoding="UTF-8"?>

<bundle>

  <component class="net.java.sip.communicator.impl.dhtaccess.DHTAccessServiceXMLRPCImpl">

    <provides service="net.java.sip.communicator.service.dhtaccess.DHTAccessService"/>

  </component>

</bundle>

       Could somebody in this list kindly point out where I am wrong?

       Thanks in advance.

Sincerely yours,

Wang Yao

Mobile Life and New Media Lab.

Beijing University of Posts and Telecommunications

---------------------------------------------------------------------
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 for your advice.

However, I have exported the package. It still dose not work.
The content of dhtaccess.manifest.mf is:

Bundle-Activator: net.java.sip.communicator.impl.dhtaccess.DHTAccessActivator
Bundle-Name: DHT Access Service Provider
Bundle-Description: A bundle that implements the DHT access package.
Bundle-Vendor: sip-communicator.org
Bundle-Version: 0.0.1
Import-Package: org.osgi.framework,
java.net,
java.security,
java.util,
org.apache.xmlrpc,
org.apache.xmlrpc.client,
net.java.sip.communicator.service.dhtaccess,
net.java.sip.communicator.util,
org.apache.felix.servicebinder,
Export-Package: net.java.sip.communicator.service.dhtaccess,
net.java.sip.communicator.impl.dhtaccess
Metadata-Location: /net/java/sip/communicator/impl/dhtaccess/dhtaccess.metadata.xml

The content of sip.provider.manifest.mf is:

Bundle-Activator: net.java.sip.communicator.impl.protocol.sip.SipActivator
Bundle-Name: SIP Communicator SIP Protocol Provider
Bundle-Description: A bundle that implements the Protocol Provider package over SIP.
Bundle-Vendor: sip-communicator.org
Bundle-Version: 0.0.1
Import-Package: org.osgi.framework,
org.w3c.dom,
net.java.sip.communicator.service.configuration,
net.java.sip.communicator.util,
net.java.sip.communicator.util.xml,
net.java.sip.communicator.service.configuration.event,
net.java.sip.communicator.service.protocol,
net.java.sip.communicator.service.protocol.event,
net.java.sip.communicator.service.netaddr,
net.java.sip.communicator.service.media,
net.java.sip.communicator.service.media.event,
javax.net.ssl,
javax.xml.parsers,
javax.xml.transform,
javax.xml.transform.dom,
javax.xml.transform.stream,
org.apache.log4j,
net.java.sip.communicator.service.dhtaccess

···

-----Original Message-----

From: Damian Minkov [mailto:damencho@damencho.com]

Sent: Wednesday, April 16, 2008 5:11 PM
To: dev@sip-communicator.dev.java.net
Subject: Re: [sip-comm-dev] Problem in implementing new services in S-C

Hi,

try exporting the package net.java.sip.communicator.service.dhtaccess in
dhtaccess.manifest.mf.
A package to be imported must be exported from somewhere :slight_smile:

Cheers
damencho

王尧 wrote:

Hello, everyone

         I am working to implement a new service, called “DHTAccess”,
in SIP Communicator.

       I have created the following packages according to
http://www.sip-communicator.org/index.php/Documentation/CreatingServices

              1) net.java.sip.communicator.service.dhtaccess

                            DHTAccessService.java

              2) net.java.sip.communicator.impl.dhtaccess

                            DHTAccessServiceXMLRPCImpl.java

                            DHTAccessActivator.java

                            dhtaccess.manifest.mf

                            dhtaccess.metadata.xml

       Then I invoked methods of DHTAccessService in the package
net.java.sip.communicator.impl.protocol.sip

       Next, I changed the “sip.provider.manifest.mf” file, add
“net.java.sip.communicator.service.dhtaccess” to its Import-Package.

       Finally, I added a target named as “"bundle-dhtaccess"” to
build.xml and added an entry to the existing target “bundles”

       I can build the project successfully. The “dhtaccess.jar” do
exist in /sc-bundles/.

       However, when I run the program using “ant run”, the following
exception occurred.

     [_java_] ERROR: Error starting
reference:file:sc-bundles/protocol-sip.jar
(_org.osgi.framework.BundleException_: Unresolved package in bundle
15: package;
(&(package=net.java.sip.communicator.service.dhtaccess)(version>=0.0.0)))

     [_java_] _org.osgi.framework.BundleException_: Unresolved package
in bundle 15: package;
(&(package=net.java.sip.communicator.service.dhtaccess)(version>=0.0.0))

     [_java_] at
org.apache.felix.framework.Felix._resolveBundle(_Felix.java:1650_)

     [_java_] at
org.apache.felix.framework.Felix._startBundle(_Felix.java:1517_)

     [_java_] at
org.apache.felix.framework.Felix.startBundle(_Felix.java:1470_)

     [_java_] at
org.apache.felix.framework.Felix.setFrameworkStartLevel(_Felix.java:1065_)

     [_java_] at
org.apache.felix.framework.StartLevelImpl.run(_StartLevelImpl.java:258_)

     [_java_] at java.lang.Thread.run(Unknown Source)

       The content of dhtaccess.manifest.mf is:

Bundle-Activator: net.java.sip.communicator.impl.protocol.sip.SipActivator

Bundle-Name: SIP Communicator SIP Protocol Provider

Bundle-Description: A bundle that implements the Protocol Provider
package over SIP.

Bundle-Vendor: sip-communicator.org

Bundle-Version: 0.0.1

Import-Package: org.osgi.framework,

org.w3c.dom,

net.java.sip.communicator.service.configuration,

net.java.sip.communicator.util,

net.java.sip.communicator.util.xml,

net.java.sip.communicator.service.configuration.event,

net.java.sip.communicator.service.protocol,

net.java.sip.communicator.service.protocol.event,

net.java.sip.communicator.service.netaddr,

net.java.sip.communicator.service.media,

net.java.sip.communicator.service.media.event,

javax.net.ssl,

javax.xml.parsers,

javax.xml.transform,

javax.xml.transform.dom,

javax.xml.transform.stream,

org.apache.log4j,

net.java.sip.communicator.service.dhtaccess

       The content of dhtaccess.metadata.xml is:

<?xml version="1.0" encoding="UTF-8"?>

<bundle>

  <component
class="net.java.sip.communicator.impl.dhtaccess.DHTAccessServiceXMLRPCImpl">

    <provides
service="net.java.sip.communicator.service.dhtaccess.DHTAccessService"/>

  </component>

</bundle>

       Could somebody in this list kindly point out where I am wrong?

       Thanks in advance.

Sincerely yours,

Wang Yao

Mobile Life and New Media Lab.

Beijing University of Posts and Telecommunications

---------------------------------------------------------------------
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