java.lang.IllegalStateException: The mapped controller method class 'com.artsquare.gallery.web.html.WorkHtmlController' is not an instance of the actual controller bean instance 'com.sun.proxy.$Proxy135'. If the controller requires proxying (e.g. due to @Transactional), please use class-based proxying. HandlerMethod details: Controller [com.artsquare.gallery.web.html.WorkHtmlController] Method [public java.lang.Object com.artsquare.gallery.web.html.WorkHtmlController.createForm()] Resolved arguments:

Spring JIRA | Christopher Smith | 1 year ago
  1. 0

    I am attempting to use a Groovy trait to apply a mixin to some of my controller classes. On classes where no advice is defined in the class itself (the class's mapping paths are subject to the Spring Security filter, but there's no {{@PreAuthorize}}), I have no trouble. However, when I apply the trait to a controller that uses {{@PreAuthorize}}, I get two reliable failure modes. The failure is caused by including the trait in the class regardless of whether it's actually used. When I launch the application normally, the controller's mappings are silently ignored. I've debugged and confirmed that the controller bean is being registered, and both the constructor injection and the setter injection exposed via the trait are being processed correctly. JRebel notices if I modify the controller class and reloads the bean; MVC keeps ignoring it. When I try to use the controller class in a MockMvc test, the mappings show up in the logs from {{RequestMappingHandlerMapping}}, but requests fail with the error {code} java.lang.IllegalStateException: The mapped controller method class 'com.artsquare.gallery.web.html.WorkHtmlController' is not an instance of the actual controller bean instance 'com.sun.proxy.$Proxy135'. If the controller requires proxying (e.g. due to @Transactional), please use class-based proxying. HandlerMethod details: Controller [com.artsquare.gallery.web.html.WorkHtmlController] Method [public java.lang.Object com.artsquare.gallery.web.html.WorkHtmlController.createForm()] Resolved arguments: at org.springframework.web.method.support.InvocableHandlerMethod.assertTargetBean(InvocableHandlerMethod.java:261) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:224) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:111) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:799) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:728) 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:969) ... 56 more {code}

    Spring JIRA | 1 year ago | Christopher Smith
    java.lang.IllegalStateException: The mapped controller method class 'com.artsquare.gallery.web.html.WorkHtmlController' is not an instance of the actual controller bean instance 'com.sun.proxy.$Proxy135'. If the controller requires proxying (e.g. due to @Transactional), please use class-based proxying. HandlerMethod details: Controller [com.artsquare.gallery.web.html.WorkHtmlController] Method [public java.lang.Object com.artsquare.gallery.web.html.WorkHtmlController.createForm()] Resolved arguments:
  2. 0

    I am attempting to use a Groovy trait to apply a mixin to some of my controller classes. On classes where no advice is defined in the class itself (the class's mapping paths are subject to the Spring Security filter, but there's no {{@PreAuthorize}}), I have no trouble. However, when I apply the trait to a controller that uses {{@PreAuthorize}}, I get two reliable failure modes. The failure is caused by including the trait in the class regardless of whether it's actually used. When I launch the application normally, the controller's mappings are silently ignored. I've debugged and confirmed that the controller bean is being registered, and both the constructor injection and the setter injection exposed via the trait are being processed correctly. JRebel notices if I modify the controller class and reloads the bean; MVC keeps ignoring it. When I try to use the controller class in a MockMvc test, the mappings show up in the logs from {{RequestMappingHandlerMapping}}, but requests fail with the error {code} java.lang.IllegalStateException: The mapped controller method class 'com.artsquare.gallery.web.html.WorkHtmlController' is not an instance of the actual controller bean instance 'com.sun.proxy.$Proxy135'. If the controller requires proxying (e.g. due to @Transactional), please use class-based proxying. HandlerMethod details: Controller [com.artsquare.gallery.web.html.WorkHtmlController] Method [public java.lang.Object com.artsquare.gallery.web.html.WorkHtmlController.createForm()] Resolved arguments: at org.springframework.web.method.support.InvocableHandlerMethod.assertTargetBean(InvocableHandlerMethod.java:261) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:224) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:111) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:799) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:728) 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:969) ... 56 more {code}

    Spring JIRA | 1 year ago | Christopher Smith
    java.lang.IllegalStateException: The mapped controller method class 'com.artsquare.gallery.web.html.WorkHtmlController' is not an instance of the actual controller bean instance 'com.sun.proxy.$Proxy135'. If the controller requires proxying (e.g. due to @Transactional), please use class-based proxying. HandlerMethod details: Controller [com.artsquare.gallery.web.html.WorkHtmlController] Method [public java.lang.Object com.artsquare.gallery.web.html.WorkHtmlController.createForm()] Resolved arguments:
  3. 0

    Spring 3 -- IllegalStateException

    Stack Overflow | 4 years ago | Frank
    java.lang.IllegalStateException: An Errors/BindingResult argument is expected to be immediately after the model attribute argument in the controller method signature: public java.lang.String com.controller.PollController.processPoll1(java.lang.String,org.springframework.ui.Model,org.springframework.validation.BindingResult)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring Data Rest 2.0.0.RELEASE Breaks Code Working Previously With RC1

    Stack Overflow | 3 years ago | Ethan Anderson
    java.lang.IllegalStateException: No suitable resolver for argument [0] [type=org.springframework.http.converter.HttpMessageNotReadableException] HandlerMethod details: Controller [org.springframework.data.rest.webmvc.RepositoryEntityController] Method [public org.springframework.http.ResponseEntity<org.springframework.data.rest.webmvc.support.ExceptionMessage> org.springframework.data.rest.webmvc.AbstractRepositoryRestController.handleNotReadable(org.springframework.http.converter.HttpMessageNotReadableException)]
  6. 0

    Optional long parameter is present but cannot be translated into a null value

    Stack Overflow | 3 years ago | Erez
    java.lang.IllegalStateException: Optional long parameter 'transactionId' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.

  1. qavid 4 times, last 5 months ago
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    The mapped controller method class 'com.artsquare.gallery.web.html.WorkHtmlController' is not an instance of the actual controller bean instance 'com.sun.proxy.$Proxy135'. If the controller requires proxying (e.g. due to @Transactional), please use class-based proxying. HandlerMethod details: Controller [com.artsquare.gallery.web.html.WorkHtmlController] Method [public java.lang.Object com.artsquare.gallery.web.html.WorkHtmlController.createForm()] Resolved arguments:

    at org.springframework.web.method.support.InvocableHandlerMethod.assertTargetBean()
  2. Spring
    InvocableHandlerMethod.invokeForRequest
    1. org.springframework.web.method.support.InvocableHandlerMethod.assertTargetBean(InvocableHandlerMethod.java:261)
    2. org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:224)
    3. org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    3 frames
  3. Spring MVC
    FrameworkServlet.processRequest
    1. org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:111)
    2. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:799)
    3. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:728)
    4. org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    5. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    6. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    7. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
    7 frames