ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roche Ian <>
Subject RE: Java compile command
Date Fri, 27 Oct 2000 12:54:40 GMT

I discovered that I was using version 1.1 of ANT so I upgraded to
1.2 and made the necessary changes to the build.xml file.
This actually solves the problem. I can now start the 
RMI service and it binds correctly to the registry but the ANT
process never terminates. It seems that ANT gets stuck between
terminating the spawned process and terminating its own process.
I used the following code to start the class:

<target name="start" depends="compile">
  <property name="codebase.jar"
  <property name="security.policy"
  <property name="db.driver"
  <java classname=""

     fork="yes" >
     <classpath refid="project.lib.path" />  
     <arg value="IdServer" /> 
     <jvmarg line ="${codebase.jar} ${security.policy} ${db.driver} />

Above I had to set the fork value to ensure that the a new JVM is spawned
and that 
jvm args were used. The spawning is not the problem as I have tested other
classes with a main in them
and they terminate both the spawned process and ANT's process after the main
finished. By saying finished I mean that the main method and java process
after doing all it was supposed to do. To try to terminate the class
I add a System.exit(0) to the end of the main. This has the effect of
terminating both the 
forked process and ANT's own process. But this seems to remove the object
from the Rmi Registry so it
is in effect useless. The end of it all is not bad. It means that to run the
I must leave the cmd window (as I am working on NT) open that bound the
object to the registry.
This is fine here as I am only binding one class. It could cause problems
when I am starting many classes that bind to the registry.


> -----Original Message-----
> From:	Conor MacNeill []
> Sent:	26 October 2000 23:34
> To:
> Subject:	RE: Java compile command
> Ian,
> What exactly do you mean by "the main is finished". When ant forks a JVM,
> it
> waits for the JVM to terminate before continuing. Perhaps the term fork is
> misleading here.
> Conor
> --
> Conor MacNeill
> Cortex eBusiness
> > -----Original Message-----
> > From: Roche Ian []
> > Sent: Friday, 27 October 2000 1:40
> > To: ''
> > Subject: Java compile command
> >
> >
> > Hi,
> >
> > I use Ant for compiling and running rmi classes.
> > I run the RMI service (UnicastRemoteObject that contains
> > a main) using Ants forking of the JVM with my own classpath and
> > parameters.
> > The problem seems to be that Ant does not terminate when the main
> > is finished. I added a system.exit(0) command
> > at the end of the main to try and ensure termination of the forked
> > process but this does not work as the rmi object seems to be
> > unbound from the registry as a result of this.
> >
> > Any help would be great.
> >
> > Ian
> >
> >

View raw message