声明:ant,weblogic 都用的是weblogic自带的jdk1.4
1, 运行-cmd-ant,javac 就报内存溢出
F:/eclipse/workspace/cis-ar>ant
Buildfile: build.xml
init:
build.init:
biz.build.dbg:
build.dbg.init:
init:
build.init:
[touch] Creating F:/eclipse/workspace/biz/out/biz-wq.201001281022
sharec:
[javac] Compiling 3306 source files to F:/eclipse/workspace/biz/out/share
build.xml--右键--ant.... 打包success.
elcipse中ant打包时内存溢出的解决方法:
设置其参数设置见我上一篇日志。
2,在webloic8.1中发布:
<2010-1-28 上午10时09分39秒 CST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating Deploy task for application cis-gl.>
<2010-1-28 上午10时09分39秒 CST> <Error> <Deployer> <BEA-149201> <Failed to complete the deployment task with ID 1 for the application cis-gl.
weblogic.management.DeploymentException:
Exception:weblogic.management.ApplicationException: activate failed for biz-ejb.jar
Module: biz-ejb.jar Error: Exception activating module: EJBModule(biz-ejb.jar,status=PREPARED)
本文转之http://blog.csdn.net/newjll/article/details/5264355
Unable to deploy EJB: CustPODAOEJB from biz-ejb.jar:
java.lang.OutOfMemoryError
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2423)
at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2138)
at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2237)
at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2132)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2384)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.management.ManagementException: - with nested exception:
[weblogic.management.DeploymentException:
Exception:weblogic.management.ApplicationException: activate failed for biz-ejb.jar
Module: biz-ejb.jar Error: Exception activating module: EJBModule(biz-ejb.jar,status=PREPARED)
Unable to deploy EJB: CustPODAOEJB from biz-ejb.jar:
java.lang.OutOfMemoryError
]
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2396)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
>
解决方法:
来自:http://blog.csdn.net/chasnoly/archive/2009/02/16/3894919.aspx
一:WebLogic配置问题:
由于WebLogic的配置问题,我们的测试出现了失败情况。原因是为WebLogic分配的内存太少了。通过修改commom/bin/commEnv.cmd文件来增加内存分配。
修改的部分如下:
:bea
if "%PRODUCTION_MODE%" == "true" goto bea_prod_mode
set JAVA_VM=-jrockit
set MEM_ARGS=-Xms768m -Xmx1024m
set JAVA_OPTIONS=%JAVA_OPTIONS% -Xverify:none
goto continue
:bea_prod_mode
set JAVA_VM=-jrockit
set MEM_ARGS=-Xms768m -Xmx1024m//原来是128M~256M,太小了,数据太大
goto continue
结果修改后,没有效果。还是有失败的情况。
发现,原来,在:bea下面还有一段配置信息如下:
:sun
if "%PRODUCTION_MODE%" == "true" goto sun_prod_mode
set JAVA_VM=-client
set MEM_ARGS=-Xms768m -Xmx1024m -XX:MaxPermSize=256m
set JAVA_OPTIONS=%JAVA_OPTIONS% -Xverify:none
goto continue
:sun_prod_mode
set JAVA_VM=-server
set MEM_ARGS=-Xms768m -Xmx1024m -XX:MaxPermSize=256m
goto continue
将这里的内存分配修改后见效。
原因是,上面对第一段代码是为bea自己的JVM设置的,下面的是为Sun的设置的。而WebLogic默认的是Sun的,所以出了毛病。
-------------------------另注:------------------------------
startWeblogic.cmd
文件中调用的是 commEnv.cmd,
在此文件中设定内存大小,可以生效。
call "%WL_HOME%/common/bin/commEnv.cmd"
问题解决了。
[javac] The system is out of resources.
[javac] Consult the following stack trace for details.
[javac] java.lang.OutOfMemoryError
BUILD FAILED
file:F:/eclipse/workspace/biz/src/build.xml:150: Compile failed; see the compile
r error output for details.
Total time: 7 seconds
F:/eclipse/workspace/cis-ar>
方法:
http://blog.csdn.net/pengchua/archive/2008/07/04/2611065.aspx
在javac的选项里增加 fork="true" memoryMaximumSize="512m"来加在编译时的内存
用eclipse 开发,在用ant编译web工程时,碰到java.lang.OutOfMemoryError: Java heap space异常
解决办法:
方法1、window->preferences->java->installed jres->edit jre 把default vm arguments 的参数设为-Xms64m -Xmx512
方法2、在window的环境变量中添加JAVA_OPTS=-Xms64m -Xmx512 问题解决
源文档 <http://liuguofeng.iteye.com/blog/1171793>