mebigfatguy
Apr 29th, 2008, 08:40 PM
Howdy, I am trying to get cxf working under osgi activated by spring-dm.
When not using osgi, cxf loads a SpringBusFactory to gather factories for various url namespaces which works fine. Under osgi it fails to do this and instead loads the default CXFBusFactory. The reason for the difference is that the cxf code attempts to load a file from the cxf jar file and fails. It uses this code, in cxf's
BusFactory.getBusFactoryClass
specifically:
String serviceId = "META-INF/services/" + BusFactory.BUS_FACTORY_PROPERTY_NAME;
InputStream is = null;
if (classLoader == null) {
classLoader = Thread.currentThread().getContextClassLoader();
}
if (classLoader == null) {
is = ClassLoader.getSystemResourceAsStream(serviceId);
} else {
is = classLoader.getResourceAsStream(serviceId);
}
if (is != null) {
BufferedReader rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
busFactoryClass = rd.readLine();
busFactoryCondition = rd.readLine();
rd.close();
}
and is is null. In both cases it uses the code path using
getResourceAsStream
I tried adding META-INF.services to the Export-Packages but that did nothing. Is there anything i can do here?
When not using osgi, cxf loads a SpringBusFactory to gather factories for various url namespaces which works fine. Under osgi it fails to do this and instead loads the default CXFBusFactory. The reason for the difference is that the cxf code attempts to load a file from the cxf jar file and fails. It uses this code, in cxf's
BusFactory.getBusFactoryClass
specifically:
String serviceId = "META-INF/services/" + BusFactory.BUS_FACTORY_PROPERTY_NAME;
InputStream is = null;
if (classLoader == null) {
classLoader = Thread.currentThread().getContextClassLoader();
}
if (classLoader == null) {
is = ClassLoader.getSystemResourceAsStream(serviceId);
} else {
is = classLoader.getResourceAsStream(serviceId);
}
if (is != null) {
BufferedReader rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
busFactoryClass = rd.readLine();
busFactoryCondition = rd.readLine();
rd.close();
}
and is is null. In both cases it uses the code path using
getResourceAsStream
I tried adding META-INF.services to the Export-Packages but that did nothing. Is there anything i can do here?