Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 57760 invoked from network); 22 Mar 2010 13:09:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Mar 2010 13:09:48 -0000 Received: (qmail 56995 invoked by uid 500); 22 Mar 2010 13:09:48 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 56972 invoked by uid 500); 22 Mar 2010 13:09:48 -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 56964 invoked by uid 99); 22 Mar 2010 13:09:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 13:09:48 +0000 X-ASF-Spam-Status: No, hits=-1090.9 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 13:09:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 457C0234C1F2 for ; Mon, 22 Mar 2010 13:09:27 +0000 (UTC) Message-ID: <1567819556.402691269263367283.JavaMail.jira@brutus.apache.org> Date: Mon, 22 Mar 2010 13:09:27 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Subject: [jira] Commented: (CXF-2726) UnsupportedOperationException in WadlGenerator.handleRequest In-Reply-To: <2010004348.402651269263127242.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-2726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848117#action_12848117 ] Sergey Beryozkin commented on CXF-2726: --------------------------------------- It was an unfortunate bug indeed, fixed in 2.2.6, please see https://issues.apache.org/jira/browse/CXF-2556 > UnsupportedOperationException in WadlGenerator.handleRequest > ------------------------------------------------------------ > > Key: CXF-2726 > URL: https://issues.apache.org/jira/browse/CXF-2726 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.2.5 > Environment: CXF 2.2.5 > on Suse 10 (I think) > oracle@altweb01:~> uname -s > Linux > oracle@altweb01:~> uname -r > 2.6.5-7.244-smp > oracle@altweb01:~> uname -i > x86_64 > oracle@altweb01:~> uname -o > GNU/Linux > Reporter: Einar Valen > Priority: Minor > > UnsupportedOperationException in WadlGenerator.handleRequest > Stack trace: > Caused by: java.lang.UnsupportedOperationException > at java.util.AbstractCollection.add(AbstractCollection.java:221) > at java.util.AbstractCollection.addAll(AbstractCollection.java:305) > at org.apache.cxf.jaxb.JAXBUtils.scanPackages(JAXBUtils.java:811) > at org.apache.cxf.jaxrs.model.wadl.WadlGenerator.createJaxbContext(WadlGenerator.java:498) > at org.apache.cxf.jaxrs.model.wadl.WadlGenerator.handleRequest(WadlGenerator.java:123) > at org.apache.cxf.jaxrs.impl.RequestPreprocessor.checkMetadataRequest(RequestPreprocessor.java:164) > at org.apache.cxf.jaxrs.impl.RequestPreprocessor.preprocess(RequestPreprocessor.java:74) > at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:87) > at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:63) > at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) > Looking at the sources reveals this: > org.apache.cxf.jaxrs.model.wadl.WadlGenerator.handleRequest(WadlGenerator.java:123) > > public Response handleRequest(Message m, ClassResourceInfo resource) { > ... > Set> jaxbTypes = ResourceUtils.getAllRequestResponseTypes(cris, true).keySet(); > JAXBContext context = createJaxbContext(jaxbTypes); > ... > } > > at org.apache.cxf.jaxrs.model.wadl.WadlGenerator.createJaxbContext(WadlGenerator.java:498) > > private JAXBContext createJaxbContext(Set> classes) { > UnsupportedOperationException in WadlGenerator.handleRequest ... > JAXBUtils.scanPackages(classes, null); > ... > } > at org.apache.cxf.jaxb.JAXBUtils.scanPackages(JAXBUtils.java:811) > > public static void scanPackages(Set> classes, Map objectFactoryCache) { > ... > classes.addAll(objectFactories); > ... > } > > > The classes variable passed to scanPackages appears to be immutable, and eventually fails with an UnsupportedOperationException. > A quick suggestion to a fix: > Modify the line in WadlGenerator.handleRequest() that reads > Set> jaxbTypes = ResourceUtils.getAllRequestResponseTypes(cris, true).keySet(); > to > Set> jaxbTypes = new HashSet( ResourceUtils.getAllRequestResponseTypes(cris, true).keySet() ); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.