felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@adobe.com>
Subject Re: Using declarative services in a web application bundle
Date Wed, 04 Jul 2012 06:58:50 GMT
Hi,

You might want to use a build from trunk instead. We used to use Bundle.getResource (using
the class loader and thus failing in your case) whereas we now use Bundle.findEntries (not
using the class loader).

Regards
Felix

Am 03.07.2012 um 22:39 schrieb Humeniuk, David P:

> I'm trying to use declarative services in a web application bundle and I haven't found
a lot of examples online on how to do this.
> 
> 
> 
> I'm using BND component annotations for my declarative service component along with the
-wab flag to set the Bundle-Classpath properly.  This will place my component implementation
under WEB-INF/classes as is required by a web application and adds WEB-INF/classes to my Bundle-Classpath.
 In addition, BND will place a declarative services component XML file under OSGI-INF at the
root or the bundle file and create a service component entry in the manifest containing that
file.
> 
> 
> 
> When I load the bundle, I get the error that the component description XML cannot be
found.  I'm guessing that is because the declarative service component runtime is trying to
the find the XML as a resource using the bundle class loader.
> 
> 
> 
> Should I be adding something to my Bundle-Classpath to find this or should the service
component runtime still be able to find the XML file?
> 
> 
> 
> This using the latest SCR, 1.6.0.
> 
> 
> 
> As an overview, this is what my bundle looks like:
> 
> ·         META-INF
> 
> o   MANIFEST.MF, contains (plus other stuff):
> 
> §  Service-Component: OSGI-INF/org.example.thosecomponents.ControlServiceImpl.xml
> 
> §  Bundle-ClassPath: WEB-INF/classes,WEB-INF/lib/primefaces-3.3.1.jar,WEB-INF/lib/start-1.0.6.jar
> 
> ·         OSGI-INF
> 
> o   org.example.thosecomponents.ControlServiceImpl.xml
> 
> ·         WEB-INF
> 
> o   classes
> 
> §  org
> 
> ·         example
> 
> o   ...
> 
> o   lib
> 
> §  primefaces-3.3.1.jar
> 
> §  start-1.0.6.jar
> 
> ·         ...
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message