Question

I've installed Apache Karaf 2.3.0. One of my bundles that needs to be installed in it uses classes from javax.servlet.http package. When I try to install the bundle it gives me the error message:

karaf@root> ERROR: Bundle com.groupgti.esb.purge [207] Error starting mvn:com.groupgti.esb/esb.purge/1.0.0 (org.osgi.framework.BundleException: Unresolved constraint in b
undle com.groupgti.esb.purge [207]: Unable to resolve 207.0: missing requirement [207.0] osgi.wiring.package; (osgi.wiring.package=com.groupgti.esb.cxf.interceptors) [cau
sed by: Unable to resolve 212.0: missing requirement [212.0] osgi.wiring.package; (&(osgi.wiring.package=javax.servlet.http)(version>=2.6.0)(!(version>=3.0.0)))])
org.osgi.framework.BundleException: Unresolved constraint in bundle com.groupgti.esb.purge [207]: Unable to resolve 207.0: missing requirement [207.0] osgi.wiring.package
; (osgi.wiring.package=com.groupgti.esb.cxf.interceptors) [caused by: Unable to resolve 212.0: missing requirement [212.0] osgi.wiring.package; (&(osgi.wiring.package=jav
ax.servlet.http)(version>=2.6.0)(!(version>=3.0.0)))]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
        at java.lang.Thread.run(Thread.java:662)

javax.servlet.http package is exported from: mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.1.2 system bundle. The problem is that its version is 2.5 but and my bundle requires at least 2.6.0. Is there a workaround or something to update the geronimo-servlet to the higher version that would be compatible with my bundle? (This is the system bundle).

Additional information:

CXF Version: 2.7.0
Camel Version 2.10.2

EDIT:

I forgot to mention the important thing. I also updated CXF to 2.7.0 version and CXF is the one which is introducing the dependency of Servlet 3.0. This is the graph from dependency tree:

enter image description here

Maybe will give you some idea on how get around this? The only thing that I could think of is to go back to CXF 2.6.x.

Was it helpful?

Solution

If your bundle really needs something newer than 2.5, you may have problems running it on Karaf 2.3.0. Karaf 2.3 uses Jetty 7.6.7 which is based on Servlet 2.5. It doesn't support any of the newer Servlet 3 based API's and such. You can upgrade the servlet-api bundle and it MAY work, but if your bundle/app uses any of the Servlet 3 functionality, it will likely not work.

Karaf 3 will be upgrading to Jetty 8.1 which does support the Servlet 3 stuff. Any help testing that and getting that out would be greatly appreciated by the Karaf community. :-)

OTHER TIPS

Do you really need to use geronimo servlet spec ? Try replacing it with this:

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
    </dependency>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top