idea 打包springboot项目报错:404
1、
在本地的idea中,我们必须通过context-path(这里是volkswagen)+controller中的路径名访问项目,但是打包后,就不需要这个context-path,需要的是war包名+controller路径访问的形式
2、在测试类上,需要添加@Ignore不让maven将我么的测试类中的内容打成war包。
3、在启动类中,继承SpringBootServletInitializer类,并重写以下方法
//打成war包启动方式
protected SpringApplicationBuilder configure(
SpringApplicationBuilder builder)
{
return builder.sources(DemoApplication.class);
}
idea 打包springboot项目报错:404的更多相关文章
- 运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found.
运行springboot项目报错: *************************** APPLICATION FAILED TO START ************************** ...
- idea启动springboot项目 报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;
有一次启动springboot项目的时候,报了一个非常奇怪的错误,说是找不到servletContext,springboot不是自带tomcat的吗? 在网上找了好久,说是用以下方式解决. 解决方式 ...
- Tomcat部署多个Springboot项目报错 InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat
在一个tomcat服务器下部署了多个采用阿里druid作为数据连接池,结果启动报错.原因是不能在一个tomcat服务器下不能直接部署多个druid作为数据连接池的项目,需要配置. 解决办法: 在spr ...
- resin发布spring-boot项目报错“java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger”
说白了还是jar包冲突问题,直接说解决方式: 首先将resin/lib下的validation-api-1.0.0.GA.jar替换成项目中的包validation-api-2.0.1.Final.j ...
- springboot 项目报错问题的解决
报错如下: java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test ...
- 运行springboot项目报错 Error running 'ResourceApplication': Command line is too long. Shorten comma
方法1 IDEA 运行报错:Error running '***': Command line is too long 技术标签: IDEA Error running 'Test': Com ...
- 新建SpringBoot项目报错
新建一个Springboot项目时,当勾选了SQL相关的依赖(如引入了jpa 或MyBatis依赖),直接启动项目时报错 原因:没有配置数据库相关的属性,如 url driver 等 解决办法:在ap ...
- SpringBoot项目报错Cannot determine embedded database driver class for database type NONE
原因: Cannot determine embedded database driver class for database type NONE 这是因为spring boot默认会加载org.s ...
- Springboot项目报错【java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader】
1.发生问题: 升级了JDK9,发现原先的springboot项目起不来了,以为是maven中jdk配置有问题. 于是在pom中添加了 <plugin> <groupId>or ...
随机推荐
- lua---研究 c-api
c-api 参考手册:http://www.leeon.me/a/lua-c-api-manual
- 文献导读 | Single-Cell Sequencing of iPSC-Dopamine Neurons Reconstructs Disease Progression and Identifies HDAC4 as a Regulator of Parkinson Cell Phenotypes
文献编号:19Mar - 11 2019年04月23日三读,会其精髓: 相信这种方法的话,那么它的精髓是什么,如何整合出这个core gene set. 首先要考虑样本的选择,样本里是否存在明显的分层 ...
- idea在本地调试,spark创建hiveContext的时候报错
spark版本:1.6.1 scala版本:2.10 问题呢场景: 在idea调试本地程序的时候创建hiveContext报错,上午的时候是没有这个问题的,下午在项目中写了一个小deamon,出现了而 ...
- Lua 用指定字符或字符串分割输入字符串,返回包含分割结果的数组
// 用指定字符或字符串分割输入字符串,返回包含分割结果的数组 // @function [parent=#string] split // @param string input 输入字符串 // ...
- Lab 10-1
This lab includes both a driver and an executable. You can run the executable from anywhere, but in ...
- Python 进度条原理
#进度条原理 import sys,time for i in range(50): sys.stdout.write("#")#标准输出 #若不能够按照时间一个一个依次显示,则代 ...
- Confluence 6 升级以后
7. 拷贝你的数据库驱动 如果你现在使用的是 Oracle 或者 MySQL 数据库的话,你讲要重新拷贝 jdbc 驱动的 jar 文件到你已经存在的 Confluence 安装目录中 conflue ...
- AEM上的一个图片转换工具
目的: 不同情况下,同样一张图片,需要不一样大小/背景/尺寸显示. 例子: dam下面有一张940 x 300 的图片: http://localhost:4502/content/dam/geome ...
- C#流程控制语句--迭代语句(while,do....while, for , foreach)
迭代语句:有的时候,可能需要多次执行同一块代码.函数中的第一个语句先执行,接着是第二个语句,依此类推. 迭代语句:while(先检查后执行) while(条件表达式 bool类型) { 代码语句 } ...
- python-文件读写
python对文件的操作对文件操作的步骤:1.打开文件2.读写文件3.关闭文件 一.读取文件的方法有三种:read(),readline(),readlines()f.readline() #每次读出 ...