cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cyrille Le Clerc (JIRA)" <j...@apache.org>
Subject [jira] Created: (CXF-2556) UnsupportedOperationException in WadlGenerator
Date Mon, 23 Nov 2009 11:09:39 GMT
UnsupportedOperationException in WadlGenerator
----------------------------------------------

                 Key: CXF-2556
                 URL: https://issues.apache.org/jira/browse/CXF-2556
             Project: CXF
          Issue Type: Bug
            Reporter: Cyrille Le Clerc


UnsupportedOperationException when displaying the WADL.
STACKTRACE
===========
{noformat}
java.lang.UnsupportedOperationException
	java.util.AbstractCollection.add(AbstractCollection.java:221)
	java.util.AbstractCollection.addAll(AbstractCollection.java:305)
	org.apache.cxf.jaxb.JAXBUtils.scanPackages(JAXBUtils.java:811)
	org.apache.cxf.jaxrs.model.wadl.WadlGenerator.createJaxbContext(WadlGenerator.java:498)
	org.apache.cxf.jaxrs.model.wadl.WadlGenerator.handleRequest(WadlGenerator.java:123)
	org.apache.cxf.jaxrs.impl.RequestPreprocessor.checkMetadataRequest(RequestPreprocessor.java:164)
	org.apache.cxf.jaxrs.impl.RequestPreprocessor.preprocess(RequestPreprocessor.java:74)
	org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:87)
	org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:63)
	org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
	org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
	org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98)
	org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:394)
	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:170)
	org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142)
	org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
	org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:108)
{noformat}

CAUSE
======
{code:title=WadlGenerator.java}
public class WadlGenerator implements RequestHandler {
    
    public Response handleRequest(Message m, ClassResourceInfo resource) {
         ...
        Set<Class<?>> jaxbTypes = ResourceUtils.getAllRequestResponseTypes(cris,
true).keySet(); <=== returned Set is readonly !
        JAXBContext context = createJaxbContext(jaxbTypes);   <=== createJaxbContext will
try to add entries in the given Set()
    }
{code}


PROPOSED FIX
=============
* in createJaxbContext(), create a HashSet() initialized with the initial jaxbTypes
* add javadoc on JAXBUtils.scanPackages(classes, objectFactoryCache) to explain the given
classes Set will be modified



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message