测试项目在tomcat7中启动失败,报错如下:

@794314bc3
Error during job execution (jobs.Bootstrap) Oops: VerifyError
~ play.Logger.niceThrowable(Logger.java:) ~ play ~
play.exceptions.UnexpectedException: Unexpected Error
at play.Invoker$Invocation.onException(Invoker.java:)
at play.jobs.Job.onException(Job.java:)
at play.jobs.Job.call(Job.java:)
at Invocation.Job(Play!)
Caused by: java.lang.VerifyError: Expecting a stack map frame
Exception Details:
Location:
controllers/payment/PaymentBaseAction.check()V @: nop
Reason:
Expected stackmap frame at this location.
Bytecode:
: b804 1c00 b801 8c9a 8e03 bd00
: 6bb8 a700 c700 b1b8 b800 794b
: 152a b804 2ab6 009e 3c13
: 1bb8 041a 001b aa00
: 007f
: 008b 2a4d 014e 2c13 02a2
: a413 02a6 b802 aac0 004f 4e2d b800
: 003e 2a4d 033e 2c13 02ab ac13
: 02ae b802 b0c0 b602 b33e 1d99
: 2a4d 014e 2c13 02b4 b513 02b7 b802
00000a0: b9c0 004f 4e2d b800 b800 acb8
00000b0: 00af a700 1bb8 00b2 a700 15b8 00b5 a700
00000c0: 0fb8 00b8 a700 09b8 00bb a700 03a7 000e
00000d0: 3a06 013a 05b8 041e bf01 3a05 b804
00000e0: 20b1
Exception Handler Table:
bci [, ] => handler:
Stackmap Table:
same_frame(@)
append_frame(@,Object[#])
chop_frame(@,)
same_frame(@)
same_frame(@)
same_frame(@)
same_frame(@)
same_frame(@)
same_locals_1_stack_item_frame(@,Object[#])
same_frame(@) at payment.PaymentProxy.init(PaymentProxy.java:)
at jobs.Bootstrap.initPayment(Bootstrap.java:)
at jobs.Bootstrap.doJob(Bootstrap.java:)
at play.jobs.Job.doJobWithResult(Job.java:)
at play.jobs.Job.call(Job.java:)
... more

原因:

jvm验证时出了错误:显示字节码错误: 
网上的解释是因为引入版本为51的字节码规范,使用了严格的类型检查器,任何工具修改了字节码的,都需要更新stackmap,但是jws修改了字节码,而没有更新 stackmap使用了即java的新特性,所以使用较高的版本进行编译时就会报这个错。

解决办法

在tomcat 7启动文件中或者系统环境变量中加入

export JAVA_OPTS=-XX:-UseSplitVerifier

在tomcat 8启动文件中或者系统环境变量中加入

export JAVA_OPTS=-noverify

tomcat 7 参数优化实例

JAVA_OPTS='-server
-Xms2048m
-Xmx2048m
-Xss512k
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:+AggressiveOpts
-XX:+UseBiasedLocking
-XX:+DisableExplicitGC
-XX:+UseConcMarkSweepGC
-XX:+UseFastAccessorMethods
-XX:+CMSParallelRemarkEnabled
-XX:+UseCMSCompactAtFullCollection
-XX:+UseCMSInitiatingOccupancyOnly
-XX:-UseSplitVerifier'

附:在tomcat 8 ,JDK 1.8中,以上有些参数已被忽略或弃用,如下:

PermSize  忽略

MaxPermSize  忽略

UseCMSCompactAtFullCollection  弃用

- xx:ParallelGCThreads = N  如果处理器的数量预计将增加,那么你应该配置并行GC线程的数量来适当使用,N=处理器的个数

具体实例信息

[root@mytest ~]# /opt/apache-tomcat-8.5./bin/catalina.sh stop
Using CATALINA_BASE: /opt/apache-tomcat-8.5.
Using CATALINA_HOME: /opt/apache-tomcat-8.5.
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.5./temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/apache-tomcat-8.5./bin/bootstrap.jar:/opt/apache-tomcat-8.5./bin/tomcat-juli.jar
OpenJDK -Bit Server VM warning: ignoring option PermSize=64m; support was removed in 8.0
OpenJDK -Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
OpenJDK -Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
OpenJDK -Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel
GC threads appropriately using -XX:ParallelGCThreads=N

记一次tomcat7.0版本启动项目失败问题的更多相关文章

  1. Android 开发 8.0版本启动Service的方法

    前言  google在更新Android8.0后对Service的权限越发收紧.导致目前想要启动服务必需实现服务的前台化(否则在服务启动5秒后,系统将自动报错).下面我们就来看看如何在8.0上启动服务 ...

  2. 【推荐】CentOS安装Tomcat-7.0.57+启动配置+安全配置+性能配置

    注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Tomcat之前,请确保已经安装了JDK-1.7环境,具体见<CentOS安装JDK-1.7>. ...

  3. Redis 3.0版本启动时出现警告的解决办法

    原文:http://m.blog.csdn.net/article/details?id=50864933 Redis 3.0.7版本启动时出现警告的解决办法 发表于2016/3/12 12:52:4 ...

  4. IDEA环境Spring Boot 2.3整合Activiti 6.0,启动项目初始化表并创建核心服务

    如下步骤照着抄就完事了. 一.新建一个spring boot项目,并引入相关依赖 <?xml version="1.0" encoding="UTF-8" ...

  5. 关于V1.6.0版本的项目总结

    10月28号,我们开了1.6项目的总结大会,包括Ting总在内,前端.后台.运维都来参加总结大会了.虽然目标基本达成,但同时也暴露出很多问题,我们希望各方能够坐下来总结一下自己或者各个相关团队的功过是 ...

  6. Tomcat7.0无法启动解决方法[failed to start]

    很奇怪的一个问题,Tomcat一直好好的,运行Servlet之后就报这个错: 为什么呢?在网上查都查不到解决方法,后来仔细检查了下Servlet,发现web.xml有个低级错误: 配置的Servlet ...

  7. Spring Boot 2.1.7 启动项目失败,报错: "Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured."

    一开始按照网上的很多解决办法是: 启动类头部声明@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}),但是这样会排除 ...

  8. tomcat7 启动项目报错 java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()

    JDK版本:jdk1.8.0_77 Tomcat 版本:apache-tomcat-7.0.47 异常重现步骤: 1.完成项目部署 2.启动Tomcat 异常头部信息:java.lang.NoSuch ...

  9. nexus3.14.0版本linux环境安装、启动、搭建私库

    本文介绍的是nexus3.14.0版本在linux环境下安装.启动.搭建私库. nexus3以上的版本太新了,网上很少介绍安装细节的.据了解和2.X版本有所不同了. 1.前提 linux机器上需先安装 ...

随机推荐

  1. 2018年尚硅谷《全套Java、Android、HTML5前端视频》

    全套整合一个盘里:链接:https://pan.baidu.com/s/1nwnrWOp 密码:h4bw 如果分类里没有请下载下边那些小项教程链接 感谢尚硅谷提供的视频教程:http://www.at ...

  2. Python:margin collapse

    margin collapse:边界 折叠/重叠/坍塌 此种现象只会垂直方向并且要满足一定条件时才会出现这种现象. https://tech.youzan.com/css-margin-collaps ...

  3. Python:Day09

    Ubantu忘记密码: 1.开机长按shift,进入界面后按e: 2.将红框中内改成如下并按F10重启: 3.输入passwd,然后用户名,然后重新输入密码: locale命令查看系统中是否有中文 a ...

  4. hyperledge工具-configtxlator

    参考:http://www.blockchainbrother.com/article/1337 1.作用: 因为无论配置交易文件 .tx和初始区块文件 .block都是二进制格式,用户无法直接编辑. ...

  5. gcc 找不到 boot python 链接库的问题: /usr/bin/ld: cannot find -lboost_python

    问题: Ubuntu 14.04,gcc 4.8.4,以默认方式编译 boost 1.67 后,使用 Boost.Python 时,gcc 提示找不到 boost python 链接库. 方案: 查看 ...

  6. Charles 抓包工具绿化过程记录

    1.下载官方的软件,并安装. 下载地址:https://www.charlesproxy.com/latest-release/download.do 根据需求下载即可 2.使用在线破解工具生成jar ...

  7. 逆元-P3811 【模板】乘法逆元-洛谷luogu

    https://www.cnblogs.com/zjp-shadow/p/7773566.html -------------------------------------------------- ...

  8. git冲突Please move or remove them before you can merge

    解决Git冲突造成的Please move or remove them before you can merge git clean -d -fx ""其中x -----删除忽略 ...

  9. C#总结(五)调用C++动态库(类型对照)

    函数调用导致堆栈不对称.原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配. 在dllimport中加入CallingConvention参数就行了, [DllImport(PCAP_DL ...

  10. [书籍]重温《Framework Design Guidelines》

    1. 前言 最近重温了<Framework Design Guidelines>. <Framework Design Guidelines>中文名称为<.NET设计规范 ...