进来的看官使用的是win7吧?!是64位的吧!?安装了myeclipse 2017!
造成的影响是maven项目没办法自动编译,发布内容缺失,项目无法正常启动,搞的好纠结!
稍后上图!!
解决方法:
Window-Preferences-Team-SVN,在SVN接口的下拉框可以看到,默认选择的是JavaHL(JNI) NotAvailable,手动更改为SVNKit(PureJava) SVNKit v1.3.5.7406,OK,enjoy it!
错误提示框:
修改前:
修改后:
---------------------------------------------------------------------------------------------------------------------------------------------
同时期其他错误:
jar丢失,提示看不懂,问题原因如下,maven包没导入
报错如下:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].
StandardContext[/ahjtxx-web]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1107)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1019)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:409)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1551)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:284)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:976)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1439)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:110)
at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:262)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:88)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:64)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:328)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:778)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5095)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 38 more
Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.Resource
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1275)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1109)
... 51 more
四月 11, 2017 6:39:02 下午 org.apache.catalina.startup.HostConfig deployDirectory
严重: Error deploying web application directory E:\server\apache-tomcat-9.0.0.M19\webapps\ahjtxx-web
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ahjtxx-web]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1107)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1841)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1019)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:409)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1551)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:284)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:976)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1439)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
总结:根据错误提示确定问题源的能力严重不足!
关联错误:
四月 11, 2017 3:50:38 下午 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.31 using APR version 1.4.8.
......
四月 11, 2017 3:50:40 下午 org.apache.catalina.startup.SetContextPropertiesRule begin
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ahjtxx-web' did not find a matching property.
四月 11, 2017 3:50:41 下午 org.apache.catalina.core.ContainerBase addChildInternal
严重: ContainerBase.addChild: start:org.apache.catalina.LifecycleException: Failed to start component [StandardEngin
e[Catalina].StandardHost[localhost].StandardContext[/ahjtxx-web]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1861)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Unable to complete the scan for anno
tations for web application [/ahjtxx-web] due to a StackOverflowError. Possible
root causes include a too low setting for -Xss and illegal cyclic inheritance de
pendencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1E
ncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.
ASN1EncodableVector]
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2126)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2072)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1947)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1913)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1898)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
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:5380)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
四月 11, 2017 3:50:41 下午 org.apache.catalina.startup.HostConfig deployDescriptor
严重: Error deploying configuration descriptor E:\apache-tomcat-7.0.56\conf\Catalina\localhost\ahjtxx-web.xml
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catal
ina.LifecycleException: Failed to start component [StandardEngine[Catalina].Stan
dardHost[localhost].StandardContext[/ahjtxx-web]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1861)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
四月 11, 2017 3:50:41 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deployment of configuration descriptor E:\apache-tomcat-7.0.56\conf\Catalina\localhost\ahjtxx-web.xml has finished in 1,198 ms
......
信息: Deployment of web application directory E:\apache-tomcat-7.0.56\webapps\ROOT has finished in 100 ms
四月 11, 2017 3:50:43 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
四月 11, 2017 3:50:43 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
四月 11, 2017 3:50:43 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 3112 ms
--------------------------------------------------以下文章为转载--------------------------------------------------
使用tomcat 7.0.3x版本的同学可以发现tomcat启动慢了不少,而且还可能遇到如下启动时异常:
Unable to complete the scan for annotations for web application [] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies.
tomcat7.0.3X版本支持servlet3.0的特性,比如说支持@WebServlet、@WebListener,要支持这些特性,tomcat就得去扫描所有的jar包里面的每个类。这个异常表明在扫描jar包的时候,递归调用太深,导致栈溢出了,tomcat给了一个馊主意,让你增大xss,这个还是不好,xss加大了,可用线程数就少了。
分析tomcat源代码,发现它扫描的流程如下:
1.扫描所有jar包
2.通过查找jar包中META-INF/services/javax.servlet.ServletContainerInitializer文件内的定义,初始化ServletContainerInitializer实现
3.如果web.xml中配置了metadata-complete="true" 或者没有找到ServletContainerInitializer实现,都不会继续扫描jar包
网上大多数的答案的都是说在web.xml中加入了metadata-complete="true"就能避免这个异常。确实在很多场景下,这个异常是能够避免。但是使用spring-web-3.1.0.RELEASE的同学就杯具了,这个jar包中定义了一个ServletContainerInitializer,还是导致了扫描jar包。
我们可以用另外的办法来解决这个问题,我们让tomcat不扫描指定的jar包,tomcat就要轻松得多了,org.apache.tomcat.util.scan.StandardJarScanner中定义了defaultJarsToSkip,有了这个东东,我们就可以跳过某些jar包。
如果你不想使用servlet3.0 annotation支持,在tomcat的catalina.properties配置文件中tomcat.util.scan.DefaultJarScanner.jarsToSkip的值后面加一个",*",这样就不会扫描所有的jar包了。启动更快,也不会出异常。
tomcat在处理扫描是还有个小bug,比如我遇到了
SEVERE: Unable to process Jar entry [__MACOSX/cn/****/._HandlerFactory.class] from...
这是tomcat在扫描到以.class为后缀的文件后,就分析类,很明显,此文件都不是java类文件。tomcat不应该只判断后缀为.class就是java类文件。
总结:找不到头绪!