spring boot 部署

1.无法打war包

a.Application.java添加@SpringBootApplication的类

b.可能添加了多个入口,cd到对应项目根目录,mvn package会

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.604s
[INFO] Finished at: Mon Aug 15 18:14:25 CST 2016
[INFO] Final Memory: 22M/226M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.0.RELEASE:repackage (default) on project beenoisy-spring-boot-way: 
Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.4.0.RELEASE:
repackage failed: Unable to find a single main class from the following candidates 

[
com.beenoisy.springboot.way.BeenoisySpringBootWayApplication, 
com.beenoisy.springboot.way.TestConflict
] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.


解决方案:maven配置文件加入start-class

<properties>
     <start-class>com.beenoisy.springboot.way.BeenoisySpringBootWayApplication</start-class>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     <java.version>1.7</java.version>
     <tomcat.version>7.0.52</tomcat.version>
</properties>


2.将war包放入Tomcat报错

SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngin
e[Catalina].StandardHost[localhost].StandardContext[/kfqjy-1.0.0]]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catal
ina.LifecycleException: Failed to start component [StandardEngine[Catalina].Stan
dardHost[localhost].StandardContext[/kfqjy-1.0.0]]
发现项目默认内置Tomcat版本是8,而使用的Tomcat版本为7.

解决方案:

<tomcat.version>7.0.52</tomcat.version>

将7版本换成8版本




       

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值