你的位置:首页 > Java教程

[Java教程]Caused by: java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher


Caused by: java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher

json数据传回前台报错。Java code2011-05-22 11:19:58,640 ERROR [org.apache.struts.actions.DispatchAction] - <Dispatch[/getSbdmlist] to method 'getSbzt' returned an exception>java.lang.reflect.InvocationTargetException  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  at java.lang.reflect.Method.invoke(Unknown Source)  at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)  at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)  at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)  at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)  at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  at cn.com.sedee.centermanager.appclass.CharacterEncodingFitler.doFilter(CharacterEncodingFitler.java:29)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)  at java.lang.Thread.run(Unknown Source)Caused by: java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher  at cn.com.sedee.struts.action.SbdmbAction.outPrint(SbdmbAction.java:121)  at cn.com.sedee.struts.action.SbdmbAction.getSbzt(SbdmbAction.java:103)  ... 36 more2011-05-22 11:19:58,640 WARN [org.apache.struts.action.RequestProcessor] - <Unhandled Exception thrown: class javax.servlet.ServletException>2011-5-22 11:19:58 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for servlet action threw exceptionjava.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher  at cn.com.sedee.struts.action.SbdmbAction.outPrint(SbdmbAction.java:121)  at cn.com.sedee.struts.action.SbdmbAction.getSbzt(SbdmbAction.java:103)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  at java.lang.reflect.Method.invoke(Unknown Source)  at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)  at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)  at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)  at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)  at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  at cn.com.sedee.centermanager.appclass.CharacterEncodingFitler.doFilter(CharacterEncodingFitler.java:29)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)  at java.lang.Thread.run(Unknown Source)

 

 

------解决方案--------------------
是不是少了这个包 ezmorph.jar使用json一般要这几个包:commons-beanutils.jar,commons-httpclient.jar,commons-lang.jar,ezmorph.jar,morph-1.0.1.jar ,json-lib-2.2.3.hb-jdk15.jar