部署EJB的时候的一个错误:Compiler failed executable.exec at ......

来源:互联网 发布:adp数据对黄金的 编辑:程序博客网 时间:2024/06/05 08:50

部署EJB的时候碰到的一个这样的错误:

java.io.IOException: Compiler failed executable.exec at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:469) at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:328) at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:336) at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:270) at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476) at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:407) at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:493) at weblogic.ejb20.deployer.EJBDeployer.compileJar(EJBDeployer.java:784) at weblogic.ejb20.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:700) at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1339) at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:498) at weblogic.j2ee.J2EEApplicationContainer.prepareModule

解决方案:

This problem is caused by the way WebLogic calls javac to compile the generated classes for the EJBs deployment. This became a big problem for our project with 50 Entity EJBs 2.0 with CMP/CMR, about 15 EJB-QL statements, 3 MDB and 8 Session EJB. I think that these numbers are limits, so exceeding any of these numbers cause javac to exhaust the memory it allocates by default. Even the WebLogic 8.1.Server's administarion console allows you to supply additional parameters for RMI and EJB compilers, it does not allow to supply the -J-Xmx256M (or more) option needed to increase the memory javac allocates.

Thus:
1. In the active $JAVA_HOME/bin of the Server create the file:
Windows:
javac1.cmd Containing:

javac -J-Xmx256M %*


Linux:
javac1.sh Containing:

#!/bin/bash
javac -J-Xmx256M $*

make it "executable"

NOTE: startWeblogic script sets it own JAVA_HOME, so check it first.

2. In the administraitve console of WebLogic 8.1 Server select the server in the left frame under the
<Domain> / Servers branch. In the right frame select the General tab.

3. In the Java Compiler box change javac to javac1.cmd or javac1.sh respectively. No restart is needed.

 


 

Are you sure that javac is in your path?

You might want to run weblogic.ejbc on your jar prior to deployment.

-- Rob


 

Jyoti...

Try to specify Java compiler path that will be used to compile the EJB module (like "C:/bea/jrockit81sp3_142_04/bin/javac.exe" as aJava Compiler) under Compiler Options in the Configuration.

I had a similar issue and could able to resolve it by doing that...

Go FirmSoft...

原创粉丝点击