Skip to content
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

ArrayIndexOutOfBoundsException without details in DispatcherServlet due-to advice class [SPR-17262] #21795

spring-projects-issues opened this issue Sep 10, 2018 · 5 comments
in: core in: web


Copy link

@spring-projects-issues spring-projects-issues commented Sep 10, 2018

Dmytro opened SPR-17262 and commented


The but is tied to the Spring MVC module (version 4.3.11) and AOP (2.5 version). I have recently bumped into java.lang.ArrayIndexOutOfBoundsException exception without any root causes or error messages. The following case:

  1. From signature:
public String someMethod(final Model model, final RedirectAttributes redirectModel) 

was removed RedirectAttributes argument.

  1. DispatcherServet#doDispatch monitors any exception, in particular "dispatchException" object keeps a link to exception.
    But when exception occurred in AOP part it does not have any message errors.
  2. AOP has pointcut for annotation and advice class checks arguments from the someMethod (is followed above). Here occurs the exception

So, from the advice class I can see the message of exception, but it is not possible to see it  from DispatchServet.
Image is attached.

If you need more details, please write comments



Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 10, 2018

Juergen Hoeller commented

What's the full stacktrace there? We could possibly catch and wrap such an ArrayIndexOutOfBoundsException at a higher level, provided that we're able to handle it with proper context...

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 10, 2018

Dmytro commented

Hi Juergen Hoeller,

I wish I could provide full stack but it is not possible because no details are present if error occurs in DispatcherServlet on AOP side.

Basically, when it is executed doDispatch method ( in particular the place where: ha.handle(processedRequest, response, mappedHandler.getHandler()) ), here is called advice class and throws an exception (advice class is a part of business logic) 

If you go to advice class you will see the normal exception object with all necessary information, but this info does not pass back to doDispatch where catch block declared. 

In addition, if we look at exception in advice class we will see that it is just troubles with number of arguments are taken from joinpoint, but the question, why does exception from advice does not pass on a high level (DispatcherServlet #doDispatch ) correctly?




@spring-projects-issues spring-projects-issues added type: bug status: waiting-for-triage in: core in: web and removed type: bug labels Jan 11, 2019
Copy link

@rstoyanchev rstoyanchev commented Jan 25, 2019

Given the attached image of the exception in a debugger, can't you evaluate the expression exception.printStackTrace() to see the full stack trace?

@rstoyanchev rstoyanchev added status: waiting-for-feedback and removed status: waiting-for-triage labels Jan 25, 2019
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Feb 1, 2019

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder label Feb 1, 2019
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Feb 8, 2019

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback status: feedback-reminder labels Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: core in: web
None yet

No branches or pull requests

2 participants