Wednesday, September 17, 2014

How to Resolve java.lang.NegativeArraySizeException in Spring


When will you get this Exception?

I was getting this exception when I start my spring application. I was searching the web for any better solution but nothing worked out.
Later I was able to remember the mistake which I have done.

What mistake I have done?
I have defined a property in my class and defined the same in the bean definition file as well. I have copy pasted my bean file into the tomcat.
Later I have removed my property from the java class file and I have not removed the property entries from the bean definition XML file.

What is the reason for the error?
We will get this exception when we have defined a property for a Class later which we have removed those properties from the class.

Solution
Remove the unwanted property definition from the bean definition file and redeploy bean definition XML files.

No comments :

Post a Comment