Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 61BF7EB00 for ; Thu, 14 Mar 2013 12:47:08 +0000 (UTC) Received: (qmail 73093 invoked by uid 500); 14 Mar 2013 12:47:07 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 72914 invoked by uid 500); 14 Mar 2013 12:47:07 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 72904 invoked by uid 99); 14 Mar 2013 12:47:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Mar 2013 12:47:07 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fmeschbe@adobe.com designates 64.18.1.23 as permitted sender) Received: from [64.18.1.23] (HELO exprod6og109.obsmtp.com) (64.18.1.23) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 14 Mar 2013 12:46:58 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob109.postini.com ([64.18.5.12]) with SMTP ID DSNKUUHGrMpgOQ2ZpfgM80iZcv/GwvDkUOPW@postini.com; Thu, 14 Mar 2013 05:46:37 PDT Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r2EChS1v002371 for ; Thu, 14 Mar 2013 05:43:28 -0700 (PDT) Received: from nacas03.corp.adobe.com (nacas03.corp.adobe.com [10.8.189.121]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r2ECkXAV021709 for ; Thu, 14 Mar 2013 05:46:33 -0700 (PDT) Received: from eurcas01.eur.adobe.com (10.128.4.27) by nacas03.corp.adobe.com (10.8.189.121) with Microsoft SMTP Server (TLS) id 8.3.298.1; Thu, 14 Mar 2013 05:46:32 -0700 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurcas01.eur.adobe.com ([10.128.4.27]) with mapi; Thu, 14 Mar 2013 12:46:31 +0000 From: Felix Meschberger To: "users@felix.apache.org" Date: Thu, 14 Mar 2013 12:46:30 +0000 Subject: Re: No HttpService available Thread-Topic: No HttpService available Thread-Index: Ac4gsfOVMuwz2dgtRPefak9GpOyiqA== Message-ID: <68F5378B-2205-453A-AF7B-8BC0BECEE1B5@adobe.com> References: In-Reply-To: Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi Can you verify the HttpService is available at all in the framework ? (You = might try to access the web console) If not, you might have an issue to not properly setup the Http Service brid= ge: This requires wiring from the servlet which is actually deployed in the= servlet container. See [1] and the linked examples for details. Regards Felix [1] http://felix.apache.org/documentation/subprojects/apache-felix-http-ser= vice.html#using-the-servlet-bridge Am 14.03.2013 um 12:50 schrieb Stephan Schr=F6der: > Hi, >=20 > i want to write a HelloWorld-Servlet using Felixes HttpServie. > The setup is to embedd Felix and the HelloWorldServlet in a war-file and = deploy this on Tomcat6. >=20 > The BundleActivator for the HelloWorldServletBundle checks whether a Http= Servie is available a prints out an error message if that's not the case: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>=20 >=20 > @Override > public void start(BundleContext context) throws Exception > { > ServiceReference sRef =3D context.getServiceReference(HttpService= .class.getName()); > if (sRef !=3D null) > { > HttpService service =3D (HttpService) context.getService(sRef= ); > service.registerServlet(ALIAS, new HelloWorldServlet(), null,= null); > }else{ > System.out.println("no HttpService found to register Servlet = for "+ALIAS); > } > } > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >=20 > and sadly this is exectly what happens when deploying the war-file on Tom= cat6: >=20 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>=20 > Connected to server > [2013-03-14 12:34:42,775] Artifact felix-bridge:war exploded: Artifact is= being deployed, please wait... > starting OSGi > Installing bundle [jndi:/localhost/WEB-INF/systemBundles/org.apache.felix= .http.bridge-2.2.0.jar] > Installing bundle [jndi:/localhost/WEB-INF/systemBundles/org.apache.felix= .gogo.runtime_0.10.0.jar] > Installing bundle [jndi:/localhost/WEB-INF/systemBundles/org.apache.felix= .webconsole-3.1.8.jar] > Installing bundle [jndi:/localhost/WEB-INF/systemBundles/org.apache.felix= .http.base-2.2.0.jar] > Installing bundle [jndi:/localhost/WEB-INF/systemBundles/org.apache.felix= .bundlerepository-1.6.6.jar] > Installing bundle [jndi:/localhost/WEB-INF/systemBundles/org.apache.felix= .gogo.shell_0.10.0.jar] > Installing bundle [jndi:/localhost/WEB-INF/systemBundles/org.apache.felix= .http.api-2.2.0.jar] > Installing bundle [jndi:/localhost/WEB-INF/systemBundles/org.apache.felix= .gogo.command_0.12.0.jar] > Installing bundle [jndi:/localhost/WEB-INF/applicationBundles/HelloWorldS= ervletEmbedded-1.0-SNAPSHOT.jar] > Starting bundle [org.apache.felix.http.bridge] > [INFO] Started bridged http service > Starting bundle [org.apache.felix.gogo.runtime] > Starting bundle [org.apache.felix.webconsole] > Starting bundle [org.apache.felix.http.base] > Starting bundle [org.apache.felix.bundlerepository] > Starting bundle [org.apache.felix.gogo.shell] > Starting bundle [org.apache.felix.http.api] > Starting bundle [org.apache.felix.gogo.command] > Starting bundle [com.mobenga.HelloWorldServletEmbedded] > no HttpService found to register Servlet for /hello <-= --no HttpService! > OSGi startet > [2013-03-14 12:34:43,176] Artifact felix-bridge:war exploded: Artifact is= deployed successfully > ____________________________ > Welcome to Apache Felix Gogo >=20 > g! Mar 14, 2013 12:34:52 PM org.apache.catalina.startup.HostConfig deploy= Directory > INFO: Deploying web application directory manager > lb > START LEVEL 1 > ID|State |Level|Name > 0|Active | 0|System Bundle (4.0.2) > 1|Active | 1|Apache Felix Http Bridge (2.2.0) > 2|Active | 1|Apache Felix Gogo Runtime (0.10.0) > 3|Active | 1|Apache Felix Web Management Console (3.1.8) > 4|Active | 1|Apache Felix Http Base (2.2.0) > 5|Active | 1|Apache Felix Bundle Repository (1.6.6) > 6|Active | 1|Apache Felix Gogo Shell (0.10.0) > 7|Active | 1|Apache Felix Http Api (2.2.0) > 8|Active | 1|Apache Felix Gogo Command (0.12.0) > 9|Active | 1|HelloWorldServletEmbedded (1.0.0.SNAPSHOT) > g! > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >=20 > Because all bundles are active i assume i forgot some needed bundle or co= nfiguration? > (I assume i don't need an embedded Jetty because this runs on top of Tomc= at!?) >=20 > If you need more information here is the whole maven project as a zip: > https://docs.google.com/file/d/0BwYlZDH_xJugamxJQ2QzaWJULVU/edit?usp=3Dsh= aring >=20 > Regards, > Stephan >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > For additional commands, e-mail: users-help@felix.apache.org >=20 -- Felix Meschberger | Principal Scientist | Adobe --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org