Caused by: java.lang.NullPointerException, java.lang.reflect.InvocationTargetExc

  1. java.lang.reflect.InvocationTargetException  
  2.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  3.     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
  4.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
  5.     at java.lang.reflect.Method.invoke(Unknown Source)  
  6.     at com.controller.DynamicProxy.invoke(DynamicProxy.java:31)  
  7.     at $Proxy4.viewRisk(Unknown Source)  
  8.     at com.controller.RPDController.viewRisk(RPDController.java:2592)  
  9.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  10.     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
  11.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
  12.     at java.lang.reflect.Method.invoke(Unknown Source) 
    1. Caused by: java.lang.NullPointerException  
    2.     at com.controller.CopyOfRPDController.viewRisk(CopyOfRPDController.java:2602)  
    3.     ... 38 more 
    4. spring bean,配置以后,都得用bean配置,不能new,否则会有nullPointer
      更准确的说,new哪个class,那么这个class所用到的bean都不起作用,为null
      所以,不要去new任何bean,都用xml的配置即可!
      问题是这样解决的,
原文地址:https://www.cnblogs.com/itworkers/p/5760666.html