异常-LifecycleException
1.org.apache.catalina.LifecycleException
报错信息如下:
警告: Error during context [/wxqhbcloud] restart org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/wxqhbcloud]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1584) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1548) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1784) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:366) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1370) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1542) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1520) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/wxqhbcloud] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1Boolean->org.bouncycastle.asn1.DERBoolean->org.bouncycastle.asn1.ASN1Boolean] at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2174) at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2120) at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981) at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1942) at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1927) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1332) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:888) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5522) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 11 more
解决:
第一步:修改jvm分配的堆空间。没有解决
在需要运行的程序右键选择Run As -> Run Configurations -> 在打开的Run Configurations中找到VM arguments,输入需要设置的jvm参数,比如:-Xms2048M -Xmx2048M ->点击Run即可。
第二步:把项目clean一下,然后remove、add再次启动。没有解决
第三步:在web.xml中加上 metadata-complete="true" ,不让tomcat继续扫描jar包 。没有解决
<web-app metadata-complete="true">
解释见http://qingyuexiao.iteye.com/blog/1886059
第四步:修改tomcat,禁止扫描
更改tomcat配置文件catalina.properties 。 -> tomcat.util.scan.DefaultJarScanner.jarsToSkip=\ 值后面加",*"。
2.Data truncation: Data too long for column 'remark' at row 1
(1)服务器的配置文件
比如tomcat的话,在conf文件下面有,web.xml,server.xml,tomcat-users.xml,context.xml等文件,设置编码为uft-8:<?xml version='1.0' encoding='utf-8'?>
(2)数据库的配置文件
比如mysql的my.ini,设置默认的编码为utf-8:default-character-set=utf8。