Hi it's me again :)
Jut a brief update: I have found the reason why the example bundles do not work!
Take a look at this code in the
org.apache.cxf.dosgi.samples.greeter.impl.rest.Activator class of the
greeter_rest implementation bundle:
public void start(BundleContext bc) throws Exception {
Dictionary props = getProperties("http://localhost:23990/greeter");
...
}
@SuppressWarnings("unchecked")
private Dictionary getProperties(String address) {
Dictionary props = new Hashtable();
props.put("service.exported.interfaces", "*");
props.put("service.exported.configs", "org.apache.cxf.rs");
props.put("service.exported.intents", "HTTP");
props.put("org.apache.cxf.rs.address", address);
props.put("org.apache.cxf.rs.databinding", "aegis");
return props;
}
Well this gives an absolute address/url to my endpoint. I don't know why but
this is the reason I am not getting any RESTful Web Services ....
So I changed the code to just use the "org.apache.cxf.rs.httpservice.context"
property:
public void start(BundleContext bc) throws Exception {
// CHANGE BEGIN
Dictionary props = getProperties("/rest/ws/greeter");
// CHANGE END
...
}
@SuppressWarnings("unchecked")
private Dictionary getProperties(String address) {
Dictionary props = new Hashtable();
props.put("service.exported.interfaces", "*");
props.put("service.exported.configs", "org.apache.cxf.rs");
props.put("service.exported.intents", "HTTP");
// CHANGE BEGIN
props.put("org.apache.cxf.rs.httpservice.context", address);
// CHANGE END
props.put("org.apache.cxf.rs.databinding", "aegis");
return props;
}
Now the greeter and greeter2 both work! :) OH YEAH :)!:)!:)!:)!
Well it is time to test my own OSGI Services. Let's see if those bastards will
work as well :)
Cheers,
George