Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ejbc OutOfMemoryError for Weblogic 7.0

4 views
Skip to first unread message

Andrew Beveridge

unread,
Sep 6, 2002, 5:05:00 PM9/6/02
to

I have an ejb-jar file that contains roughly 100 CMP entity beans. There are many
CMR relations between them, so putting them into more than one jar file would
require a redesign of the objects.

Running weblogic.ejbc causes an OutOfMemoryError. From what I can tell, the enhanced
java files are created, but I run out of memory during the compilation.

My machine has 512M RAM, and I have tried increasing the max memory, but still
get the error. I even tried using the -XX:MaxPermSize argument (after searching
the dev2dev archives for similar problems), but I still get the OutOfMemoryError.


Has anyone had a similar problem? It seems like people have deployed hundreds
of beans in a single jar. Will adding more memory solve my problem, or have I
hit a bug?

Any thoughts would be appreciated. Some example stack traces are listed below.

Best Regards,
Andrew

// A simple attempt
C:\p4\main\wms\tmp>java -Dweblogic.home=c:\bea\weblogic700\server weblogic.ejbc
-compiler javac object-ejb-standard.jar foo.jar


The system is out of resources.
Consult the following stack trace for details.

java.lang.OutOfMemoryError
<<no stack trace available>>
Exec failed .. exiting


// An attempt using -XX:MaxPermSize
C:\p4\main\wms\tmp>java -server -XX:MaxPermSize=65536K -Xms32m -Xmx1024m -Dweblo
gic.home=c:\bea\weblogic700\server weblogic.ejbc -compiler jikes objects-ejb-sta
ndard.jar foo.jar
java.io.IOException: CreateProcess: jikes -nowarn -classpath C:\p4\main\wms\tmp\
ejbcgen;C:\p4\main\wms\tmp\o2castor.jar;c:\jdk1.3.1\jre\lib\rt.jar;c:\jdk1.3.1\j
re\lib\i18n.jar;c:\jdk1.3.1\jre\lib\sunrsasign.jar;c:\jdk1.3.1\jre\classes;.;c:\
p4\main\peso\build\webapp;c:\jdk1.3.1\jre\lib\rt.jar;c:\j2sdkee1.3.1\lib\j2ee.ja
r;c:\bea\weblogic700\server\lib\weblogic.jar;c:\p4\main\peso\build\lib\o2ejb.jar
;c:\p4\main\peso\build\lib\o2ejb-client.jar;c:\p4\main\peso\build\lib\test.jar;c
:\p4\main\caf\build\classes;c:\p4\main\caf\lib\log4j.jar;c:\p4\main\caf\lib\log4
j-core.jar;c:\p4\main\caf\lib\commons-logging.jar; -d ejbcgen ejbcgen\com\oxygen
\object\investor\ejb\*.java ejbcgen\com\oxygen\object\user\ejb\*.java ejbcgen\co
m\oxygen\wms\client\ejb\*.java ejbcgen\com\oxygen\wms\contacthistory\ejb\*.java
ejbcgen\com\oxygen\wms\employee\ejb\*.java ejbcgen\com\oxygen\wms\personal\ejb\*
java ejbcgen\com\oxygen\wms\principal\ejb\*.java ejbcgen\com\oxygen\wms\princip
algroup\ejb\*.java ejbcgen\com\oxygen\wms\product\ejb\*.java ejbcgen\com\oxygen\
wms\pD
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:61)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:546)
at java.lang.Runtime.exec(Runtime.java:472)
at java.lang.Runtime.exec(Runtime.java:438)
at weblogic.utils.Executable.exec(Executable.java:208)
at weblogic.utils.Executable.exec(Executable.java:133)
at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvo
ker.java:545)
at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:
372)
at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:
363)
at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:294)
at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:396)
at weblogic.ejbc20.runBody(ejbc20.java:464)
at weblogic.utils.compiler.Tool.run(Tool.java:126)
at weblogic.ejbc.main(ejbc.java:21)
Exec failed .. exiting

Rob Woollen

unread,
Sep 6, 2002, 5:22:37 PM9/6/02
to
I believe the first error (the OutOfMemoryError) is the javac compiler
running out of memory not the java vm you're running for ejbc.

Try something like this:

java weblogic.ejbc -J-mx256M in.jar out.jar

In the jikes case, I'm guessing NT doesn't like the long command-line or
jikes isn't in your path. Try reducing the classpath length or
increasing NT's command-line maximum length.

-- Rob

Andrew Beveridge

unread,
Sep 6, 2002, 7:15:52 PM9/6/02
to

Thanks Rob! You were absolutely right. The -J option does the trick. I even found
it in the online docs:

http://edocs.bea.com/wls/docs61/ejb/EJB_utilities.html#1075296

Now, the bonus question: do you know how specify this argument for the weblogic
server to use when deploying an ejb-jar in "exploded directory format" (where
weblogic runs ejbc itself on the file structure upon deployment). Obviously, I
can work around this if necessary.

Of course you are also right about the 2nd stack trace: that was a cut & paste
error on my part-- sorry.

Thanks for your time!
Andrew

Rob Woollen

unread,
Sep 7, 2002, 5:03:30 AM9/7/02
to
I don't *believe* there's an easy way to set the server-side ejbc
options right now.

One trick is to use a wrapper script that calls javac with the larger
heap size and then specify this wrapper script as your compiler.

0 new messages