ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <davidjen...@directvinternet.com>
Subject Re: [JBoss-user] Starting JBoss from ANT
Date Wed, 02 Oct 2002 02:52:21 GMT
I think it is extremely unlikely that you will succeed in getting jboss to
run successfully in the ant vm (I have had bad experiences with the ant
classloaders), and if you fork jboss you might as well have started jboss
first.  Even if you succeed, I would not trust any test results due to the
different operational environment.

I STRONGLY recommend that you use Dains junitejb, which I think Jason just
added to his "blocks" module in HEAD, and you can see examples of in the
cmp2 tests, or just write mbeans that call the local interface methods. 
The mbean technique in particular is really simple, you would have many
running tests by now if you had used it instead of trying to start jboss in
exotic ways.

david jencks

On 2002.10.01 22:38:09 -0400 Dushyant Shrivastava wrote:
> Hi again,
> I have just been trying to figure out what exactly you are doing with
> "spawn". This is what I am doing
> 
>    <!-- ===================================================================
> -->
>    <!-- Starts up JBoss                                                  
>   -->
>    <!-- ===================================================================
> -->
>    
>      <target name="runjboss" depends="init">
> 		<echo message="Starting JBoss (in separate VM)" />
> 		<java classname="org.jboss.Main" 
> 			classpath="${java.home}/../lib/tools.jar;${jboss.home}/bin/run.jar;${jboss.home}/lib/crimson.jar"

> 			dir="${jboss.home}/bin">
> 			<jvmarg value="-   																	Djavax.xml.parsers.DocumentBuilderFactory=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"
> />
> 			<jvmarg value="-Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl"
> />
> 		</java>
> 	     	<echo message="Started JBoss (in separate VM)" />
> 	</target>
> 
>    
>    <!-- ===================================================================
> -->
>    <!-- Compiles the source code                                         
>   -->
>    <!-- ===================================================================
> -->
>    
>      <target name="compile" depends="runjboss">
>       <mkdir dir="${build.classes.dir}"/>
>       <echo message="Compiling test classes" />
> 
> I don't even see the message "Started JBoss",I even tried the "Exec" task
> but still the same. 
> I guess for once it would be nice If we were to get things working in the
> J2EE environment without any hassles :( and it gets even harder when the
> whole development team in the company is new to this environment
> 
> Dushy
> 
> -----Original Message-----
> From: James Higginbotham [mailto:jhigginbotham@betweenmarkets.com]
> Sent: Tuesday, October 01, 2002 9:41 PM
> To: jboss-user@lists.sourceforge.net; ant-user@jakarta.apache.org
> Subject: RE: [JBoss-user] Starting JBoss from ANT
> 
> 
> Right.. What we did was spawn the jboss process, then create an internal
> custom ant tag to watch the jboss log for the microkernel started (since
> it releases the blocking after its initial startup but before deployment
> has occurred. Once the log says that things are ok, we then launch
> junit. Here is a snippt of what we did, but you may have to do your own
> log watcher or similiar check, as I can't release the code (sorry). 
>  
>   <spawn executable="${bmiRoot}/BuildTools/apache/ant/bin/ant.bat">
>    <arg line="-buildfile ${processAntFile}"/>
>    <arg line="java.start.jboss"/>
>   </spawn>
>   <WatchLog filename="${jboss.home}/server/default/log/server.log"
> pattern="Started in" lines="5" timeout="360"/>
>   <echo message="JBoss is up."/>
> 
> James
> 
> 	-----Original Message-----
> 	From: Dushyant Shrivastava [mailto:dushys@yambay.com] 
> 	Sent: Monday, September 30, 2002 11:01 PM
> 	To: ant-user@jakarta.apache.org
> 	Cc: jboss-user@lists.sourceforge.net
> 	Subject: [JBoss-user] Starting JBoss from ANT
> 	
> 	
> 
> 
> 	Hi, 
> 	I had posted a message earlier about running JUnit tests inside
> the same VM as JBoss so as to enable the testing of local interfaces and
> I did get a few responses back. Thanks everyone!
> 
> 	Now one of the most common response was to start Jboss
> environment from within my tests.Hence i started by adding the following
> lines in my build.xml to start JBoss server
> 
> 	. 
> 	   <!--
> =================================================================== --> 
> 	   <!-- Starts up JBoss
> --> 
> 	   <!--
> =================================================================== --> 
> 	   
> 	     <target name="runjboss" depends="init"> 
> 	          <exec dir = "${jboss.home}/bin" 
> 	         executable = "${jboss.home}/bin/run.bat" 
> 	           os = "Windows 2000"> 
> 	          </exec>    
> 	    </target> 
> 
> 	However, now it starts JBoss but then does not execute any tasks
> after this one as JBoss just holds on to the VM. Exec task does not
> support the FORK option either, but in any case I do not wish to use the
> fork option as it will beat the whole purpose of running the tests
> inside the same JVM as JBoss. Does anyone has any idea how to get around
> this problem?
> 
> 	P.S I know Cactus is one of the way out but at the moment, my
> project team is not too keen on trialling out another new tool and Junit
> would be the easiest way for our implementation.
> 
> 	In short I would apprecate if anyone has already done this and
> could give me specific directions or advise me on how to run the JUnit
> tests inside the same VM as JBoss so that I can test my local interfaces
> as well!
> 
> 	Also attached is my build.xml file for anyone who wants to
> investigate this further, 
> 
> 	Thanks a lot in advance, 
> 
> 	Cheers 
> 	Dushy 
> 	______________________
> 	DUSHYANT SHRIVASTAVA
> 	Software Engineer
> 	
> 	YAMBAY
> 	
> 	tel      +61 (0) 8 9323 6999
> 	mob  +61 (0) 402 902 652
> 	fax     +61 (0) 8 9325 2688
> 	web   www.yambay.com 
> 	
> 	Yambay Technologies Pty Ltd
> 	7th Floor, The Victoria, 14-16 Victoria Ave, Perth. WA, 6000,
> Australia
> 	
> ________________________________________________________________________
> _________________________
> 	
> 	This message and any files transmitted with it are confidential
> and are intended solely for the use of those persons to
> 	whom the message is addressed. If you have received this message
> in error, please destroy and delete this
> 	message from your computer. Any unauthorised form of
> reproduction of this message or any files transmitted with
> 	it is strictly prohibited. yambay does not make any warranty
> concerning the security of any information electronically
> 	transmitted and disclaims all liability for the proper and
> complete transmission of any information contained or purportedly
> 	contained in this message, nor for any delay in its receipt. If
> you receive this message in error please notify the sender.
> 	
> ________________________________________________________________________
> _________________________ 
> 	<<build.xml>> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
> 
> 
> 

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message