java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap s

严重: Error waiting for multi-thread deployment of directories to completehostConfig.deployWar=Deploying web application archive {0}
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
	at java.util.concurrent.FutureTask.get(FutureTask.java:83)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1023)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1413)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:313)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:346)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1140)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:785)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)

 一开始我用tomcat7.0就报这个错,但换成tomcat6.0就没问题,网上多说是内存溢出,说设置一下内存就好了,但是我这死活就不好了,还有说是环境变量的问题,这就更不可能了,如果是环境变量的问题,tomcat6.0也会报错的,最后我发现是jdk版本的问题,我一直用的是myeclipse里自带的jdk1.6,这个好像对6.0支持,对7好像有点问题,换成jdk1.7就好了。厄~~,好像扯了一堆没用的。

我的解决方法:选择对应的JDK版本

如:myEclipse中window->preferences->MyEclipse->Servers->Tomcat 6.X->JDK->jdk1.6

 

你可能感兴趣的:(java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap s)