Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0258A9196 for ; Tue, 6 Dec 2011 09:58:05 +0000 (UTC) Received: (qmail 89381 invoked by uid 500); 6 Dec 2011 09:58:04 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 89360 invoked by uid 500); 6 Dec 2011 09:58:04 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 89343 invoked by uid 99); 6 Dec 2011 09:58:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2011 09:58:04 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2011 09:58:01 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 3F6B8CA88C for ; Tue, 6 Dec 2011 09:57:40 +0000 (UTC) Date: Tue, 6 Dec 2011 09:57:40 +0000 (UTC) From: "metatech (Updated) (JIRA)" To: issues@cxf.apache.org Message-ID: <603332066.44967.1323165460261.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1309082851.35043.1322837740019.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CXF-3949) NoClassDefFoundError when using CXF JAX-RS in OSGi environment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-3949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] metatech updated CXF-3949: -------------------------- Description: When using the CXF JAX-RS implementation in an OSGi environment, the CXF implementation might fail to initialize properly. The problem is non-consistently reproduceable, but more likely to occur on machines with high parallelism (due to several cores/threads). The CXF bundle ("org.apache.cxf.bundle") has a dependency on the JSR 311 API JAR ("org.apache.servicemix.specs.jsr311-api-1.1"). But the dependency is marked as "resolution=optional" in the OSGi headers of the CXF bundle manifest. As a result, if the JSR-311 bundle is not yet fully started when the CXF bundle is started, OSGi does not "wire" these packages into the imports of the CXF bundle: javax.ws.rs javax.ws.rs.core javax.ws.rs.ext The error is the following : java.lang.NoClassDefFoundError: Could not initialize class org.apache.cxf.jaxrs.utils.JAXRSUtils See similar error DOSGI-1 I guess that these packages are marked as optional because CXF can be used in an environment where no JAX-RS is available, and it works fine as long as the application does not use this API. However, when an application is known to use the API, the dependency marked as "optional" is not correct. Long-term solution : split CXF bundle into smaller bundles (like Jetty). Workaround : edit the manifest of the CXF bundle, and remove the "resolution=optional" for the packages which are known to be used by the application. Tip : replace "resolution" by "resolutio2", this tricks prevents from changing the alignment of the 80-characters columns. was: When using the CXF JAX-RS implementation in an OSGi environment, the CXF implementation might fail to initialize properly. The problem is non-consistently reproduceable, but more likely to occur on machines with high parallelism (due to several cores/threads). The CXF bundle ("org.apache.cxf.bundle") has a dependency on the JSR 311 API JAR ("org.apache.servicemix.specs.jsr311-api-1.1"). But the dependency is marked as "resolution=optional" in the OSGi headers of the CXF bundle manifest. As a result, if the JSR-311 bundle is not yet fully started when the CXF bundle is started, OSGi does not "wire" these packages into the imports of the CXF bundle: javax.ws.rs javax.ws.rs.core javax.ws.rs.ext The error is the following : java.lang.NoClassDefFoundError: Could not initialize class org.apache.cxf.jaxrs.utils.JAXRSUtils See similar error DOSGI-1 I guess that these packages are marked as optional because CXF can be used in an environment where no JAX-RS is available, and it works fine as long as the application does not use this API. However, when an application is known to use the API, the dependency marked as "optional" is not correct. Long-term solution : split CXF bundle into smaller bundles (like Jetty). Workaround : edit the manifest of the CXF bundle, and remove the "resolution=optional" for the packages which are known to be used by the application. > NoClassDefFoundError when using CXF JAX-RS in OSGi environment > -------------------------------------------------------------- > > Key: CXF-3949 > URL: https://issues.apache.org/jira/browse/CXF-3949 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.3.2 > Environment: ServiceMix 4.3 > Reporter: metatech > Original Estimate: 8h > Remaining Estimate: 8h > > When using the CXF JAX-RS implementation in an OSGi environment, the CXF implementation might fail to initialize properly. > The problem is non-consistently reproduceable, but more likely to occur on machines with high parallelism (due to several cores/threads). > The CXF bundle ("org.apache.cxf.bundle") has a dependency on the JSR 311 API JAR ("org.apache.servicemix.specs.jsr311-api-1.1"). > But the dependency is marked as "resolution=optional" in the OSGi headers of the CXF bundle manifest. > As a result, if the JSR-311 bundle is not yet fully started when the CXF bundle is started, OSGi does not "wire" these packages into the imports of the CXF bundle: > javax.ws.rs > javax.ws.rs.core > javax.ws.rs.ext > The error is the following : > java.lang.NoClassDefFoundError: Could not initialize class org.apache.cxf.jaxrs.utils.JAXRSUtils > See similar error DOSGI-1 > I guess that these packages are marked as optional because CXF can be used in an environment where no JAX-RS is available, and it works fine as long as the application does not use this API. However, when an application is known to use the API, the dependency marked as "optional" is not correct. > Long-term solution : split CXF bundle into smaller bundles (like Jetty). > Workaround : edit the manifest of the CXF bundle, and remove the "resolution=optional" for the packages which are known to be used by the application. Tip : replace "resolution" by "resolutio2", this tricks prevents from changing the alignment of the 80-characters columns. > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira