New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType #146

Closed
gedhi opened this Issue Sep 23, 2015 · 13 comments

Comments

Projects
None yet
10 participants
@gedhi

gedhi commented Sep 23, 2015

It happens when you have an object-field that is specialized with generics.
For example:

@ApiObject(group="foo")
public class FooPojo {
@ApiObjectField
private K fooField;
...
}

Same problem with collections and maps.

ASAP will release the HotFix.

Regards

@fabiomaffioletti fabiomaffioletti added this to the 1.2.5 milestone Sep 24, 2015

@smcgregor83

This comment has been minimized.

Show comment
Hide comment
@smcgregor83

smcgregor83 Oct 2, 2015

This defect appears to have regressed as of version 1.2.8. This can be worked around by rolling back to version 1.2.7.

smcgregor83 commented Oct 2, 2015

This defect appears to have regressed as of version 1.2.8. This can be worked around by rolling back to version 1.2.7.

@fabiomaffioletti

This comment has been minimized.

Show comment
Hide comment
@fabiomaffioletti

fabiomaffioletti Oct 2, 2015

Owner

Thank you. Would you be able to provide the object that generates the
exception?
Il 02/ott/2015 22:55, "smcgregor83" notifications@github.com ha scritto:

This defect appears to have regressed as of version 1.2.8. This can be
worked around by rolling back to version 1.2.7.


Reply to this email directly or view it on GitHub
#146 (comment)
.

Owner

fabiomaffioletti commented Oct 2, 2015

Thank you. Would you be able to provide the object that generates the
exception?
Il 02/ott/2015 22:55, "smcgregor83" notifications@github.com ha scritto:

This defect appears to have regressed as of version 1.2.8. This can be
worked around by rolling back to version 1.2.7.


Reply to this email directly or view it on GitHub
#146 (comment)
.

@smcgregor83

This comment has been minimized.

Show comment
Hide comment
@smcgregor83

smcgregor83 Oct 2, 2015

Yes certainly. It is the org.springframework.hateoas.Resources class that is causing problems.

smcgregor83 commented Oct 2, 2015

Yes certainly. It is the org.springframework.hateoas.Resources class that is causing problems.

@fabiomaffioletti

This comment has been minimized.

Show comment
Hide comment
@fabiomaffioletti

fabiomaffioletti Oct 3, 2015

Owner

Hopefully with the fix I just released this will be solved... version 1.2.9 will be synched in a few hours on maven central.

Owner

fabiomaffioletti commented Oct 3, 2015

Hopefully with the fix I just released this will be solved... version 1.2.9 will be synched in a few hours on maven central.

@smcgregor83

This comment has been minimized.

Show comment
Hide comment
@smcgregor83

smcgregor83 Oct 4, 2015

Yep that seems to have done the trick. Nice turnaround!

smcgregor83 commented Oct 4, 2015

Yep that seems to have done the trick. Nice turnaround!

piccarsa pushed a commit to gedhi/jsondoc that referenced this issue Nov 3, 2015

@vk77

This comment has been minimized.

Show comment
Hide comment
@vk77

vk77 Nov 4, 2015

I'm getting same exception on both 1.2.9 and 1.2.7 versions.
That's the controllers configuration:

@RestController
@RequestMapping("/some/path")
public class MyController
    extends AbstractMyController<MyType> {

}
public abstract class AbstractMyController<ET extends AbstractMyType> {
...
}

public class MyType extends AbstractMyType{
...
}

There is a stacktrace:

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:127)
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:104)
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:127)
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.jsondocObjects(AbstractSpringJSONDocScanner.java:145)
    at org.jsondoc.core.scanner.AbstractJSONDocScanner.getJSONDoc(AbstractJSONDocScanner.java:96)
    at org.jsondoc.springmvc.controller.JSONDocController.getApi(JSONDocController.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
...

Should the issue be re-opened?

Thanks.

vk77 commented Nov 4, 2015

I'm getting same exception on both 1.2.9 and 1.2.7 versions.
That's the controllers configuration:

@RestController
@RequestMapping("/some/path")
public class MyController
    extends AbstractMyController<MyType> {

}
public abstract class AbstractMyController<ET extends AbstractMyType> {
...
}

public class MyType extends AbstractMyType{
...
}

There is a stacktrace:

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:127)
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:104)
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:127)
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.jsondocObjects(AbstractSpringJSONDocScanner.java:145)
    at org.jsondoc.core.scanner.AbstractJSONDocScanner.getJSONDoc(AbstractJSONDocScanner.java:96)
    at org.jsondoc.springmvc.controller.JSONDocController.getApi(JSONDocController.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
...

Should the issue be re-opened?

Thanks.

@piccarsa

This comment has been minimized.

Show comment
Hide comment
@piccarsa

piccarsa Nov 4, 2015

Contributor

This commit should fix the problem that happens when one of the "candidate" objects is an istance of TypeVariable.

#166

You face this problem also when the return object of a method annotated with @RequestMapping is an instance of java.lang.reflect.TypeVariable . I leave here an example:

@ApiMethod(path = { "/rest/foocontroller/foos" }, description = "Your REST foo service")
@RequestMapping(value = "/foos", method = RequestMethod.GET)
@ApiResponseObject
@ResponseBody
public MyResponseBodyWrapper<FooBean> getFoos(){
   // service code here
}

Conforming to the java.lang.reflect.TypeVariable api documentation:

TypeVariable is the common superinterface for type variables of kinds.

while for java.lang.reflect.WildcardType is written:

WildcardType represents a wildcard type expression, such as ?, ? extends Number, or ? super Integer.

Contributor

piccarsa commented Nov 4, 2015

This commit should fix the problem that happens when one of the "candidate" objects is an istance of TypeVariable.

#166

You face this problem also when the return object of a method annotated with @RequestMapping is an instance of java.lang.reflect.TypeVariable . I leave here an example:

@ApiMethod(path = { "/rest/foocontroller/foos" }, description = "Your REST foo service")
@RequestMapping(value = "/foos", method = RequestMethod.GET)
@ApiResponseObject
@ResponseBody
public MyResponseBodyWrapper<FooBean> getFoos(){
   // service code here
}

Conforming to the java.lang.reflect.TypeVariable api documentation:

TypeVariable is the common superinterface for type variables of kinds.

while for java.lang.reflect.WildcardType is written:

WildcardType represents a wildcard type expression, such as ?, ? extends Number, or ? super Integer.

@seredkin

This comment has been minimized.

Show comment
Hide comment
@seredkin

seredkin Nov 13, 2015

versions 12.7..9
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType
at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:104)

The class signature is

public class RepairOrderPlanController extends GenericController< RepairOrderPlan, RepairOrderPlanRepository >

seredkin commented Nov 13, 2015

versions 12.7..9
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType
at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:104)

The class signature is

public class RepairOrderPlanController extends GenericController< RepairOrderPlan, RepairOrderPlanRepository >

@dcerecedo

This comment has been minimized.

Show comment
Hide comment
@dcerecedo

dcerecedo Nov 19, 2015

Similar issue here with JSONDoc 1.2.9. I have also tried 1.2.7 with same result.

We use a hierarchy of abstract controllers to centralize all common controller stuff. For example, at the bottom of the Hierarchy we have an abstract controller with all the logic for creating resources through POST:

public abstract class AbstractController<T extends Updatable<ID>, R extends ResourceSupport, ID extends Serializable> extends ReadAndUpdateAbstractController<T, R, ID> {

@RequestMapping(method = RequestMethod.POST)
public ResponseEntity<R> create(@Valid @RequestBody R inputResource) throws Exception {
    T entity= getAssembler().convert(inputResource);
    T updated= getService().create(entity);
    R outputResource= getAssembler().toResource(updated);
    return new ResponseEntity<>(outputResource, HttpStatus.CREATED);
}
}

When invoking the /jsondoc endpoint, JSON Doc tries to analyze this class and I get:

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType
at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:127)
....

dcerecedo commented Nov 19, 2015

Similar issue here with JSONDoc 1.2.9. I have also tried 1.2.7 with same result.

We use a hierarchy of abstract controllers to centralize all common controller stuff. For example, at the bottom of the Hierarchy we have an abstract controller with all the logic for creating resources through POST:

public abstract class AbstractController<T extends Updatable<ID>, R extends ResourceSupport, ID extends Serializable> extends ReadAndUpdateAbstractController<T, R, ID> {

@RequestMapping(method = RequestMethod.POST)
public ResponseEntity<R> create(@Valid @RequestBody R inputResource) throws Exception {
    T entity= getAssembler().convert(inputResource);
    T updated= getService().create(entity);
    R outputResource= getAssembler().toResource(updated);
    return new ResponseEntity<>(outputResource, HttpStatus.CREATED);
}
}

When invoking the /jsondoc endpoint, JSON Doc tries to analyze this class and I get:

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType
at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:127)
....
@maximelebastard

This comment has been minimized.

Show comment
Hide comment
@maximelebastard

maximelebastard Nov 22, 2015

I've got the same issue. My controllers are using this method: https://gist.github.com/wvuong/5673644

I just added this to my pom.xml (in 1.2.6, 1.2.7, 1.2.8 and 1.2.9)

       <!-- JSON Doc -->
        <dependency>
            <groupId>org.jsondoc</groupId>
            <artifactId>spring-boot-starter-jsondoc</artifactId>
            <version>1.2.8</version>
        </dependency>

And I annotated my app with @EnableJsonDoc.

I added this packages to scan in my application.properties:

# JSON Doc
jsondoc.version=1.0
jsondoc.basePath=http://localhost:8080
jsondoc.packages[0]=com.bin.webservice.controller
jsondoc.packages[1]=com.bin.webservice.entity
jsondoc.playgroundEnabled=true
jsondoc.displayMethodAs=URI

I did not annotated any Controller or Model yet. The applications starts correctly, but when I access to http://localhost:8080/jsondoc, I get this stack trace:

2015-11-22 22:46:33.502 ERROR 8199 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType] with root cause

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:104)
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.jsondocObjects(AbstractSpringJSONDocScanner.java:145)
    at org.jsondoc.core.scanner.AbstractJSONDocScanner.getJSONDoc(AbstractJSONDocScanner.java:96)
    at org.jsondoc.springmvc.controller.JSONDocController.getApi(JSONDocController.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:775)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

PS: I do not have the error in 1.1.16

maximelebastard commented Nov 22, 2015

I've got the same issue. My controllers are using this method: https://gist.github.com/wvuong/5673644

I just added this to my pom.xml (in 1.2.6, 1.2.7, 1.2.8 and 1.2.9)

       <!-- JSON Doc -->
        <dependency>
            <groupId>org.jsondoc</groupId>
            <artifactId>spring-boot-starter-jsondoc</artifactId>
            <version>1.2.8</version>
        </dependency>

And I annotated my app with @EnableJsonDoc.

I added this packages to scan in my application.properties:

# JSON Doc
jsondoc.version=1.0
jsondoc.basePath=http://localhost:8080
jsondoc.packages[0]=com.bin.webservice.controller
jsondoc.packages[1]=com.bin.webservice.entity
jsondoc.playgroundEnabled=true
jsondoc.displayMethodAs=URI

I did not annotated any Controller or Model yet. The applications starts correctly, but when I access to http://localhost:8080/jsondoc, I get this stack trace:

2015-11-22 22:46:33.502 ERROR 8199 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType] with root cause

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.buildJSONDocObjectsCandidates(AbstractSpringJSONDocScanner.java:104)
    at org.jsondoc.springmvc.scanner.AbstractSpringJSONDocScanner.jsondocObjects(AbstractSpringJSONDocScanner.java:145)
    at org.jsondoc.core.scanner.AbstractJSONDocScanner.getJSONDoc(AbstractJSONDocScanner.java:96)
    at org.jsondoc.springmvc.controller.JSONDocController.getApi(JSONDocController.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:775)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

PS: I do not have the error in 1.1.16

fabiomaffioletti added a commit that referenced this issue Nov 29, 2015

@fabiomaffioletti

This comment has been minimized.

Show comment
Hide comment
@fabiomaffioletti

fabiomaffioletti Nov 29, 2015

Owner

I just merged a PR from @gedhi that should fix the problem. Please let me know if you are still having issues and in that case provide me with details and if possible a failing unit test. Thank you everyone :)

Owner

fabiomaffioletti commented Nov 29, 2015

I just merged a PR from @gedhi that should fix the problem. Please let me know if you are still having issues and in that case provide me with details and if possible a failing unit test. Thank you everyone :)

@bpsilva

This comment has been minimized.

Show comment
Hide comment
@bpsilva

bpsilva Apr 15, 2016

I'm having the same problem using version 1.2.13. My question is: shouldn't the problem have ended since I'm using @ApiObject(show=false)?

bpsilva commented Apr 15, 2016

I'm having the same problem using version 1.2.13. My question is: shouldn't the problem have ended since I'm using @ApiObject(show=false)?

@mfnunes

This comment has been minimized.

Show comment
Hide comment
@mfnunes

mfnunes Aug 23, 2016

I'm having the same problem too. Using version: 1.2.16.
My controller is:
public abstract class QuestionGenericCRUDController <T extends Question, T1 extends QuestionDto>

and the error when I try to get jsondoc is:
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType

mfnunes commented Aug 23, 2016

I'm having the same problem too. Using version: 1.2.16.
My controller is:
public abstract class QuestionGenericCRUDController <T extends Question, T1 extends QuestionDto>

and the error when I try to get jsondoc is:
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.reflect.ParameterizedType

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment