cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CXF-5175) ?_wadl generates a ClassCastException
Date Wed, 14 Aug 2013 14:44:47 GMT

     [ https://issues.apache.org/jira/browse/CXF-5175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Beryozkin resolved CXF-5175.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.7.7
                   2.6.10
                   3.0.0
    Reproduced In: 2.7.6, 2.7.5  (was: 2.7.5, 2.7.6)
         Assignee: Sergey Beryozkin

Fixed as part of https://issues.apache.org/jira/browse/CXF-5204
                
> ?_wadl generates a ClassCastException
> -------------------------------------
>
>                 Key: CXF-5175
>                 URL: https://issues.apache.org/jira/browse/CXF-5175
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.5, 2.7.6
>         Environment: Tomcat 7.0.23, Spring 3.1.1 Java 1.6, OSX 10.8.4 (Darwin Kernel
Version 12.4.0, root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64)
>            Reporter: Jeff Haynes
>            Assignee: Sergey Beryozkin
>             Fix For: 3.0.0, 2.6.10, 2.7.7
>
>
> When using the WadlGenerator via "?_wadl", a ClassCastException is caused. Here is the
stack trace:
> org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver 115 - Error occurred during
error handling, give up!
> org.apache.cxf.interceptor.Fault: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
cannot be cast to java.lang.Class
> 	at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:76)
~[cxf-api-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:331)
[cxf-api-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
[cxf-api-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
[cxf-rt-transports-http-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
[cxf-rt-transports-http-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203)
[cxf-rt-transports-http-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
[cxf-rt-transports-http-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:159)
[cxf-rt-transports-http-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)
[cxf-rt-transports-http-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:211)
[cxf-rt-transports-http-2.7.6.jar:2.7.6]
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) [servlet-api.jar:na]
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)
[cxf-rt-transports-http-2.7.6.jar:2.7.6]
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
[catalina.jar:7.0.23]
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[catalina.jar:7.0.23]
> 	at com.transverse.bleep.api.TractApiServletFilter.doFilter(TractApiServletFilter.java:93)
[classes/:na]
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[catalina.jar:7.0.23]
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[catalina.jar:7.0.23]
> 	at com.transverse.bleep.servlet.filter.MDCUserFilter.doFilter(MDCUserFilter.java:79)
[classes/:na]
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[catalina.jar:7.0.23]
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[catalina.jar:7.0.23]
> 	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:167)
[spring-security-web-3.1.0.RELEASE.jar:3.1.0.RELEASE]
> 	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
[spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
> 	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
[spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[catalina.jar:7.0.23]
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[catalina.jar:7.0.23]
> 	at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147)
[spring-orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
> 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
[spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[catalina.jar:7.0.23]
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[catalina.jar:7.0.23]
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
[catalina.jar:7.0.23]
> 	at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:169)
[catalina.jar:7.0.23]
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java) [catalina.jar:7.0.23]
> 	at org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:168) [catalina.jar:7.0.23]
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java) [catalina.jar:7.0.23]
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) [catalina.jar:7.0.23]
> 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928) [catalina.jar:7.0.23]
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
[catalina.jar:7.0.23]
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) [catalina.jar:7.0.23]
> 	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
[tomcat-coyote.jar:7.0.23]
> 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
[tomcat-coyote.jar:7.0.23]
> 	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
[tomcat-coyote.jar:7.0.23]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
[na:1.6.0_51]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [na:1.6.0_51]
> 	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_51]
> Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
cannot be cast to java.lang.Class
> 	at org.apache.cxf.jaxrs.utils.InjectionUtils.getActualType(InjectionUtils.java:226)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.utils.InjectionUtils.getActualType(InjectionUtils.java:231)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.utils.InjectionUtils.getActualType(InjectionUtils.java:204)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.utils.ResourceUtils.checkJaxbType(ResourceUtils.java:600) ~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.utils.ResourceUtils.getAllTypesForResource(ResourceUtils.java:543)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.utils.ResourceUtils.getAllRequestResponseTypes(ResourceUtils.java:515)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.model.wadl.WadlGenerator.handleRequest(WadlGenerator.java:218)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.impl.RequestPreprocessor.handleMetadataRequest(RequestPreprocessor.java:216)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.impl.RequestPreprocessor.checkMetadataRequest(RequestPreprocessor.java:200)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.impl.RequestPreprocessor.preprocess(RequestPreprocessor.java:84)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:117)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:101)
~[cxf-rt-frontend-jaxrs-2.7.6.jar:2.7.6]
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
[cxf-api-2.7.6.jar:2.7.6]
> This is caused by a construct in our code like the following:
> @XmlElement(name="orderItems",required=true)
> protected OrderItemsDTO<? extends OrderItemDTO<? extends OrderItem>> orderItems;
> The problem seems to be that the class needs to recurse again in InjectionUtils#getActualType().
When I set a breakpoint and made the call manually, the problem did not occur.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message