Sunday, January 20, 2013

Spring org.springframework.beans.BeanInstantiationException - Solved

I was working on JAX-RS and encountered with BeanInstantiationException.

Exception :
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class []: Constructor threw exception; nested exception is com.anuj.common.errors.InternalServerException: Internal Server Error Occured
    at org.springframework.beans.BeanUtils.instantiateClass(
    ... 41 more
Caused by: com.anuj.common.errors.InternalServerException: Internal Server Error Occured
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.springframework.beans.BeanUtils.instantiateClass(
    ... 43 more

After looking at Exception I found that Constructor of Impl(Resource) class was Throwing null exception and hence Spring was unable to initialize bean. nested exception was java.lang.NullPointerException. After solving that issue, Got expected JAX-RS Response.

Author : Anuj Patel
Blog :

No comments:

Post a Comment