ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <sbaill...@imediation.com>
Subject RE: Build and Confiuration Managment with Ant... a.k.a. running A nt _ from_ JSP/Servlet
Date Thu, 16 Aug 2001 13:35:54 GMT
np.

And it's Stephane. (ie Stephan, Stefan, Stephen, Steven,...).
No sex surgery planned :-)

-- 
 St├ęphane Bailliez 
 Software Engineer, Paris - France 
 iMediation - http://www.imediation.com 
 Disclaimer: All the opinions expressed above are mine and not those from my
company. 



> -----Original Message-----
> From: Blackard, Robert [mailto:robert.blackard@tgslc.org]
> Sent: Thursday, August 16, 2001 3:31 PM
> To: 'ant-user@jakarta.apache.org'
> Subject: RE: Build and Confiuration Managment with Ant... 
> a.k.a. running
> A nt _ from_ JSP/Servlet
> 
> 
> Stephanie... I apologize... I stated that the reference email 
> was one I
> finally found when, in fact, you were the one that gave it to 
> me in the
> first place.  Sorry... I've been searching the archives and 
> the web for two
> days to find information such as you provided and the general 
> aggravation
> lead me to type before thinking.  Again, I'm sorry.
> 
> > -----Original Message-----
> > From: Blackard, Robert [mailto:robert.blackard@tgslc.org]
> > Sent: Thursday, August 16, 2001 8:27 AM
> > To: 'ant-user@jakarta.apache.org'
> > Subject: RE: Build and Confiuration Managment with Ant... 
> > a.k.a. running
> > A nt _ from_ JSP/Servlet
> > 
> > 
> > Stephane... thanks for the direct feedback, but I have some 
> > comments on this
> > I'd like to share with the group.
> > 
> > First, CruiseContol certainly looks like it's going to 
> > provide most of what
> > I need... I might simply write some extensions and use it 
> rather than
> > developing my own (I haven't looked at it in detail yet, but 
> > I need the
> > ability to select from a set of Projects, target deployment 
> > on one of a set
> > of Servers, deployment to use a specific instance of a 
> > database, deployment
> > using a specific instance of an LDAP server, and build using 
> > a specific
> > labeled version or the latest version [ie. 
> > pre-production/test or nightly
> > builds]).
> > 
> > Now, I'm gettig out my soap box, so feel free to ignore the 
> > rest of this
> > message.
> > 
> > I must disagree with your comment that System.exit() calls 
> > are 'somewhat
> > normal'... yes it might be commonly done, but I don't beleive 
> > it should be
> > and according to the Java specifications it is by no means normal.
> > 
> > The Fathers of Java intentionally and implicitly defined the 
> > main() method
> > to be void.  This wasn't something they just pulled out of 
> > the air, nor was
> > it something that they did because it's how every other 
> > system did it -
> > quite the contrary, this is a departure from the standard 
> > practice and was a
> > very concious decision on their part.
> > 
> > As I understand it, one of the fundamental reasons that the 
> > main() method
> > was defined as void was that not all operating systems 
> > supported result
> > codes.  What Ant, and any other system that uses a 
> > System.exit() is doing,
> > is intentionally violating the defined language.
> > 
> > Further, using a System.exit() anywhere assumes that the 
> > currently executing
> > code is the only code running in the current JVM.  This 
> > should be very well
> > documented in any Installation and Usage documentation, but 
> > also violates
> > the ability of a single JVM to be used to manage multiple executing
> > applications.
> > 
> > That said, the standard argument for using a System.exit() 
> is that it
> > support the use of scripting with tools like a Unix shell or Perl.
> > Certainly, providing an exit code is a means to support this, 
> > but again, not
> > all operating systems support exit codes.
> > 
> > In this mail, and another posting that I finally uncovered
> > http://www.mail-archive.com/ant-dev@jakarta.apache.org/msg0797
> > 5.html, you
> > describe using the Security Manager to trap such behavior.  
> > IMHO I beleive
> > that it sould be the person that expects exit codes, and is 
> therefore
> > seeking behavior different that that defined by the language, 
> > that should be
> > required to customize their environment by using a facility 
> > to generate exit
> > codes, for example, creating a Runner class that catches 
> > exceptions and
> > returns exit codes and executing 
> > org.apache.tools.ant.Main.main() through
> > the Runner class.
> > 
> > Further, since I will not be in control of the final 
> > deployment of my code,
> > and therefore have no control over the security policy that 
> > the main system
> > is running under, assuming that I can simply throw a new 
> > security manager
> > into the mix might (but granted is unlikely) to be a problem. 
> >  While it
> > won't be a problem for me, I imagine it may be a problem for 
> > someone else.
> > 
> > Finally, since I don't expect the definition of
> > org.apache.tools.ant.Main.main() to change since it's out 
> > there in so many
> > places, may I suggest alternatively that you implement the
> > org.apache.tools.ant.Main.run() method that throws 
> > exceptions, and modify
> > org.apache.tools.ant.Main.main() to call 
> > org.apache.tools.ant.Main.run() and
> > generate System.exit(0) if no exception is thrown and 
> > System.exit(1) if an
> > exception is thrown.  That way, those of us that wish to 
> use Ant from
> > another Java process can do so without overriding the 
> > Security Manager.
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Stephane Bailliez [mailto:sbailliez@apache.org]
> > > Sent: Wednesday, August 15, 2001 12:40 PM
> > > To: ant-user@jakarta.apache.org
> > > Subject: Re: Build and Confiuration Managment with Ant... 
> > > a.k.a. running
> > > Ant _ from_ JSP/Servlet
> > > 
> > > 
> > > You might get your hands on cruisecontrol that demonstrate 
> > > how to do this.
> > > About the System.exit(), that's somewhat normal, you have to 
> > > change the
> > > security manager when running Ant.
> > > 
> > > http://cruisecontrol.sourceforge.net
> > > 
> > > Stephane
> > > 
> > > ----- Original Message -----
> > > From: "Duffey, Kevin" <KDuffey@BUYMEDIA.com>
> > > To: <ant-user@jakarta.apache.org>
> > > Sent: Wednesday, August 15, 2001 7:32 PM
> > > Subject: RE: Build and Confiuration Managment with Ant... 
> > > a.k.a. running Ant
> > > _ from_ JSP/Servlet
> > > 
> > > 
> > > > That is a kewl idea! My guess is that the XML is not 
> > > validated right?
> > > > Perhaps WebLogic or whatever is trying to validate it? I 
> > > don't think ANT
> > > > scripts use a DTD do they?
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Blackard, Robert [mailto:robert.blackard@tgslc.org]
> > > > Sent: Wednesday, August 15, 2001 10:29 AM
> > > > To: 'ant-user@jakarta.apache.org'
> > > > Subject: Build and Confiuration Managment with Ant... 
> > > a.k.a. running Ant
> > > > _ from_ JSP/Servlet
> > > >
> > > >
> > > >
> > > > I'm trying to use Ant to provide an automated build an test 
> > > service on a
> > > > testing server.  I've already built Ant scripts (.XML 
> files) that
> > > > perform all the tasks related to the process (get for 
> > > source control,
> > > > compile, package, etc.).
> > > >
> > > > Now I'm trying to provide a web page on the testing 
> server used to
> > > > submit a request to have a build and test cycle started.  
> > I'm using
> > > > JDK1.3.1 on Windows NT 4.0 SP 6, Ant 1.3, WebLogic 6.0 SP2, 
> > > and Xerces
> > > > 1.3.0.
> > > >
> > > > Based on the documentation and my experience with Java, I 
> > > expected to
> > > > have my JSP/Servlet perform the following...
> > > >
> > > > >>>>>>>>>>>>> START <<<<<<<<<<<<<
> > > >     ...
> > > >     String project = request.getParameter( "project" );
> > > >
> > > >     try {
> > > >       String args[] = { "-buildfile", "D:/Development/run.xml",
> > > > "-logfile", "D:/Development/" + project + ".log", "-D" 
> + project +
> > > > ".build", "Build" };
> > > >
> > > >       org.apache.tools.ant.Main.main( args );
> > > >       ....
> > > >     } catch( Exception e ) {
> > > >         ...
> > > >     }
> > > >     ...
> > > > >>>>>>>>>>>>> END <<<<<<<<<<<<<
> > > >
> > > > where the run.xml is
> > > >
> > > > >>>>>>>>>>>>> START <<<<<<<<<<<<<
> > > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > > >
> > > > <project name="run" default="Build" basedir="D:/development">
> > > >
> > > >   <!-- set global properties for this build -->
> > > >   <!-- builder.vss - the VSS directory containing build 
> > scripts -->
> > > >   <property name="builder.vss.xml" value="/Builder/xml"/>
> > > >   <!-- env - the environment prefix -->
> > > >   <property environment="env"/>
> > > >
> > > >   <target name="prepare">
> > > >     <!-- Create the time stamp -->
> > > >     <tstamp>
> > > >       <format property="TIMESTAMP" pattern="MM/dd/yyyy 
> hh:mm a"/>
> > > >     </tstamp>
> > > >     <vssget localPath="${basedir}"
> > > >             login="<user>,<pwd>"
> > > >             vsspath="${builder.vss.xml}/builder.xml"
> > > >             writable="false"/>
> > > >   </target>
> > > >
> > > >   <target name="Proj1" if="Proj1.build" depends="prepare">
> > > >     <ant antfile="${basedir}/builder.xml" target="Proj1"/>
> > > >   </target>
> > > >
> > > >   <target name="Proj2" if="Proj2.build" depends="prepare">
> > > >     <ant antfile="${basedir}/builder.xml" target="Proj2"/>
> > > >   </target>
> > > >
> > > >   <target name="Build" depends="Proj1,Proj2"/>
> > > > </project>
> > > > >>>>>>>>>>>>> END <<<<<<<<<<<<<
> > > >
> > > > I'm getting some odd results, however.
> > > >
> > > > When I run the above run.xml from a command prompt, 
> > everything works
> > > > fine.  When I trigger the JSP running in WebLogic, I get 
> > > the following
> > > > .LOG file
> > > >
> > > > >>>>>>>>>>>>> START <<<<<<<<<<<<<
> > > > Buildfile: D:\Development\run.xml
> > > >
> > > > BUILD FAILED
> > > >
> > > > D:\Development\run.xml:8: Config file is not of 
> expected XML type
> > > >
> > > > Total time: 0 seconds
> > > > >>>>>>>>>>>>> END <<<<<<<<<<<<<
> > > >
> > > > and the WebLogic server is outright terminated without 
> any logs or
> > > > messsages... as if an exit(0) (yea... I had to resort to C 
> > > to describe
> > > > the behavior... sorry) were being called.
> > > >
> > > > I've tried changing the catch clause to detect 
> > RuntimeException and
> > > > Throwable as well as Exception, but whatever is occurring isn't
> > > > triggering a catch.
> > > >
> > > > Has anyone had any experience setting something like this 
> > > up, or seen
> > > > the behavior I'm describing?
> > > >
> > > >
> > > 
> > 
> 

Mime
View raw message