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 Thu, 05 Jul 2012 18:41:47 GMT
Hi,

Am 05.07.2012 um 17:36 schrieb Humeniuk, David P:

> We tried the trunk, but Bundle.findEntries is only called if the manifest entry contains
a wildcard.

Did you build yourselves ?

Because trunk in fact always uses Bundle.findEntries (as of Rev. 1180676).

>  We are using BND which automatically generates the Service-Component header as follows:
> 
> 	Service-Component: OSGI-INF/org.example.thosecomponents.ControlServiceImpl.xml
> 
> Shouldn't the SCR always search for the entries in the bundle/attached fragments and
not use the bundle's classloader?

Correct, which is why it is not done any longer.

I just deployed a SNAPSHOT build of the current trunk.

Regards
Felix

> 
> Thanks,
> Dave
> 
> -----Original Message-----
> From: Felix Meschberger [mailto:fmeschbe@adobe.com] 
> Sent: Wednesday, July 04, 2012 2:59 AM
> To: users@felix.apache.org
> Subject: Re: Using declarative services in a web application bundle
> 
> 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


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


Mime
View raw message