问题描述
请大家帮帮忙,这是什么问题?很长时间也没弄明白?java.lang.reflect.InvocationTargetExceptionsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:585)com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.collegesoft.uids.tools.PermIntercepter.intercept(PermIntercepter.java:61)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.collegesoft.uids.tools.UserIntercepter.intercept(UserIntercepter.java:33)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)java.lang.Thread.run(Thread.java:595)java.lang.NoClassDefFoundErrorcom.collegesoft.studman.service.impl.GraduateReportServiceImpl.getAllGraduatesList(GraduateReportServiceImpl.java:39)com.collegesoft.studman.acts.GraduateReportAct.getAllGraduationsList(GraduateReportAct.java:33)sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:585)com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.collegesoft.uids.tools.PermIntercepter.intercept(PermIntercepter.java:61)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.collegesoft.uids.tools.UserIntercepter.intercept(UserIntercepter.java:33)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)java.lang.Thread.run(Thread.java:595)
解决方案
解决方案二:
java.lang.NoClassDefFoundError类找不到,排查是否类名写错,或者少包
解决方案三:
少包了吧呵呵
解决方案四:
第39行:HibernateUtil.closeSession();该语句中的类是存在的,而且没有报错不存在等问题啊!
解决方案五:
包肯定是不少的啊!一开始就配置好了?
解决方案六:
GraduateReportServiceImpl.java这个类的39行报类不存在异常~~~~
解决方案七:
检查你的jar包,看是否有重复的,即是否有同一个jar包的不同的版本等等。
解决方案八:
断点!!!!!!!!!!!!!!!!!!!!!
解决方案九:
包冲突应该是不存在的,这是一个已经配置好的环境了,只是在加一些代码,加点内容的,感觉是39行问题,但是又看不出来,因为哪个类,包都是存在的!
解决方案十:
错了、invoke应该是运行时,映射产生问题了、请检查报错组件类型所对应的配置映射文件
解决方案十一:
补充楼上一般是由于调用Mathod类的invoke()方法,该方法所代表的指定方法抛出异常时,或者调用Constructor类的newInstance()方法,该方法所代表的底层构造方法抛出异常时,由java.lang.reflect.InvocationTargetExceptio异常包装后作为新的异常抛出而产生,默认异常信息是NULL。所以我怀疑是使用反射的方式调用构造函数时,由于数据或者其他问题造成了构造方法抛出异常,以InvocationTargetException异常的方式显示出来。
解决方案十二:
确认一下执行的HQL、SQL有没有问题。
解决方案十三:
910楼的测试哈赛
解决方案十四:
类不存在