felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Bartlett <njbartl...@gmail.com>
Subject Re: Using declarative services in a web application bundle
Date Tue, 03 Jul 2012 22:24:20 GMT
Do you get an actual error message, or do you just not get the DS
behaviour that you are expecting?

Note that Web Application classes in WABs cannot also be DS components
(nor can they be Blueprint beans, etc). This is because their
lifecycle must be entirely managed by the Web Container.... see
section 128.6.2 of the R4 Enterprise specification.

Neil

On Tue, Jul 3, 2012 at 9:39 PM, Humeniuk, David P
<David.Humeniuk@udri.udayton.edu> wrote:
> 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