Hi folks,

I'solved the issue about CXF on OSGi complaining about missing JAXB classes.

In the following, I will describe my solution. Maybe this
is useful for anyone.

At first, there seems to be a difference between Equinox 3.4
and Equinox 3.2.2 causing the problem. Hence, I can verify that
CXF works fine on Equinox 3.2.2.

The setup is as follows:

- Java 1.6.0_11
- Equinox 3.2.2
- Apache CXF 2.1.2 (might work with 2.1.3)

jaxb-api-2.1.jar must be present in lib/endorsed directory of
the Java runtime.

Bundles on OSGi platform:

-------------------- START -------------------------
id      State       Bundle
0       ACTIVE      system.bundle_3.2.2.R32x_v20070118
1       ACTIVE      org.eclipse.equinox.common_3.2.0.v20060603
2       ACTIVE      org.apache.ws.commons.axiom.axiom-api_1.2.7
3       ACTIVE      org.apache.ws.commons.axiom.axiom-impl_1.2.7
4       ACTIVE      org.springframework.osgi.catalina.osgi_5.5.23.SNAPSHOT
5       ACTIVE      org.springframework.osgi.catalina.start.osgi_1.0.0.SNAPSHOT
6       ACTIVE      com.springsource.javax.el_1.0.0
7       ACTIVE      com.springsource.javax.servlet.jsp_2.1.0
8       ACTIVE      com.springsource.javax.xml.stream_1.0.1
9       ACTIVE      com.springsource.org.aopalliance_1.0.0
10      ACTIVE      com.springsource.org.apache.commons.logging_1.1.1
11      RESOLVED    com.springsource.org.apache.xerces_2.8.1
                    Master=13
12      ACTIVE      com.springsource.org.apache.xml.resolver_1.2.0
13      ACTIVE      com.springsource.org.apache.xmlcommons_1.3.3
                    Fragments=11
14      ACTIVE      com.springsource.org.dom4j_1.6.1
15      ACTIVE      com.springsource.org.objectweb.asm_2.2.3
16      ACTIVE      org.apache.cxf.cxf-bundle_2.1.2
17      ACTIVE      CXFTest_0.1.0
18      ACTIVE      org.apache.geronimo.specs.geronimo-activation_1.1_spec_1.0.2
19      ACTIVE      org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
20      ACTIVE      org.apache.geronimo.specs.geronimo-javamail_1.4_spec_1.3.0
21      ACTIVE      org.apache.geronimo.specs.geronimo-jaxws_2.1_spec_1.0.0
22      ACTIVE      org.apache.geronimo.specs.geronimo-servlet_2.5_spec_1.2.0
23      ACTIVE      org.apache.geronimo.specs.geronimo-stax-api_1.0_spec_1.0.1
24      ACTIVE      
org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec_1.1.2
25      ACTIVE      org.springframework.osgi.jasper.osgi_5.5.23.SNAPSHOT
26      ACTIVE      org.springframework.osgi.jsp-api.osgi_2.0.0.SNAPSHOT
27      ACTIVE      org.springframework.osgi.jstl.osgi_1.1.2.SNAPSHOT
28      ACTIVE      org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHOT
                    Fragments=52
29      ACTIVE      org.apache.neethi_2.0.4
30      ACTIVE      org.apache.servicemix.bundles.jaxb-impl_2.1.6.1
31      ACTIVE      org.apache.servicemix.bundles.wsdl4j_1.6.1.1
32      ACTIVE      org.apache.servicemix.bundles.xmlresolver_1.2.0.1
33      ACTIVE      org.apache.servicemix.specs.jaxb-api-2.1_1.0.0
34      ACTIVE      org.apache.servicemix.specs.saaj-api-1.3_1.1.0
35      ACTIVE      org.eclipse.equinox.device_1.0.0.v20060601a
36      ACTIVE      org.eclipse.equinox.event_1.0.0.v20060601a
37      ACTIVE      org.eclipse.equinox.http_1.0.2.R32x_v20061218
38      ACTIVE      org.eclipse.equinox.log_1.0.1.R32x_v20060717
39      ACTIVE      org.eclipse.equinox.metatype_1.0.0.v20060601a
40      ACTIVE      org.eclipse.equinox.preferences_3.2.1.R32x_v20060717
41      ACTIVE      org.eclipse.equinox.registry_3.2.1.R32x_v20060814
42      ACTIVE      org.eclipse.equinox.servlet.api_1.0.0.v20060601
43      ACTIVE      org.eclipse.equinox.useradmin_1.0.0.v20060601a
44      ACTIVE      org.eclipse.osgi.services_3.1.100.v20060601
45      ACTIVE      org.eclipse.osgi.util_3.1.100.v20060601
47      ACTIVE      org.springframework.aop_2.5.5.A
48      ACTIVE      org.springframework.beans_2.5.5.A
49      ACTIVE      org.springframework.context_2.5.5.A
50      ACTIVE      org.springframework.context.support_2.5.5.A
51      ACTIVE      org.springframework.core_2.5.5.A
52      RESOLVED    org.springframework.osgi.log4j.config_1.0.0
                    Master=28
53      ACTIVE      org.springframework.web_2.5.5.A
54      ACTIVE      org.springframework.web.servlet_2.5.5.A
55      ACTIVE      org.springframework.bundle.spring.context.support_2.5.5
56      ACTIVE      org.springframework.bundle.osgi.extensions.annotations_1.1.0
57      ACTIVE      org.springframework.bundle.osgi.core_1.1.0
58      ACTIVE      org.springframework.bundle.osgi.extender_1.1.0
59      ACTIVE      org.springframework.bundle.osgi.io_1.1.0
60      ACTIVE      org.springframework.bundle.osgi.web_1.1.0
61      ACTIVE      org.springframework.bundle.osgi.web.extender_1.1.0
62      ACTIVE      org.apache.ws.commons.schema_1.4.2
------------------------ END --------------------------------

This is a minimal configuration that works for me. Of course you have
to add additional libraries if you want to use e.g. WS-Security.

My MANIFEST.MF reads as follows:

-------------------------- START ------------------------------

Manifest-Version: 1.0
Built-By: fdankof
Tool: Bnd-0.0.238
Bundle-Name: Spring OSGi Bundle
Created-By: Apache Maven Bundle Plugin
Build-Jdk: 1.6.0_03
Bundle-Version: 0.1
Bnd-LastModified: 1231854281167
Bundle-ManifestVersion: 2
Bundle-Classpath: ., /WEB-INF/classes
Import-Package: com.sun.xml.bind.v2,
 javax.servlet.http;version="2.5.0",
 javax.servlet.jsp;version="2.1.0",
 javax.servlet.jsp.jstl.core;version="1.1.2",
 javax.servlet.jsp.jstl.fmt;version="1.1.2",
 javax.servlet.jsp.jstl.tlv;version="1.1.2",
 javax.wsdl;version="1.2.0",
 org.aopalliance.aop;version="1.0.0",
 org.springframework.aop;version="2.5.5.A",
 org.springframework.aop.framework;version="2.5.5.A",
 org.springframework.aop.scope;version="2.5.5.A",
 org.springframework.beans.factory.config;version="2.5.5.A",
 org.springframework.osgi.web.context.support;version="1.1.0",
 org.springframework.stereotype;version="2.5.5.A",
 org.springframework.web.bind.annotation;version="2.5.5.A",
 org.springframework.web.context;version="2.5.5.A",
 org.springframework.web.context.request;version="2.5.5.A",
 org.springframework.web.servlet;version="2.5.5.A",
 org.springframework.web.servlet.view;version="2.5.5.A"
Bundle-SymbolicName: CXFTest
Require-Bundle: org.apache.cxf.cxf-bundle;bundle-version="2.1.2"

------------------------ STOP -------------------------------

And that's it. I'm not exactly sure about what's the problem
with Equinox 3.4. If anybody has more information on that, please
clarify.

Cheers,

Fabian

 


Reply via email to