aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes ant rmic task, and running out of stack space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant rmic task, and running out of stack space" Watch "ant rmic task, and running out of stack space" New topic
Author

ant rmic task, and running out of stack space

Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
All,

Ok, so I'm trying to do some rmic tasks in my ant build file. I didn't write the classes in question, by the way....

When it comes across one of the rmic commands, I get the following:

The compiler has run out of stack space. Consider using the "-J-Xss<size>" command line option to increase the memory allocated for the Java stack.

However, when I try to insert the following:
<compilerarg value="-J-Xss128m"/>

I notice that subsequent attempts also fail, but also, right before the same failure message, state the following:
Dropping -J-Xss128M from compiler arguments

Is there something I'm doing wrong? How do I get this to work?

Thanks.
Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
Um, I guess this should actually be moved to the Ant, Maven, and Other Build Tools forum (now that I've belatedly realized there's such a category!)
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3739
    
  16
The compiler argument to change the stack size is actually just -Xss<size>.
The -J part is usually used by programs that call other java programs and basically means pass the parameter value (-Xss<size> in this case) to the other Java program when you call it.
Try
<compilerarg value="-Xss128m"/>


Joanne
Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
no go on that, either... when I remove the -J part of it, I get the following:

[rmic] -Xss128m is an invalid option or argument.
[rmic] Usage: rmic <options> <class names>
[rmic] where <options> includes:
[rmic] -keep Do not delete intermediate generated source files
[rmic] -keepgenerated (same as "-keep")
[rmic] -v1.1 Create stubs/skeletons for 1.1 stub protocol version
[rmic] -vcompat Create stubs/skeletons compatible with both
[rmic] 1.1 and 1.2 stub protocol versions
[rmic] -v1.2 (default) Create stubs for 1.2 stub protocol version only
[rmic] -iiop Create stubs for IIOP. When present, <options> also includes:
[rmic] -always Create stubs even when they appear current
[rmic] -alwaysgenerate (same as "-always")
[rmic] -nolocalstubs Do not create stubs optimized for same process
[rmic] -idl Create IDL. When present, <options> also includes:
[rmic] -noValueMethods Do not generate methods for valuetypes
[rmic] -always Create IDL even when it appears current
[rmic] -alwaysgenerate (same as "-always")
[rmic] -g Generate debugging info
[rmic] -nowarn Generate no warnings
[rmic] -nowrite Do not write compiled classes to the file system
[rmic] -verbose Output messages about what the compiler is doing
[rmic] -classpath <path> Specify where to find input class files
[rmic] -bootclasspath <path> Override location of bootstrap class files
[rmic] -extdirs <path> Override location of installed extensions
[rmic] -d <directory> Specify where to place generated class files
[rmic] -J<runtime flag> Pass argument to the java interpreter

So, judging by that last line, it seems -J is required. But how to get it to not drop the argument is still baffling me.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

You set the tack size to 128m (megabytes)? Ouch. Try using 128k (kilobytes) instead. If that doesn't work, read on.

Please post the following:
a) the entire contents of the ant target that includes the rmic task. Also supply the values for any properties used.
b) The full console output for that target.

Also, are you forking the rmic? If not, you need to change the stacksize for Ant itself. Try setting this env var:

ANT_OPTS=-Xss256k


JBoss In Action
Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
Ugh, I should've mentioned that I'm doing this via Eclipse rather than through Ant on the command line.

That said, I did pick 128m rather arbitrarily as I didn't know what was needed.

And, finally, it looks like the need for rmic is probably going away, though I'm still curious as to what the correct solution is on this.


My ORIGINAL rmic task is:


My current rmic task is:


As for source.dir, the only property used, it's:


The whole target is:

But regardless of whether I set Xss to 128m or 128k, I get the same results:
[rmic] RMI Compiling 1 class to E:\myprojectdir
[rmic] -Xss128k is an invalid option or argument.
[rmic] Usage: rmic <options> <class names>
[rmic] where <options> includes:
[rmic] -keep Do not delete intermediate generated source files
[rmic] -keepgenerated (same as "-keep")
[rmic] -v1.1 Create stubs/skeletons for 1.1 stub protocol version
[rmic] -vcompat Create stubs/skeletons compatible with both
[rmic] 1.1 and 1.2 stub protocol versions
[rmic] -v1.2 (default) Create stubs for 1.2 stub protocol version only
[rmic] -iiop Create stubs for IIOP. When present, <options> also includes:
[rmic] -always Create stubs even when they appear current
[rmic] -alwaysgenerate (same as "-always")
[rmic] -nolocalstubs Do not create stubs optimized for same process
[rmic] -idl Create IDL. When present, <options> also includes:
[rmic] -noValueMethods Do not generate methods for valuetypes
[rmic] -always Create IDL even when it appears current
[rmic] -alwaysgenerate (same as "-always")
[rmic] -g Generate debugging info
[rmic] -nowarn Generate no warnings
[rmic] -nowrite Do not write compiled classes to the file system
[rmic] -verbose Output messages about what the compiler is doing
[rmic] -classpath <path> Specify where to find input class files
[rmic] -bootclasspath <path> Override location of bootstrap class files
[rmic] -extdirs <path> Override location of installed extensions
[rmic] -d <directory> Specify where to place generated class files
[rmic] -J<runtime flag> Pass argument to the java interpreter

BUILD FAILED

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

Try:

<compilerarg value="-J-Xss128k"/>

('k' instead of 'm')

You still might try setting ANT_OPTS.
Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
No good with the 128k option either - gives me the same result.

If I try to set ANT_OPTS, would I still do this in the Advanced system settings on a Windows machine? That is, the same way I'd have to do it if I were using Ant from the command line?

Or is it something I explicitly have to tell Eclipse to pass along to Ant?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

Try running ant with the -v option and see if that gives any further hints as to what is going on. It is almost behaving as if rmic doesn't fork a new process, and thus doesn't want any JVM options... Hmm, try setting 'compiler="forking"'.
Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
That would have to be done with command-line Ant, yes? If not, I'm not sure how to do that in Ant through Eclipse.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

Yes, it is easiest to do this from the command line. In Eclipse you would have to set up a custom build or a run command to do this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ant rmic task, and running out of stack space