SpringMvc输入地址报错
出现上面的错误如果不是路径的问题,就应该找环境的问题,我这里的问题是tomcat7+jdk6,应该是jdk7或以后的版本(因为是web socket)
对应的版本http://tomcat.apache.org/whichversion.html
换上jdk7就好了
2、输入地址报错
type Exception report
message Servlet.init() for servlet springmvc threw exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Thread.java:662)
root cause
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [springmvc.xml]; nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be opened because it does not exist org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
原因是web.xml中 springmvc.xml路径配置出错,<param-value>classpath:springmvc.xml</param-value>改成<param-value>classpath:config/springmvc.xml</param-value>
3\
type Exception report
message Servlet.init() for servlet springmvc threw exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1083) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745)
root cause
java.lang.IllegalArgumentException org.springframework.asm.ClassReader.<init>(Unknown Source) org.springframework.asm.ClassReader.<init>(Unknown Source) org.springframework.asm.ClassReader.<init>(Unknown Source) org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52) org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80) org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101) org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76) org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298) org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
如上错误肯定是版本(jdk1.7+spring3)的问题,这是明明安装的1.7版本,环境变量配置的1.7还是报这个错,仔细观察发现eclipse运行的还是1.8,这就奇怪了,
自己折腾添加,The JRE could not be found. Edit the server and change the JRE location.引入还是有问题,这是重新引入就好了