You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by agrz <al...@medisite.de> on 2014/01/14 11:34:21 UTC

OSGi Compendium APIs

Hi,

I want to deploy some services implementing APIs from OSGi Compendium
(Preferences and UserAdmin) and followed the instructions in this post:
http://karaf.922171.n3.nabble.com/Newbie-question-Useradmin-service-dependency-from-where-td4026903.html
I added the package org.osgi.service.useradmin to
org.osgi.framework.system.packages configuration and it is listed in the
package:exports. My UserAdmin implementation resolves correctly but on start
it does not find the classes in org.osgi.service.useradmin.
Am I missing something?
Thanks
Alex




--
View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: OSGi Compendium APIs

Posted by agrz <al...@medisite.de>.
That would be very helpfull. Even if I got it working too now by including
the APIs in the jar. And also the Felix UserAdmin has them now included when
building the latest verison from sources.


rkmoquin wrote
> I had gotten the User Admin service working correctly in Karaf 3.0.0.  I
> can get the code pushed up in my github repo if you like, maybe it will
> help.  It's pretty easy to do.






--
View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031036.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: OSGi Compendium APIs

Posted by Ryan Moquin <fr...@gmail.com>.
I had gotten the User Admin service working correctly in Karaf 3.0.0.  I
can get the code pushed up in my github repo if you like, maybe it will
help.  It's pretty easy to do.

Ryan
On Jan 14, 2014 7:17 AM, "agrz" <al...@medisite.de> wrote:

> Yes, this is what I did to get it running. But I was wondering if there is
> another way in karaf providing standard osgi apis. This is what I
> understood
> reading this post:
>
> http://karaf.922171.n3.nabble.com/Newbie-question-Useradmin-service-dependency-from-where-td4026903.html
> Thanks anyways
> Alex
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031012.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: OSGi Compendium APIs

Posted by agrz <al...@medisite.de>.
Yes, this is what I did to get it running. But I was wondering if there is
another way in karaf providing standard osgi apis. This is what I understood
reading this post:
http://karaf.922171.n3.nabble.com/Newbie-question-Useradmin-service-dependency-from-where-td4026903.html
Thanks anyways
Alex



--
View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031012.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: OSGi Compendium APIs

Posted by David Bosschaert <da...@gmail.com>.
It sounds like you're manually adding a package to the system bundle
exports without actually providing the package classes. Would it not
be better to simply install a bundle that exports the package you
need? That means that you don't need to manually edit config files
etc...

While it's generally recommended that implementations of compendium
APIs provide the APIs themselves, you can also obtain them from the
compendium API jars:
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.osgi%22%20AND%20a%3A%22org.osgi.compendium%22

Cheers,

David

On 14 January 2014 11:13, agrz <al...@medisite.de> wrote:
> Hi JB
>
> yes the import is correct. The bundle is resolved and gets an error during
> runtime.
> In fact trying with felix UserAdmin implementation is the same behavior.
> Trying to deploy version 1.0.3 of Felix UserAdmin I get the following error:
>
> org.osgi.framework.BundleException: Activator start error in bundle
> org.apache.felix.useradmin [79].
>         at
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)[org.apache.felix.framework-4.2.1.jar:]
>         at
> org.apache.felix.framework.Felix.startBundle(Felix.java:2064)[org.apache.felix.framework-4.2.1.jar:]
>         at
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.2.1.jar:]
>         at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[16:org.apache.felix.fileinstall:3.2.6]
>         at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[16:org.apache.felix.fileinstall:3.2.6]
>         at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:508)[16:org.apache.felix.fileinstall:3.2.6]
>         at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[16:org.apache.felix.fileinstall:3.2.6]
> Caused by: java.lang.NoClassDefFoundError:
> org.osgi.service.useradmin.UserAdminListener
>         at
> org.apache.felix.useradmin.osgi.UserAdminListenerListHelper.class$(UserAdminListenerListHelper.java:38)
>         at
> org.apache.felix.useradmin.osgi.UserAdminListenerListHelper.<init>(UserAdminListenerListHelper.java:38)
>         at
> org.apache.felix.useradmin.osgi.Activator.createServiceContext(Activator.java:68)
>         at org.apache.felix.useradmin.osgi.Activator.start(Activator.java:37)
>         at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
>         at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
>         ... 6 more
>
>
> In my config properties I have set:
>
>
> org.osgi.framework.system.packages= \
>  org.osgi.framework.startlevel;uses:="org.osgi.framework";version="1.0", \
>  org.osgi.framework.wiring;uses:="org.osgi.framework";version="1.1", \
>  org.osgi.framework.hooks.bundle;uses:="org.osgi.framework";version="1.1", \
>  org.osgi.framework.hooks.service;uses:="org.osgi.framework";version="1.1",
> \
>
> org.osgi.framework.hooks.resolver;uses:="org.osgi.framework.wiring";version="1.0",
> \
>  org.osgi.framework.launch;uses:="org.osgi.framework";version="1.1", \
>  org.osgi.framework.namespace;uses:="org.osgi.resource";version="1.0", \
>  org.osgi.framework;version="1.7", \
>
> org.osgi.framework.hooks.weaving;uses:="org.osgi.framework.wiring";version="1.0",\
>  org.osgi.resource;version="1.0",org.osgi.service.url;version="1.0",\
>  org.osgi.service.startlevel;uses:="org.osgi.framework";version="1.1",\
>  org.osgi.service.packageadmin;uses:="org.osgi.framework";version="1.2",\
>  org.osgi.service.useradmin;uses:="org.osgi.framework";version="1.1",\
>  org.osgi.service.url;version="1.0", \
>  org.osgi.util.tracker;uses:="org.osgi.framework";version="1.5.1", \
>  org.apache.karaf.jaas.boot;version="3.0.0", \
>  org.apache.karaf.jaas.boot.principal;version="3.0.0", \
>  org.apache.karaf.management.boot;version="3.0.0", \
>  org.apache.karaf.version;version="3.0.0", \
>  ${jre-${java.specification.version}}
>
>
> I am using Karaf 3.0.0 Release. I also tried to look into the libraries that
> karaf includes and could only find very few the compendium services APIs.
> Where does karaf get the additonal  org.osgi.service packages from? Is there
> something that needs to be installed in addition?
>
> Regards
> Alexander
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031005.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Re: OSGi Compendium APIs

Posted by agrz <al...@medisite.de>.
Hi JB

yes the import is correct. The bundle is resolved and gets an error during
runtime.
In fact trying with felix UserAdmin implementation is the same behavior.
Trying to deploy version 1.0.3 of Felix UserAdmin I get the following error:

org.osgi.framework.BundleException: Activator start error in bundle
org.apache.felix.useradmin [79].
	at
org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)[org.apache.felix.framework-4.2.1.jar:]
	at
org.apache.felix.framework.Felix.startBundle(Felix.java:2064)[org.apache.felix.framework-4.2.1.jar:]
	at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.2.1.jar:]
	at
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[16:org.apache.felix.fileinstall:3.2.6]
	at
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[16:org.apache.felix.fileinstall:3.2.6]
	at
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:508)[16:org.apache.felix.fileinstall:3.2.6]
	at
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[16:org.apache.felix.fileinstall:3.2.6]
Caused by: java.lang.NoClassDefFoundError:
org.osgi.service.useradmin.UserAdminListener
	at
org.apache.felix.useradmin.osgi.UserAdminListenerListHelper.class$(UserAdminListenerListHelper.java:38)
	at
org.apache.felix.useradmin.osgi.UserAdminListenerListHelper.<init>(UserAdminListenerListHelper.java:38)
	at
org.apache.felix.useradmin.osgi.Activator.createServiceContext(Activator.java:68)
	at org.apache.felix.useradmin.osgi.Activator.start(Activator.java:37)
	at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
	at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
	... 6 more


In my config properties I have set:


org.osgi.framework.system.packages= \
 org.osgi.framework.startlevel;uses:="org.osgi.framework";version="1.0", \
 org.osgi.framework.wiring;uses:="org.osgi.framework";version="1.1", \
 org.osgi.framework.hooks.bundle;uses:="org.osgi.framework";version="1.1", \
 org.osgi.framework.hooks.service;uses:="org.osgi.framework";version="1.1",
\

org.osgi.framework.hooks.resolver;uses:="org.osgi.framework.wiring";version="1.0",
\
 org.osgi.framework.launch;uses:="org.osgi.framework";version="1.1", \
 org.osgi.framework.namespace;uses:="org.osgi.resource";version="1.0", \
 org.osgi.framework;version="1.7", \

org.osgi.framework.hooks.weaving;uses:="org.osgi.framework.wiring";version="1.0",\
 org.osgi.resource;version="1.0",org.osgi.service.url;version="1.0",\
 org.osgi.service.startlevel;uses:="org.osgi.framework";version="1.1",\
 org.osgi.service.packageadmin;uses:="org.osgi.framework";version="1.2",\
 org.osgi.service.useradmin;uses:="org.osgi.framework";version="1.1",\
 org.osgi.service.url;version="1.0", \
 org.osgi.util.tracker;uses:="org.osgi.framework";version="1.5.1", \
 org.apache.karaf.jaas.boot;version="3.0.0", \
 org.apache.karaf.jaas.boot.principal;version="3.0.0", \
 org.apache.karaf.management.boot;version="3.0.0", \
 org.apache.karaf.version;version="3.0.0", \
 ${jre-${java.specification.version}}


I am using Karaf 3.0.0 Release. I also tried to look into the libraries that
karaf includes and could only find very few the compendium services APIs.
Where does karaf get the additonal  org.osgi.service packages from? Is there
something that needs to be installed in addition?

Regards
Alexander



--
View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031005.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: OSGi Compendium APIs

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Alex,

is your bundle import the packages correctly ?

Regards
JB

On 01/14/2014 11:34 AM, agrz wrote:
> Hi,
>
> I want to deploy some services implementing APIs from OSGi Compendium
> (Preferences and UserAdmin) and followed the instructions in this post:
> http://karaf.922171.n3.nabble.com/Newbie-question-Useradmin-service-dependency-from-where-td4026903.html
> I added the package org.osgi.service.useradmin to
> org.osgi.framework.system.packages configuration and it is listed in the
> package:exports. My UserAdmin implementation resolves correctly but on start
> it does not find the classes in org.osgi.service.useradmin.
> Am I missing something?
> Thanks
> Alex
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com