spring mvc 上传问题,为什么报错,服务端都没报错的

图片说明

0

7个回答

0
qq_35501877
qq_35501877 妈的,原来是from要设置post,我真的醉了
一年多之前 回复

返回值和接收的数据类型不匹配

1
 <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> 
    <property name="defaultEncoding" value="utf-8" /> <property name="maxUploadSize" 
    value="10485760" /> <property name="maxInMemorySize" value="4096" /> <property 
    name="resolveLazily" value="true" /> </bean>

0


value="10485760" /> name="resolveLazily" value="true" /> 这儿可能配置不对

0

报错信息提示说的 值类型错误

0
xiaoxifu1015
xiaoxifu1015 返回值和接收的数据类型不匹配
一年多之前 回复

应该是你spring controller返回值的问题

0

数据返回值不值string类型的

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
spring mvc上传报错
[img=https://img-bbs.csdn.net/upload/201407/19/1405736858_958162.png][/img][img=https://img-bbs.csdn.net/upload/201407/19/1405736919_337316.png][/img]rn报[img=https://img-bbs.csdn.net/upload/201407/19/1405736956_373394.png][/img]
Spring mvc报错与解决方案
JSPs only permit GET POST or HEAD: @RequestMapping(value={"/testTest/{id}"}, method=RequestMethod.PUT) @ResponseBody //添加这一注解 public String putMethod(@PathVariable int id){ return "apa
Spring MVC Junit单元测试报错
java.lang.ExceptionInInitializerErrorrn at org.springframework.mock.web.MockHttpServletResponse.(MockHttpServletResponse.java:76)rn at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:172)rn at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:100)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:319)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:212)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:175)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings, locale zh_CNrn at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)rn at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)rn at java.util.ResourceBundle.getBundle(ResourceBundle.java:721)rn at javax.servlet.ServletOutputStream.(ServletOutputStream.java:87)rn ... 25 more
spring mvc一直报错
[code=java]rn[size=13px][color=#FF0000]严重: java.io.FileNotFoundException: jndi:/localhost/spring%20mvc/WEB-INF/classes/net/spring/controller/HelloWorldController.class[/color][/size]rnjava.io.FileNotFoundException: jndi:/localhost/spring%20mvc/WEB-INF/classes/net/spring/controller/HelloWorldController.classrn at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:389)rn at java.net.URL.openStream(URL.java:1010)rn at com.sun.faces.config.AnnotationScanner.containsAnnotation(AnnotationScanner.java:515)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:467)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:437)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:459)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:437)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:459)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:437)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:459)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:437)rn at com.sun.faces.config.AnnotationScanner.processWebInfClasses(AnnotationScanner.java:416)rn at com.sun.faces.config.AnnotationScanner.getAnnotatedClasses(AnnotationScanner.java:214)rn at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:765)rn at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:736)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)rn at java.util.concurrent.FutureTask.run(FutureTask.java:138)rn at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:329)rn at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3920)rn at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1271)rn at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1440)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:301)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)rn at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)rn at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)rn at java.lang.Thread.run(Thread.java:662)[/code]rnrn总感觉 严重: java.io.FileNotFoundException: jndi:/localhost/spring%20mvc/WEB-INF/classes/net/spring/controller/HelloWorldController.class 这一句话有问题,请教各位有没有遇到过这种问题。。。。。。
spring mvc 注入报错
错误信息如下:rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.service.UploadService com.controller.UploadController.uploadService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dao.UploadDao com.service.UploadService.uploadDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jdbc.core.JdbcTemplate com.dao.UploadDao.jdbcTemplate; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)rn at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)rn at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)rn at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)rn at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)rn at javax.servlet.GenericServlet.init(GenericServlet.java:158)rn at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)rn at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:817)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)rn at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.service.UploadService com.controller.UploadController.uploadService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dao.UploadDao com.service.UploadService.uploadDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jdbc.core.JdbcTemplate com.dao.UploadDao.jdbcTemplate; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:571)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)rn ... 36 morernCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dao.UploadDao com.service.UploadService.uploadDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jdbc.core.JdbcTemplate com.dao.UploadDao.jdbcTemplate; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jdbc.core.JdbcTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1145)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1069)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:967)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:543)rn ... 38 morern....
spring mvc查询报错
刚接触spring mvc,做了个简单的用户查询,然后用junit运行了下,包一下错误,实在没找到解决办法 ,望各位大神给予下帮助。[code=java]rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'test.Test': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private dimeng.modules.treasury.service.ITestService test.Test.testService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [dimeng.modules.treasury.service.ITestService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:385)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:259)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:261)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:219)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:363)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private dimeng.modules.treasury.service.ITestService test.Test.testService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [dimeng.modules.treasury.service.ITestService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)rn ... 26 morernCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [dimeng.modules.treasury.service.ITestService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1301)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1047)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)rn ... 28 morern[/code]
spring mvc 请求报错
No mapping found for HTTP request with URI [/Springmvc/test] in DispatcherServlet with dispatche 原因:表单有日期,实体对应字段也是日期类型,所以报错,把实体和库字段设置程String,就会成功保存。 ERROR [org.springframework.web.context.Context...
spring mvc 多文件上传,为什么只会上传第一张,其余的都没上传
rn rn rnrn rnrnrnrnpublic String uploadFile(HttpServletRequest request,HttpServletResponse reponse,Model model) throws Exception, IOExceptionrn CommonsMultipartResolver multi=new CommonsMultipartResolver(request.getSession().getServletContext());rn if(multi.isMultipart(request))rn MultipartHttpServletRequest mr =(MultipartHttpServletRequest)request;rn Iterator it =mr.getFileNames();rn System.out.println(mr.getFileNames().toString());rn while(it.hasNext())rn MultipartFile file =mr.getFile((String)it.next());rn if(file!=null)rn String fileName = file.getOriginalFilename();rn System.out.println(fileName);rn String currentFileName=System.currentTimeMillis()+fileName.substring(fileName.lastIndexOf("."), fileName.length());rn /**构建图片保存的目录**/ rn String logoPathDir = "/resources/upload/"+currentFileName; rn /**得到图片保存目录的真实路径**/ rn String logoRealPathDir = request.getSession().getServletContext().getRealPath(logoPathDir); rn System.out.println(logoRealPathDir);rn File localFile = new File(logoRealPathDir);rn //写文件到本地rn file.transferTo(localFile);rn model.addAttribute(currentFileName);rn rn rn rn return "success";
Spring上传报错413
SpringMVC上传文件报错413笔者今天工作时,运维的同事反馈我们上线不久的项目上传文件过大时,总是提示上传失败。场景重现一下,发现报错信息显示413:Request entity too large。这个错误一般出现在上传文件的时候,nginx conf配置Post请求体长度过长。解决办法: 打开nginx主配置文件nginx.conf, 找到http{},修改或添加如下配置 client
Freemarker 结合 Spring mvc 报错
[b]应该是配置文件的问题,看看这样配置对不对?[/b]rnrn[code=text]rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn[/code]
Spring MVC之不报错的404错误
额,其实就是学习MVC期间发生了一个小插曲,我是完全按照设计规范来做的,而且配置文件也检查了好几遍程序就是一个hello程序很干净简洁……但是,就是运行之后显示404错误,在controller里打印的代码看不见说明根本就没进入controller,如果您也出现这样的问题别看控制台了,因为控制台并不能提供什么有效的信息,您可以看那一下problem那个模块,里面是不是报了跟jre或者jdk有关的错
Spring mvc 文件上传接口报错
Could not instantiate bean class [org.springframework.web.multipart.commons.CommonsMultipartFile]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframewor
spring mvc报错,如何解决?
严重: Servlet.service() for servlet dispatcher threw exceptionrnrnorg.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException: No matching handler method found for servlet request: path '/login.xhtml', method 'GET', parameters map['op' -> array['valiCodeRedir']]
跪求帮助 Spring mvc 报错
在使用spring2.5时,采用spring2.5的注解MVC 出现错误rn配置文件rnrnrn rn rn rnrn报错信息:rnorg.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/mvc]rnOffending resource: ServletContext resource [/WEB-INF/dispatcherContext.xml]rnrn解决了半天了,就不知道怎么回事,请帮忙,谢谢了
spring mvc环境部署报错
如下图,我部署spring mvc时报java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServet,当点击链接时就报404,请问这怎么解决?n![图片说明](https://img-ask.csdn.net/upload/201706/15/1497459159_140598.png)n![图片说明](https://img-ask.csdn.net/upload/201706/15/1497459332_743129.png)
cfx Spring 和 Spring MVC一起用报错
问题描述:rn 在做WebService的时候,用CFX技术和Spring进行整合,然后通过WebService的方法调用业务逻辑代码,[u][b]发现用Spring的依赖注入没有成功(失效)[/b][/u]。去调web.xml中有关WebService代码,程序运行成功。rnrnweb.xml文件如下rnrn[code=java]rnrnrn rn contextConfigLocationrn /WEB-INF/beanRefServer.xmlrn rn rn CXFServletrn rn org.apache.cxf.transport.servlet.CXFServletrn rn 0rn rn rn CXFServletrn /services/*rn rn rn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn rn Set Character Encodingrn rn org.springframework.web.filter.CharacterEncodingFilterrn rn rn encodingrn UTF-8rn rn rn forceEncodingrn truern rn rn rn Set Character Encodingrn /*rn rn rn rn spring3rn rn org.springframework.web.servlet.DispatcherServletrn rn 1rn rnrn rn spring3 rn /rn rn rn index.jsprn rnrn[/code]rnrnController代码rn[code=java]rn@Controllerrn@RequestMapping("/user")rnpublic class UserController rn rn private IUserService userServer;rn private IDeptService deptServer;rn rn public IDeptService getDeptService() rn return deptServer;rn rnrn public void setDeptService(IDeptService deptServer) rn this.deptServer = deptServer;rn rnrn public IUserService getUserService() rn return userServer;rn rnrn public void setUserService(IUserService userServer) rn this.userServer = userServer;rn rnrn @RequestMapping(value="/login",method=RequestMethod.POST)rn public String login(@RequestParam String name,@RequestParam String password,Model model,HttpServletRequest request) throws Exceptionrn TUser user1 = userServer.getUserByName(name);rn if(user1 == null) rn model.addAttribute("message", "用户不存在");rn return "login";rn else if(password == null || !password.equals(user1.getPassword()) )rn model.addAttribute("message", "密码错误");rn return "login";rn else rn request.getSession().setAttribute(Constants.USER_INFO_SESSION, user1);rn return "welcome";rn rn rn以下略...rn[/code]rnrn上面代码中 login()方法时,userServer为null,注入没有成功,请问为何rnrn
mvc 报错
未能从程序集“System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”中加载类型“System.Web.HttpContextWrapper2”。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.TypeLoadException: 未能从程序集“System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”中加载类型“System.Web.HttpContextWrapper2”。rnrn源错误: rnrn执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 rnrn堆栈跟踪: rnrnrn[TypeLoadException: 未能从程序集“System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”中加载类型“System.Web.HttpContextWrapper2”。]rn System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +0rn System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +50rn System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181rn System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75rnrn rnrnrn--------------------------------------------------------------------------------rn版本信息: Microsoft .NET Framework 版本:2.0.50727.4952; ASP.NET 版本:2.0.50727.4955 rnrnrn---rn系统是win7rnVisual Studio 2008rnasp.net mvc 1rnrn先谢谢了
上传excel报错问题
上传excel时报出: java.lang.IllegalStateException: The hyperlink for cell F2 references relation rId4, but that didn't exist! 跟踪代码发现 Workbook workbook = new XSSFWorkbook(file.getInputStream()); 是执行这一行时报出异常...
上传报错
[code=Java]rnjava.lang.NullPointerExceptionrn at hlgm.oa.struts.action.TongzhiAction.addtongzhi(TongzhiAction.java:150)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)[/code]rnrnrn第150 行代码rnrncode=Java] /*rn * 上传文件的路径---uploadrn */rn rn String dir = servlet.getServletContext().getRealPath("/upload/");[[/code]
vs2017 创建的mvc项目上传github 报错
有人遇到过这个问题吗?![图片说明](https://img-ask.csdn.net/upload/201805/20/1526782452_530307.png)
Spring MVC之服务端数据校验
服务端数据校验为什么需要服务端校验?一、普通校验1、Spring MVC 中不支持服务端的数据校验,需要添加Hibernate相关校验依赖,Hibernate的校验框架和ORM没有关系。2、创建错误配置信息properties文件3、在Spring MVC 的配置文件中配置如下:4、在需要校验的类上添加注解:5、在Controller中,指明数据校验:二、分组校验1、定义分组2、在校验上指定分组3...
spring aop报错问题
今天在使用spring的过程中,加入spring aop拦截之后总是报错。错误前面是Error creating bean with name 'org.springframework.context.event.internalEve等等等。发现是少了一个jar包造成的。解决方法是引入aspectweaver-1.5.3.jar。...
Spring配置文件报错问题
项目中Spring的各种配置文件报错,在左边处显示红叉.问题一: 出现这种情况是标签头部有空格!. 问题二: 问题描述:配置文件傍边会报错,就是说找不到这个标签对应的约束等,spring-mvc.xml,spring-mybatis,applicationContext.xml等配置文件都会出现这样的错误. 查阅了网上的资料,说的各种解决方法,比如说是对应的约束jar包没有引入等等解决方案.但是我这
dubbo spring 报错问题
![图片说明](https://img-ask.csdn.net/upload/201704/06/1491467324_287222.png)n 对这个报错有点绝望...不知道问题出在哪里...n n![图片说明](https://img-ask.csdn.net/upload/201704/06/1491467372_35265.png)n 调用这个测试控制器报的错,这个项目只有这个控制器。n
spring 报错问题
[code=Java]rn2010-4-26 11:44:51 org.springframework.context.support.AbstractApplicationContext prepareRefreshrn信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@e5bbd6: display name [org.springframework.context.support.ClassPathXmlApplicationContext@e5bbd6]; startup date [Mon Apr 26 11:44:51 CST 2010]; root of context hierarchyrn2010-4-26 11:44:51 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitionsrn信息: Loading XML bean definitions from class path resource [appDataSource.xml]rnrn[/code]rn这段信息是什么意思?rn还有就是用spring需要导入什么核心的包?rn先谢谢大家rn
spring报错
[code=text]七月 21, 2013 12:45:50 上午 org.apache.catalina.core.AprLifecycleListener initrn信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\Java\jdk1.7.0_05\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/Program Files/Java/jdk1.7.0_05/bin/../jre/bin/client;D:/Program Files/Java/jdk1.7.0_05/bin/../jre/bin;D:/Program Files/Java/jdk1.7.0_05/bin/../jre/lib/i386;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\Java\mysql-5.6.10-win32\bin;D:\Program Files\Java\jdk1.7.0_05;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;D:\Program Files\Java\maven\apache-maven-3.1.0-alpha-1\bin;D:\Program Files\Java\jdk1.7.0_05\bin;D:\Program Files\Java\jdk1.7.0_05\jre\bin;D:\Program Files\Java\jdk1.7.0_05;;D:\Program Files\Java\eclipse-jee-helios-SR2-win32\eclipse;;.rn七月 21, 2013 12:45:50 上午 org.apache.tomcat.util.digester.SetPropertiesRule beginrn警告: [SetPropertiesRule]Server/Service/Engine/Host/Context Setting property 'source' to 'org.eclipse.jst.jee.server:hibernatespring' did not find a matching property.rn七月 21, 2013 12:45:50 上午 org.apache.coyote.AbstractProtocol initrn信息: Initializing ProtocolHandler ["http-bio-8080"]rn七月 21, 2013 12:45:50 上午 org.apache.coyote.AbstractProtocol initrn信息: Initializing ProtocolHandler ["ajp-bio-8009"]rn七月 21, 2013 12:45:50 上午 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 637 msrn七月 21, 2013 12:45:50 上午 org.apache.catalina.core.StandardService startInternalrn信息: Starting service Catalinarn七月 21, 2013 12:45:50 上午 org.apache.catalina.core.StandardEngine startInternalrn信息: Starting Servlet Engine: Apache Tomcat/7.0.27rn七月 21, 2013 12:45:51 上午 org.apache.catalina.loader.WebappClassLoader validateJarFilern信息: validateJarFile(D:\Program Files\Java\HTML_demo\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\hibernatespring\WEB-INF\lib\el-api-6.0.37.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.classrn七月 21, 2013 12:45:51 上午 org.apache.catalina.loader.WebappClassLoader validateJarFilern信息: validateJarFile(D:\Program Files\Java\HTML_demo\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\hibernatespring\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.classrn七月 21, 2013 12:45:51 上午 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContextrn七月 21, 2013 12:45:51 上午 org.springframework.web.context.ContextLoader initWebApplicationContextrn信息: Root WebApplicationContext: initialization startedrn七月 21, 2013 12:45:51 上午 org.springframework.context.support.AbstractApplicationContext prepareRefreshrn信息: Refreshing Root WebApplicationContext: startup date [Sun Jul 21 00:45:51 CST 2013]; root of context hierarchyrn七月 21, 2013 12:45:51 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitionsrn信息: Loading XML bean definitions from class path resource [applicationContext.xml]rn七月 21, 2013 12:45:52 上午 org.springframework.web.context.ContextLoader initWebApplicationContextrn严重: Context initialization failedrnjava.lang.NoClassDefFoundError: org/aspectj/weaver/BCExceptionrn at java.lang.Class.getDeclaredMethods0(Native Method)rn at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)rn at java.lang.Class.getDeclaredMethods(Class.java:1808)rn at org.springframework.core.type.StandardAnnotationMetadata.hasAnnotatedMethods(StandardAnnotationMetadata.java:161)rn at org.springframework.context.annotation.ConfigurationClassUtils.isLiteConfigurationCandidate(ConfigurationClassUtils.java:104)rn at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:87)rn at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:253)rn at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: java.lang.ClassNotFoundException: org.aspectj.weaver.BCExceptionrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)rn ... 23 morernrn七月 21, 2013 12:45:52 上午 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnjava.lang.NoClassDefFoundError: org/aspectj/weaver/BCExceptionrn at java.lang.Class.getDeclaredMethods0(Native Method)rn at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)rn at java.lang.Class.getDeclaredMethods(Class.java:1808)rn at org.springframework.core.type.StandardAnnotationMetadata.hasAnnotatedMethods(StandardAnnotationMetadata.java:161)rn at org.springframework.context.annotation.ConfigurationClassUtils.isLiteConfigurationCandidate(ConfigurationClassUtils.java:104)rn at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:87)rn at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:253)rn at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: java.lang.ClassNotFoundException: org.aspectj.weaver.BCExceptionrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)rn ... 23 morern[/code]rn
Spring 报错
[framework] 2016-04-21 13:49:53,972 - org.springframework.beans.factory.xml.XmlBeanDefinitionReader -381 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [applicationContext.xml]rn[framework] 2016-04-21 13:49:54,355 - org.springframework.context.support.GenericApplicationContext -764 [main] INFO org.springframework.context.support.GenericApplicationContext - Refreshing org.springframework.context.support.GenericApplicationContext@19565a99: startup date [Thu Apr 21 13:49:54 CST 2016]; root of context hierarchyrn[framework] 2016-04-21 13:49:54,531 - org.springframework.context.support.PropertySourcesPlaceholderConfigurer -940 [main] INFO org.springframework.context.support.PropertySourcesPlaceholderConfigurer - Loading properties file from class path resource [config.properties]rn[framework] 2016-04-21 13:49:54,614 - org.springframework.beans.factory.support.DefaultListableBeanFactory -1023 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2ea54d32: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,dataSource,AccountSrevice,AccountDao,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchyrn[framework] 2016-04-21 13:49:54,644 - com.mchange.v2.log.MLog -1053 [main] INFO com.mchange.v2.log.MLog - MLog clients using log4j logging.rn[framework] 2016-04-21 13:49:54,966 - com.mchange.v2.c3p0.C3P0Registry -1375 [main] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]rn[framework] 2016-04-21 13:49:55,092 - org.springframework.beans.factory.support.DefaultListableBeanFactory -1501 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2ea54d32: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,dataSource,AccountSrevice,AccountDao,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchyrn[framework] 2016-04-21 13:49:55,094 - org.springframework.test.context.TestContextManager -1503 [main] ERROR org.springframework.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@7f81c084] to prepare test instance [cn.com.test.SpringDemo1@7d256e50]rnjava.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:313)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:236)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AccountSrevice' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'dao' while setting bean property 'dao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dao' is definedrn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1391)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:106)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:57)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)rn at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)rn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)rn ... 24 morernCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dao' is definedrn at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:549)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1096)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)rn ... 42 more
Spring报错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [UserBean.xml]: Invocation of init method failed; nested exceptio...
spring 报错
2011-05-02 20:53:55 ERROR [default]:253 - Servlet.service() for servlet default threw exceptionrnjava.lang.IllegalArgumentException: object is not an instance of declaring classrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy3.query(Unknown Source)rn at com.sunrister.teachplan.action.TeachPlanAction.query(TeachPlanAction.java:92)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rn
spring mvc参数传递日期类型报错
解决办法 在controller里面加上@InitBinder public void initBinder(ServletRequestDataBinder  binder) { /** * 自动转换日期类型的字段格式 */        binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateF...
spring mvc ajax请求的时候报错
javax.servlet.ServletException: Could not resolve view with name ‘userList’ in servlet with name ‘springMvc’ 1.请求的方法上加上@ResponseBody注解即可
spring mvc @RequestMapping("/flow_statistic.jspx")注解报错
各位大侠,本人之前使用spring mvc 的@RequestMapping,采用的是路径配置方式,例如:@RequestMapping("/hello"),一直没有问题。今天在查看其他人写的项目时,采用的是[b]@RequestMapping("/flow_statistic.jspx")[/b],我在spring 配置文件中自动扫描注解,如:rnrnrnrn在项目启动时,报错:如下:rnJava HotSpot(TM) Client VM warning: MaxNewSize (262144k) is equal to or greater than the entire heap (262144k). A new generation size of 262080k will be used.rn2014-7-23 0:41:35 org.apache.tomcat.util.digester.SetPropertiesRule beginrn警告: [SetPropertiesRule]Server/Service/Engine/Host/Context Setting property 'debug' to '0' did not find a matching property.rn2014-7-23 0:41:35 org.apache.catalina.core.AprLifecycleListener initrn信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\Java\jdk6\bin;E:\kaifa_gongju\tomcat-6.0.18\binrn2014-7-23 0:41:35 org.apache.coyote.http11.Http11Protocol initrn信息: Initializing Coyote HTTP/1.1 on http-80rn2014-7-23 0:41:35 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 672 msrn2014-7-23 0:41:35 org.apache.catalina.core.StandardService startrn信息: Starting service Catalinarn2014-7-23 0:41:35 org.apache.catalina.core.StandardEngine startrn信息: Starting Servlet Engine: Apache Tomcat/6.0.18rn2014-7-23 0:41:38 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContextrn2014-7-23 0:42:07 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring FrameworkServlet 'JeeCmsAdmin'rn2014-7-23 0:42:17 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring FrameworkServlet 'JeeCmsFront'rn00:42:20.140 ERROR org.springframework.web.servlet.DispatcherServlet - Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in ServletContext resource [/WEB-INF/config/jeecms-servlet-front.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot map handler 'siteFlowAct' to URL path [/flow_statistic.jspx]: There is already handler of type [class com.jeecms.cms.action.front.CmsSiteFlowAct] mapped.rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) ~[spring.beans-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring.beans-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) ~[spring.beans-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring.beans-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) ~[spring.beans-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring.beans-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:398) ~[spring.beans-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1146) ~[spring.context-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275) ~[spring.beans-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.DispatcherServlet.initHandlerMappings(DispatcherServlet.java:424) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.DispatcherServlet.initStrategies(DispatcherServlet.java:339) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.DispatcherServlet.onRefresh(DispatcherServlet.java:328) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.FrameworkServlet.onApplicationEvent(FrameworkServlet.java:523) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.FrameworkServlet$ContextRefreshListener.onApplicationEvent(FrameworkServlet.java:749) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.FrameworkServlet$ContextRefreshListener.onApplicationEvent(FrameworkServlet.java:1) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.context.event.GenericApplicationListenerAdapter.onApplicationEvent(GenericApplicationListenerAdapter.java:51) ~[spring.context-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.context.event.SourceFilteringListener.onApplicationEventInternal(SourceFilteringListener.java:97) ~[spring.context-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.context.event.SourceFilteringListener.onApplicationEvent(SourceFilteringListener.java:68) ~[spring.context-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97) ~[spring.context-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303) ~[spring.context-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911) ~[spring.context-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428) ~[spring.context-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at javax.servlet.GenericServlet.init(GenericServlet.java:241) [javaee.jar:9.0]rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172) [catalina.jar:na]rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992) [catalina.jar:na]rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) [catalina.jar:na]rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371) [catalina.jar:na]rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) [catalina.jar:na]rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) [catalina.jar:na]rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) [catalina.jar:na]rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) [catalina.jar:na]rn at org.apache.catalina.core.StandardService.start(StandardService.java:516) [catalina.jar:na]rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) [catalina.jar:na]rn at org.apache.catalina.startup.Catalina.start(Catalina.java:578) [catalina.jar:na]rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_24]rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_24]rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_24]rn at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_24]rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) [bootstrap.jar:na]rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) [bootstrap.jar:na]rnCaused by: java.lang.IllegalStateException: Cannot map handler 'siteFlowAct' to URL path [/flow_statistic.jspx]: There is already handler of type [class com.jeecms.cms.action.front.CmsSiteFlowAct] mapped.rn at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:390) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:362) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:82) ~[spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]rn at rn rn这种情况本人没有碰到过,百度了下,也没有找到答案。所以请大家帮我看看。谢谢!rn有意思的是去掉 自动扫描,就没问题了。rnrnrn不知道其中的原因。rn
spring mvc简单例子,启动服务器时报错
web.xml:rn[code=XML] rn Spring MVC Dispatcher Servletrn org.springframework.web.servlet.DispatcherServletrn rn contextConfigLocationrn rn /WEB-INF/annomvc.xmlrn rn rn 1rn rnrn rn Spring MVC Dispatcher Servletrn /*rn [/code]rnrnannomvc.xml:rn[code=XML]rnrnrn rnrn rnrn rn[/code]rnrnrncontroller:rn[code=Java]@Controllerrn@RequestMapping("/forum.do")rnpublic class BbtForumController rn rn //............rn[/code]rnrn错误;rn严重: Servlet /mvcspring threw load() exceptionrnjava.lang.ClassNotFoundException: org.apache.commons.logging.LogFactoryrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)rn at org.springframework.web.servlet.DispatcherServlet.(DispatcherServlet.java:206)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at java.lang.Class.newInstance0(Class.java:355)rn at java.lang.Class.newInstance(Class.java:308)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)rn at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)rn at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:583)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Spring MVC mybatis + maven 项目配置文件报错
[img=https://img-bbs.csdn.net/upload/201312/24/1387867430_621318.png][/img][img=https://img-bbs.csdn.net/upload/201312/24/1387867421_315198.png][/img]小弟小白, 看着网上的教程一步一步建完了项目结果配置文件报错了。。。求教啊。rnjunit测试也不通过。 教程上面都OK 我一步也没漏怎么就不行了馁。。。rn
spring mvc返回空白页面!不报错!
底下是整个项目的结构,用的maven搭建的,头次用很多东西不熟悉[img=https://img-bbs.csdn.net/upload/201406/12/1402506767_115036.jpg][/img]rn下边是spring mvc的配置rn[code=html]rnrn rn rn rn rn rn rn rnrnrn[/code]rnrn下边是控制层方法的代码rn[code=java]package xieguannan.store.user.action;rnrnimport javax.servlet.http.HttpServletRequest;rnrnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.stereotype.Controller;rnimport org.springframework.web.bind.annotation.RequestMapping;rnimport org.springframework.web.bind.annotation.RequestMethod;rnimport org.springframework.web.servlet.ModelAndView;rnrnimport xieguannan.store.user.business.UserBusiness;rnimport xieguannan.store.user.entity.User;rnrn@Controllerrn@RequestMapping("/user")rnpublic class UserAction rn @Autowiredrn private UserBusiness userBusiness;rn @RequestMapping("/list")rn public String list(HttpServletRequest request)rn System.out.println("test");rn return "index";rn rn rn @RequestMapping("add")rn public ModelAndView add()rn System.out.println("add");rn return new ModelAndView("store/user/createUser");rn rn rn @RequestMapping(value="createUser",method=RequestMethod.POST)rn public String createUser(User user)rn userBusiness.createUser(user);rn return "index";rn rnrn[/code]rnrn现在问题是启动服务器以后,访问http://localhost:8080/mywebsite/user/list.do ,控制台会打印出test字符,说明已经进入相应的方法了,配置是没有问题的!但是问题就是每次什么错误都不报,返回页面就是空,什么都没有!这是为什么啊?研究半天还没找到问题,求大神指点。。配置文件里路径我都改了不知道多少次了,就是prefix那个属性后的。rn页面代码很简单.rn[code=html]rnrn Hello World!rnrnrn[/code]
Spring MVC 注解接收json数据报错415
1.   Spring MVC 1.@RequestBody User user 注解接收json数据报415(POST请求) 解决办法:          springmvc-servlet.xml添加                                                        application/json;charset=UT
spring mvc @sessionattributes @ResponseBody 公用报错
[code="java"]rnrn@Controllerrn@RequestMapping("/user")rn@SessionAttributes(LoginConstants.CURRENT_USER)rnpublic class UserContorller rn private UserService userService;rn public UserService getUserService() rn return userService;rn rnrn @Autowiredrn public void setUserService(UserService userService) rn this.userService = userService;rn rnrn @ResponseBodyrn @RequestMapping( value="login" ,method=RequestMethod.GET)rn public String login(LoginForm loginForm,ModelMap modelMap)rn UserEntity userEntity = new UserEntity();rn userEntity.setName(loginForm.getName());rn userEntity.setPassword(loginForm.getPassword());rn userEntity = userService.login(userEntity);rn if(null != userEntity)//登录成功rn modelMap.addAttribute(LoginConstants.CURRENT_USER, userEntity);rn return "ok";rn else//登录失败 rn return "error";rn rn rnrn[/code]rnrn报错如下错误:rn[code="java"]rn 严重: Servlet.service() for servlet springmvc threw exceptionrnjava.lang.IllegalStateException: Cannot create a session after the response has been committedrn at org.apache.catalina.connector.Request.doGetSession(Request.java:2400)rn at org.apache.catalina.connector.Request.getSession(Request.java:2120)rn at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)rn[/code]
Spring mvc 集成支付宝报错 java.lang.ClassNotFoundException: com.alipay.api.internal.uti
在项目中,支付宝的sdk已经导入;编译的时候代码没有报错,但是在运行的时候就出错了。不知道是不是我在哪里没有配置好,求助大神帮帮忙啊。错误信息如下:rn严重: Servlet.service() for servlet [springmvc] in context with path [/mumu] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/alipay/api/internal/util/AlipaySignature] with root causernjava.lang.ClassNotFoundException: com.alipay.api.internal.util.AlipaySignaturern at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1856)rn at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)rn at com.mumu.service.OrderServiceImpl.orderAlipay(OrderServiceImpl.java:282)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)rn at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)rn at com.sun.proxy.$Proxy29.orderAlipay(Unknown Source)rn at com.mumu.controller.alipay.AliPayController.orderAlipay(AliPayController.java:37)rn at com.mumu.controller.alipay.AliPayController$$FastClassBySpringCGLIB$$753bf249.invoke()rn at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)rn at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)rn at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:58)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)rn at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)rn at com.mumu.controller.alipay.AliPayController$$EnhancerBySpringCGLIB$$f4d0e6b0.orderAlipay()rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:111)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:806)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:729)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)rn at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Unknown Source)
maven项目Spring MVC中使用@Autowired报错
这是controll代码[img=https://img-bbs.csdn.net/upload/201707/17/1500278029_496016.png][/img]rn这是service[img=https://img-bbs.csdn.net/upload/201707/17/1500278101_382487.png][/img]rnseviceimpl[img=https://img-bbs.csdn.net/upload/201707/17/1500278144_29374.png][/img]rnsping-mvc[img=https://img-bbs.csdn.net/upload/201707/17/1500278239_752525.png][/img]rn普通的访问项目就没问题,用控制层里Login/getLogin.do就报错rnServlet.service() for servlet [SpringMVC] in context with path [/center] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private goss.service.UserService goss.controller.LoginController.userService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [goss.service.UserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)] with root causernorg.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [goss.service.UserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)
Spring MVC 上传文件报错java.net.SocketException: Broken pipe
首先 我的windows本地是没问题的 跑到linux服务器上才出的问题rn我用的SpringMVCrnspring-servlet.xml配置了rn[code=java]rnrnrnrnrn[/code]rn后台rn[code=java]rn@RequestMapping(value = "/uploadfile/add")rnpublic String add(HttpServletRequest request, UploadFileModel model,rn @RequestParam(value = "myfile") MultipartFile file rn // XXX业务处理rn}rn[/code]rn我试过1M 2M左右及以下的上传没问题的rn超过就不行了rn上面的add方法都进不去rn浏览器反应:rn卡了40秒左右 之后跳出连接被重置rn之后后台报错rn[code=java]rnDec 15, 2015 9:06:59 AM org.apache.jk.core.MsgContext actionrnWARNING: Unable to send headersrnjava.net.SocketException: Broken pipern at java.net.SocketOutputStream.socketWrite0(Native Method)rn at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)rn at java.net.SocketOutputStream.write(SocketOutputStream.java:159)rn at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:532)rn at org.apache.jk.common.JkInputStream.appendHead(JkInputStream.java:326)rn at org.apache.jk.core.MsgContext.action(MsgContext.java:266)rn at org.apache.coyote.Response.action(Response.java:183)rn at org.apache.coyote.Response.sendHeaders(Response.java:379)rn at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:305)rn at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:288)rn at org.apache.catalina.connector.Response.flushBuffer(Response.java:548)rn at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:344)rn at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:286)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)rn at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)rn at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)rn at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)rn at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)rn at java.lang.Thread.run(Thread.java:744)rnrnDec 15, 2015 9:06:59 AM org.apache.jk.common.ChannelSocket processConnectionrnWARNING: processCallbacks status 2rn[/code]rn还有疑问的可以问我rn在线等
相关热词 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd c# 操作sql视图