It seems I had not included cxf-bundle-minimal-2.2.4 in the
Require-Bundle. The problem is now that as soon as I try to add it the
project does not compile anymore as eclipse empties the
Plugin-Dependencies. I found that this always happens when some
constrained is not met. The problem is I have no idea what is going
wrong. I have copied all the plugins from dosgi into the plugins folder.
I also had an interesting problem with spring. In my eclipse there was a
version 2.5.6A of the spring jars before I copied the plugins from
dosgi. Can this have to do with the problem?
Greetings
Christian
Here is my Manifest in case that helps:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CustomerDB
Bundle-SymbolicName: CustomerDB; singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: customerdb.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.databinding,
org.eclipse.core.databinding.beans,
org.eclipse.core.databinding.observable,
org.eclipse.core.databinding.property,
org.eclipse.jface.databinding,
com.ibm.icu,
org.springframework.core;bundle-version="2.5.6",
org.springframework.context;bundle-version="2.5.6",
org.springframework.osgi.core;bundle-version="1.2.0",
org.springframework.osgi.extender;bundle-version="1.2.0",
org.springframework.osgi.io;bundle-version="1.2.0",
org.springframework.beans;bundle-version="2.5.6",
org.apache.cxf.bundle-minimal;bundle-version="2.2.4"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: com.example.customerservice;
uses:="javax.xml.bind,
javax.xml.ws,
javax.xml.namespace,
javax.xml.datatype",
customerdb,
customerdb.model
Bundle-ClassPath: .,
target/classes/,
src/main/resources/
Christian Schneider schrieb:
I partially got cxf working in Eclipse RCP. I used the bundles from
the dosgi distribution and defined the necessary ones as required
bundles.
My project compiles all right.
In the Activator class I got thecod below. When starting the App the
client-applicationContext.xml is loaded but then it can“t find the
cxf.xml. I guess the resource is not visible. Any idea how I make it
available?
Greetings
Christian
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
OsgiBundleXmlApplicationContext ccontext = new
OsgiBundleXmlApplicationContext(
new String[] {
"classpath:client-applicationContext.xml" });
ccontext.setBundleContext(context);
ccontext.refresh();
CustomerService client = (CustomerService)
ccontext.getBean("customerService");
List<Customer> resp = client.getCustomersByName("name");
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:customer="http://customerservice.example.com/"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<jaxws:client id="customerService"
serviceName="customer:CustomerServiceService"
endpointName="customer:CustomerServiceEndpoint"
address="http://localhost:9090/CustomerServicePort"
serviceClass="com.example.customerservice.CustomerService">
</jaxws:client>
</beans>
Sergey Beryozkin schrieb:
Hi
You might want to have a look at the DOSGi RI multi-bundle
distribution...
Probably the only two bundles included in that distruibution which
CXF does not depend upon are CXF DSW (DOSGi distribution software
component) plus a Zoo-Keeper based Discovery bundle. All other
bundles are osgi-fied jars which are needed to resolve CXF
bundle dependencies. Not sure if it can help, but may be you can just
use those bundles in your project ...
cheers, Sergey
Thanks already for the many pointers. This seems quite time
consuming though. I guess the main problem is that the cxf jars
define many dependencies that are not osgi enabled. So if I
understand this correctly I have to configure all dependencies by
hand and exclude all the current non-osgi dependencies. Though I
understand that changing this situation is not really easy.
As I had no success till now I will try to simply embed the non osgi
cxf in a service client bundle and re export my service as an osgi
service. So at least my GUI project will not have to embed all the
non osgi jars. This solution is far from optimal but I think easier
to acomplish than the above.
Greetings
Christian
--
Christian Schneider
---
http://www.liquid-reality.de
--
Christian Schneider
---
http://www.liquid-reality.de