EasyBeans is an open source implementation by ObjectWeb of the EJB3 container specification. 
X Wiki
  History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: EZB-290
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Guillaume Sauthier
Reporter: Eric Glass
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
EasyBeans

With Equinox Configuration Admin Service the Configuration can not be found with "(service.pid=org.ow2.easybeans.configuration)"

Created: 29/Jul/08 06:26 PM   Updated: 29/Sep/08 03:02 PM
Component/s: OSGi
Affects Version/s: EasyBeans 1.1.0
Fix Version/s: EasyBeans 1.1.0 M1

Environment: Eclipse Equinox 3.4, Red Hat Enterprise Linux 5.2


 Description  « Hide
In the OSGI bundle org.ow2.easybeans.agent, its Activator class org.ow2.easybeans.osgi.agent.Activator looks for a Configuration filtered with "(service.pid=org.ow2.easybeans.configuration)". With the Eclipse Equinox Configuration Admin Service when a Configuration is created with the statement createFactoryConfiguration( "org.ow2.easybeans.configuration", null) the pid is the factoryPid (org.ow2.easybeans.configuration) plus some extra numbers, so the statement listConfigurations("(service.pid=org.ow2.easybeans.configuration)") in this Activator class does not find the Configuration. It would be nice to change this statement to filter on the factoryPid as follows: listConfigurations("(service.factoryPid=org.ow2.easybeans.configuration)"), so that it works with Eclipse Equinox.

 All   Comments   Change History   Related Builds   Subversion Commits      Sort Order:
Simon Kelly - 27/Sep/08 05:11 PM
instead of using createFactoryConfiguration( "org.ow2.easybeans.configuration") you can call getConfiguration( "org.ow2.easybeans.configuration"). This creates a new Configuration if there is no existing service with the same PID.

An example of working code is:

ServiceReference configAdminReference = context
.getServiceReference(ConfigurationAdmin.class.getName());

if (configAdminReference == null)
throw new IllegalStateException(
"The OSGi ConfigAdmin Service is not available.");

Dictionary<String, String> props = new Hashtable<String, String>();
props.put("configuration.content", getXMLContent(context));

ConfigurationAdmin configAdminService = (ConfigurationAdmin) context
.getService(configAdminReference);
Configuration config = configAdminService
.getConfiguration("org.ow2.easybeans.configuration");
config.update(props);

Guillaume Sauthier - 29/Sep/08 11:39 AM
Yep, i guess that Simon is right.

Looking at the OSGI-INF/core-service.xml, you can also see that the core component has not been described has a factory, and that it also exposes a property named service.pid with the o.o.ezb.core value.

I will mark this issue as a "Won't fix", if you're OK with this ekke, please close the bug, or argument more ;)

Guillaume Sauthier - 29/Sep/08 11:40 AM
marked "won't fix" as per last comment

Guillaume Sauthier - 29/Sep/08 11:41 AM
Ooops, replace "Ekke" by "Eric" :)
Apologies

Eric Glass - 29/Sep/08 02:33 PM
Thanks Simon for the correct solution to my issue. I will implement this solution into our application.

Guillaume, I am okay with closing this issue; and no problem with the mis-spelling of my name.


Copyright © 2006-2007 EasyBeans / ObjectWeb consortium

http://www.easybeans.org