ant-user mailing list archives

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

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"
value="-Djava.rmi.server.codebase=file:/${project.root}/IdLicencingService/c
lasses/"/>
  <property name="security.policy"
value="-Djava.security.policy=${project.root}/IdLicencingService/policy"/>
  <property name="db.driver"
value="-Ddb.driver=com.informix.jdbc.IfxDriver"/>          
      
  <java classname="imtf.ch.IdLicencingService.IdLicenceProviderImpl"

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

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
is 
finished. By saying finished I mean that the main method and java process
ends 
after doing all it was supposed to do. To try to terminate the class
(IdLicenceProviderImpl)
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
class 
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
though 
when I am starting many classes that bind to the registry.

Ian



> -----Original Message-----
> From:	Conor MacNeill [SMTP:conor@ebinteractive.com.au]
> Sent:	26 October 2000 23:34
> To:	ant-user@jakarta.apache.org
> 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
> conor@cortexebusiness.com.au
> Cortex eBusiness
> http://www.cortexebusiness.com.au
> 
> > -----Original Message-----
> > From: Roche Ian [mailto:ian.roche@imtf.ch]
> > Sent: Friday, 27 October 2000 1:40
> > To: 'ant-user@jakarta.apache.org'
> > 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
> >
> >

Mime
View raw message