我正在尝试使用 $.ajax() 方法和 Json 作为 dataType 使用 jQuery 库进行 AJAX 调用,当我尝试将其应用于 springmvc 2.5 中的应用程序时,问题就出现了,我根本找不到一个好的教程如何将其应用于 Spring mvc 2.5,但 3.0
干杯
exception
javax.servlet.ServletException:Servlet 调度程序的 Servlet.init() 抛出异常 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 100) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399) org.apache.coyote.http11.Http11Processor.process( Http11Processor.java:317) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:182) org.apache。 tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311) java.util.concurrent.ThreadPoolExecutor$Worker。runTask(ThreadPoolExecutor.java:886) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) java.lang.Thread.run(Thread.java:662)
根本原因
org.springframework.beans.factory.BeanCreationException:创建 ServletContext 资源 [/WEB-INF/dispatcher-servlet.xml] 中定义的名称为“viewResolver”的 bean 时出错:bean 初始化失败;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建 ServletContext 资源 [/WEB-INF/views.xml] 中定义的名称为 'jsonView' 的 bean 时出错:bean 的实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 bean 类 [org.springframework.web.servlet.view.json.JsonView]:构造函数抛出异常;嵌套异常是 java.lang.NoClassDefFoundError: org/apache/commons/beanutils/ConvertUtilsBean org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) org.
根本原因
org.springframework.beans.factory.BeanCreationException:在 ServletContext 资源 [/WEB-INF/views.xml] 中定义名称为“jsonView”的 bean 创建错误:bean 的实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 bean 类 [org.springframework.web.servlet.view.json.JsonView]:构造函数抛出异常;嵌套异常是 java.lang.NoClassDefFoundError: org/apache/commons/beanutils/ConvertUtilsBean org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory。 createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory。
根本原因
org.springframework.beans.BeanInstantiationException:无法实例化bean类[org.springframework.web.servlet.view.json.JsonView]:构造函数抛出异常;嵌套异常是 java.lang.NoClassDefFoundError: org/apache/commons/beanutils/ConvertUtilsBean org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115) org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy. java:61) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) org.springframework.beans。 factory.support.AbstractAutowireCapableBeanFactory。
根本原因
java.lang.NoClassDefFoundError: org/apache/commons/beanutils/ConvertUtilsBean org.springframework.web.servlet.view.json.filter.SimplePropertyFilter.setUpBeanUtils(SimplePropertyFilter.java:31) org.springframework.web.servlet.view.json .filter.SimplePropertyFilter.(SimplePropertyFilter.java:27) org.springframework.web.servlet.view.json.JsonView.(JsonView.java:25) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl。 newInstance(NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) java.lang.reflect.Constructor.newInstance(Constructor.java:513) org.springframework.beans.BeanUtils.instantiateClass(BeanUtils. java:100) org.springframework.beans.factory.support。SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) java.security.AccessController.doPrivileged(Native方法)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) org.springframework。beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:261) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) org.springframework .beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) org.springframework.context.support。AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) org.springframework.web.servlet.view.XmlViewResolver.initFactory(XmlViewResolver.java:138) org.springframework.web.servlet.view.XmlViewResolver.initApplicationContext(XmlViewResolver.java:89) org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119) org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69) org.springframework.context.support.ApplicationObjectSupport.setApplicationContext( ApplicationObjectSupport.java:73) org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70) org.springframework.beans.factory.support。AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java473) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) java.security.AccessController.doPrivileged(Native Method) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java: 380)org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)组织。springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) org.springframework.beans.factory.support.AbstractBeanFactory。 getBean(AbstractBeanFactory.java:185) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) org. springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) org.springframework.web.servlet。FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282) org.springframework。 web.servlet.HttpServletBean.init(HttpServletBean.java:126) javax.servlet.GenericServlet.init(GenericServlet.java:160) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) org.apache。 catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317) org.apache.coyote.http11。Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:182) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint. java:311) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) java.lang.Thread.run(Thread.爪哇:662)ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) java.lang.Thread.run(Thread.java:662)ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) java.lang.Thread.run(Thread.java:662)