You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Thomas Bauer <xa...@gmail.com> on 2009/05/20 04:36:41 UTC
Problem starting http service/jetty
Hi!
I'm new to the OSGI world and just did play with some examples I
implemented.
Now I want to use a http service basically for:
serve static and dynamic resources from my bundle/service
I thought I would need a http service for that and found the jetty osgi
download on the felix page.
I downloaded it, built it with maven and installed it in my "clean" felix
1.8 instance.
Installation went fine but when I start the service it says this:
-> ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (1.8.0)
[ 1] [Active ] [ 1] Apache Felix Shell Service (1.2.0)
[ 2] [Active ] [ 1] Apache Felix Shell TUI (1.2.0)
[ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.4.0)
[ 8] [Installed ] [ 1] HTTP Service (1.0.0)
-> start 8
org.osgi.framework.BundleException: Unresolved constraint in bundle 8:
package; (&(package=org.osgi.service.http)(version>=1.2.0))
->
Why is that? Shouldn't jetty provide th org.osgi.service.http?
I did an export:
-> exports 8
org.apache.felix.http.jetty [8] exports:
----------------------------------------
Nothing
->
when doing headers:
-> headers 8
HTTP Service (8)
----------------
Tool = Bnd-0.0.311
Bundle-Activator = org.apache.felix.http.jetty.Activator
Created-By = Apache Maven Bundle Plugin
Bnd-LastModified = 1242782689876
Export-Service = org.osgi.service.http.HttpService
Built-By = thomas
Private-Package =
org.mortbay.util,org.mortbay.component,org.mortbay.jetty.bio,org.mortbay.thread,org.mortbay.servlet.jetty,org.mortbay.servlet,org.mortbay.jetty.nio,org.mortbay.resource,org.mortbay.io.nio,org.mortbay.jetty.security,org.mortbay.log,org.mortbay.jetty.deployer,org.apache.felix.http.jetty,org.mortbay.xml,org.mortbay.io.bio,org.mortbay.jetty.servlet,
org.mortbay.io
,org.mortbay.jetty.handler,org.mortbay.jetty.webapp,org.mortbay.jetty,org.mortbay.util.ajax
Export-Package =
org.osgi.service.http;uses:="javax.servlet.http,javax.servlet";version="1.1",javax.servlet;version="2.5",javax.servlet.http;uses:="javax.servlet";version="2.5"
Bundle-Version = 1.0.0
Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
Build-Jdk = 1.5.0_16
Manifest-Version = 1.0
Bundle-Vendor = The Apache Software Foundation
Bundle-ManifestVersion = 2
Bundle-DocURL = http://www.apache.org/
Import-Package =
javax.net.ssl;resolution:=optional,javax.security.cert;resolution:=optional,javax.servlet;version="2.5",javax.servlet.http;version="2.5",javax.xml.parsers;resolution:=optional,org.osgi.framework;version="1.3",
org.osgi.service.cm
;version="1.2",org.osgi.service.http;version="1.2",org.osgi.service.log;version="1.3",org.osgi.util.tracker;version="1.3",org.slf4j;resolution:=optional,org.xml.sax;resolution:=optional,org.xml.sax.helpers;resolution:=optional
Bundle-Name = HTTP Service
Bundle-Description = An implementation of the OSGi HTTP Service
using Jetty.
Bundle-SymbolicName = org.apache.felix.http.jetty
->
So it seems at least it exports something:
Export-Service = org.osgi.service.http.HttpService
Well - I'm a bit confused as I don't have a clue what I did wrong.
BTW I didn't touch the config.properties
Please help me and tell me what I am missing.
Thanks,
Thomas
Re: Problem starting http service/jetty
Posted by Rob Walker <ro...@ascert.com>.
Steve's response is spot on - you need a bundle that exports the
standard OSGi services
> Why is that? Shouldn't jetty provide th org.osgi.service.http?
>
There's 2 schools of thought on this one:
* bundles should include and support their own service / API classes
and interfaces
* service / API classes and interfaces should be in separate
standalone bundles
Personally, I've tended towards the former in my own code - but on Oscar
and Felix some time back the consensus was towards the latter.
-- Rob
Re: Problem starting http service/jetty
Posted by Steve Lindsay <st...@gmail.com>.
On Wed, May 20, 2009 at 12:36 PM, Thomas Bauer <xa...@gmail.com> wrote:
>
> Installation went fine but when I start the service it says this:
>
> -> ps
> START LEVEL 1
> ID State Level Name
> [ 0] [Active ] [ 0] System Bundle (1.8.0)
> [ 1] [Active ] [ 1] Apache Felix Shell Service (1.2.0)
> [ 2] [Active ] [ 1] Apache Felix Shell TUI (1.2.0)
> [ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.4.0)
> [ 8] [Installed ] [ 1] HTTP Service (1.0.0)
> -> start 8
> org.osgi.framework.BundleException: Unresolved constraint in bundle 8:
> package; (&(package=org.osgi.service.http)(version>=1.2.0))
> ->
>
I think you need the compendium bundle (or another bundle that
provides org.osgi.service.http). From the felix console run:
obr start 'OSGi R4 Compendium Bundle'
Cheers....Steve
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Problem starting http service/jetty
Posted by Gionni <gi...@tiscali.it>.
Hi Thomas,
Thomas Bauer wrote:
>
> I thought I would need a http service for that and found the jetty osgi
> download on the felix page.
>
you can also try http://wiki.ops4j.org/display/paxweb/Pax+Web
http://wiki.ops4j.org/display/paxweb/Pax+Web that is an avanced HTTP
service based on Jetty. http://wiki.ops4j.org/display/paxweb/Documentation
Here you can find documentation and
http://wiki.ops4j.org/display/paxweb/Download Download . You can start
installing the Pax Web Service bundle that provide the basic Http service.
Regards
Giovanni
--
View this message in context: http://www.nabble.com/Problem-starting-http-service-jetty-tp23628021p23649469.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org