Spring MVC 启动报错

Tomcat 启动Spring MVC工程报如下错误

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:518)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:499)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4733)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5251)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

是因为没有将Maven 下的JAR 包添加至工程的依赖中

Eclipse解决办法:

1. 右键单击工程项目 ->点击 properties
2. 选择 Deployment Assembly
3. 点击 Add -> Java Build Path Entries -> Next
4. 选择 Maven Dependencies -> Finish -> Apply -> OK
5. Clean project and server. 重启server

原文地址:https://www.cnblogs.com/li-zhi-long/p/9307466.html

时间: 2024-10-08 19:21:51

Spring MVC 启动报错的相关文章

spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure

spring Ehcache启动报错的问题

之前找大牛给我写了个spring mvc使用缓存的项目例子但是自己结合项目的时候,在启动的时候就报错,一大片红加蓝,错误信息一大堆,在网上搜了很久也没有找到答案,两天后,我又把大牛请来了,用了一分钟解决了,他只让我在百度里搜了一下tried to access method net.sf.ehcache.CacheManager这个错误,点开第一个结果,就解决了 关于 java.lang.IllegalAccessError: tried to access method net.sf.ehca

spring boot 启动报错:Cannot determine embedded database driver class for database type NONE

错误原因:spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean.因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错. 解决办法:第一种:在Applicat

Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37

使用命令 java -jar springBoot.jar  启动项目,结果报错如下: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37 at java.lang.String.substring(String.java:1963) at org.springframework.boot.loader.jar.JarFile.create

spring项目启动报错BeanFactory not initialized or already closed

spring项目启动的时候报如下错误: java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContextat org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanF

Spring boot 启动报错:com.mongodb.MongoSocketOpenException: Exception opening socket

详细错误信息: com.mongodb.MongoSocketOpenException: Exception opening socket at com.mongodb.connection.SocketStream.open(SocketStream.java:63) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnect

Spring Boot 启动报错:LoggingFailureAnalysisReporter

17:57:19: Executing task 'bootRun'... Parallel execution with configuration on demand is an incubating feature.:thinkvenus-common:compileJava:thinkvenus-tool:processResources UP-TO-DATE:thinkvenus-common:compileJava UP-TO-DATE:thinkvenus-common:proce

解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level

学习了:https://blog.csdn.net/yunfeng482/article/details/78106433 没想到啊:我都看见了,idea也反编不了: 没想到要重新下载啊: 原文地址:https://www.cnblogs.com/stono/p/9126417.html

spring boot + jersey工程由jar包转为war包在tomcat中启动报错问题

第一步: 在maven下,将Spring Boot工程由jar转换为war包启动,很简单,将pom.xml文件中的packaging改为war <packaging>war</packaging> 如果你使用Gradle,你需要修改build.gradle来将war插件应用到项目上: apply plugin: 'war'第二步: 产生一个可部署war包的第一步是提供一个SpringBootServletInitializer子类,并覆盖它的configure方法.这充分利用了Sp