Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 60597 invoked from network); 11 Nov 2010 18:56:50 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Nov 2010 18:56:50 -0000 Received: (qmail 41179 invoked by uid 500); 11 Nov 2010 18:57:21 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 41067 invoked by uid 500); 11 Nov 2010 18:57:21 -0000 Mailing-List: contact commits-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 commits@cxf.apache.org Received: (qmail 41060 invoked by uid 99); 11 Nov 2010 18:57:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 18:57:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 18:57:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2DD6B23889E3; Thu, 11 Nov 2010 18:56:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1034047 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties Date: Thu, 11 Nov 2010 18:56:07 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101111185607.2DD6B23889E3@eris.apache.org> Author: sergeyb Date: Thu Nov 11 18:56:06 2010 New Revision: 1034047 URL: http://svn.apache.org/viewvc?rev=1034047&view=rev Log: Merged revisions 1034045 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.3.x-fixes ................ r1034045 | sergeyb | 2010-11-11 18:53:20 +0000 (Thu, 11 Nov 2010) | 9 lines Merged revisions 1034035 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1034035 | sergeyb | 2010-11-11 18:44:12 +0000 (Thu, 11 Nov 2010) | 1 line Making sure no servlet api is strictly required on the client side ........ ................ Modified: cxf/branches/2.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Nov 11 18:56:06 2010 @@ -1,2 +1,2 @@ -/cxf/branches/2.3.x-fixes:1027513,1027608,1030055,1030193 -/cxf/trunk:1027509,1027599,1030053,1030189 +/cxf/branches/2.3.x-fixes:1027513,1027608,1030055,1030193,1034045 +/cxf/trunk:1027509,1027599,1030053,1030189,1034035 Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java?rev=1034047&r1=1034046&r2=1034047&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java (original) +++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java Thu Nov 11 18:56:06 2010 @@ -22,7 +22,9 @@ package org.apache.cxf.jaxrs.utils; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.HashSet; +import java.util.ResourceBundle; import java.util.Set; +import java.util.logging.Logger; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; @@ -47,10 +49,15 @@ import javax.ws.rs.core.UriInfo; import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Providers; +import org.apache.cxf.common.i18n.BundleUtils; +import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.jaxrs.ext.MessageContext; public final class AnnotationUtils { + private static final Logger LOG = LogUtils.getL7dLogger(AnnotationUtils.class); + private static final ResourceBundle BUNDLE = BundleUtils.getBundle(AnnotationUtils.class); + private static final Set CONTEXT_CLASSES; private static final Set PARAM_ANNOTATION_CLASSES; private static final Set METHOD_ANNOTATION_CLASSES; @@ -73,10 +80,19 @@ public final class AnnotationUtils { classes.add(ContextResolver.class); classes.add(Providers.class); classes.add(Request.class); - classes.add(HttpServletRequest.class); - classes.add(HttpServletResponse.class); - classes.add(ServletConfig.class); - classes.add(ServletContext.class); + // Servlet API + try { + classes.add(HttpServletRequest.class); + classes.add(HttpServletResponse.class); + classes.add(ServletConfig.class); + classes.add(ServletContext.class); + } catch (Exception ex) { + // it is not a problem on the client side and the exception will be + // thrown later on if the injection of one of these contexts will be + // attempted on the server side + LOG.fine(new org.apache.cxf.common.i18n.Message("NO_SERVLET_API", + BUNDLE).toString()); + } // CXF-specific classes.add(MessageContext.class); return classes; Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties?rev=1034047&r1=1034046&r2=1034047&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties (original) +++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties Thu Nov 11 18:56:06 2010 @@ -18,6 +18,7 @@ # under the License. # # +NO_SERVLET_API=No Java Servlet API is available on the runtime classpath NO_RESOURCE_OP_EXC=No resource methods have been found for resource class {0} GET_INSTEAD_OF_HEAD=Resource class {0} does not support HEAD http method, method {1} supporting GET http method will be invoked NO_CONTENT_TYPE_SPECIFIED=No Content-Type specified for HTTP {0}