ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bowman, Michael W. (MBOWMAN)" <MBOW...@arinc.com>
Subject RE: Problems running CORBA program with ant
Date Thu, 09 Jan 2003 21:41:04 GMT
That did the trick. Thanks you.

> -----Original Message-----
> From: M. Erik Husby [mailto:mhusby@genome.wi.mit.edu]
> Sent: Thursday, January 09, 2003 4:38 PM
> To: Ant Users List
> Subject: Re: Problems running CORBA program with ant
> 
> 
> The problem is that your really have 4 command line arguments to your 
> program.not two as you have specified.
> Put each item in its own <arg>
> 
> 
> Bowman, Michael W. (MBOWMAN) wrote:
> 
> >Thanks for the replies.
> >
> >The problem appears to be related to the double quotes that 
> ant puts around
> >my arguments. This is what I got:
> >
> >Ant version 1.4.1 compiled on October 11 2001
> >Buildfile: build.xml
> >Detected Java version: 1.4 in: /usr/local/j2sdk1.4.1_01/jre
> >Detected OS: Linux
> >parsing buildfile /home/mbowman/javaDce1.1/build.xml with URI =
> >file:/home/mbowman/javaDce1.1/build.xml
> >Project base dir set to: /home/mbowman/javaDce1.1
> > [property] Loading /home/mbowman/javaDce1.1/build.properties
> > [property] Override ignored for compile.debug
> > [property] Override ignored for compile.deprecation
> > [property] Override ignored for compile.optimize
> >Build sequence for target `test1' is [test1]
> >Complete build sequence is [test1, todo, clean, init, 
> compile, javadocs,
> >run]
> >
> >test1:
> >     [echo] Using -ORBInitialHost spoonrest
> >     [echo] Using -ORBInitialPort 12345
> >     [java] Forking /usr/local/j2sdk1.4.1_01/jre/../bin/java 
> -classpath
> >/home/mbowman/javaDce1.1/classes Test1 "-ORBInitialHost spoonrest"
> >"-ORBInitialPort 12345"
> >     [java] args: -ORBInitialHost spoonrest -ORBInitialPort 12345 
> >     [java] Initialized orb
> >     [java] Exception thrown org.omg.CORBA.COMM_FAILURE:   
> vmcid: SUN  minor
> >code: 201  completed: No
> >
> >BUILD SUCCESSFUL
> >
> >Total time: 2 seconds
> >
> >The quotes don't show up when I list the arguments from 
> within the program,
> >but their presence causes the program to fail, even from the 
> command line.
> >Can I tell ant to omit the quotes?
> >
> >  
> >
> >>-----Original Message-----
> >>From: Sebastien BLANC [mailto:Sebastien.Blanc@alcatel.com]
> >>Sent: Thursday, January 09, 2003 4:01 PM
> >>To: Ant Users List
> >>Subject: Re: Problems running CORBA program with ant
> >>
> >>
> >>use ant -v (verbose) to see the exact command that ant is lanching.
> >>copy paste into a shell script and see wat's ur pb.
> >>
> >>check if the ORB.init is not a blocking call, it may be that 
> >>some of ur port
> >>nbrs are still open (when do u shutdown the ORB) ?
> >>
> >>seb.
> >>
> >>"Bowman, Michael W. (MBOWMAN)" wrote:
> >>
> >>    
> >>
> >>>Hello all,
> >>>
> >>>I'm having problems running a simple test program using the 
> >>>      
> >>>
> >>Java 1.4.1_01
> >>    
> >>
> >>>implementation on Linux.
> >>>
> >>>The small test program looks like this:
> >>>
> >>>//Test1.java
> >>>import org.omg.CosNaming.*;
> >>>import org.omg.CORBA.*;
> >>>import java.util.*;
> >>>
> >>>public class Test1 {
> >>>   public static void main(String[] args) {
> >>>      System.out.print("args: ");
> >>>      for(int i = 0; i < args.length; i++) {
> >>>         System.out.print(args[i] + " ");
> >>>      }
> >>>      System.out.println("");
> >>>      try {
> >>>         ORB orb = ORB.init(args, null);
> >>>         System.out.println("Initialized orb");
> >>>         String[] services = orb.list_initial_services();
> >>>         System.out.println("Got list of services:");
> >>>         for(int i = 0; i < services.length; i++) {
> >>>            System.out.println("  " + services[i]);
> >>>         }
> >>>      } catch(Exception e) {
> >>>         System.out.println("Exception thrown " + e);
> >>>      }
> >>>   }
> >>>}
> >>>
> >>>All this is doing is listing the initial services available 
> >>>      
> >>>
> >>when the orb is
> >>    
> >>
> >>>started.
> >>>
> >>>When I run this from the command line using:
> >>>   java Test1 -ORBInitialHost spoonrest -ORBInitialPort 12345
> >>>I get:
> >>>   args: -ORBInitialHost spoonrest -ORBInitialPort 12345
> >>>   Initialized orb
> >>>   Got list of services:
> >>>     ServerActivator
> >>>     ServerLocator
> >>>     NameService
> >>>     InitialNameService
> >>>     ServerRepository
> >>>     TNameService
> >>>     RootPOA
> >>>     CodecFactory
> >>>     DynAnyFactory
> >>>     POACurrent
> >>>     PICurrent
> >>>
> >>>Everythink works OK. But, when I use the following Ant task:
> >>>   <target name="test1">
> >>>      <echo message="Using -ORBInitialHost ${cosname.host}"/>
> >>>      <echo message="Using -ORBInitialPort ${cosname.port}"/>
> >>>      <java fork="true" classname="Test1">
> >>>         <classpath refid="run.classpath"/>
> >>>         <arg value="-ORBInitialHost ${cosname.host}"/>
> >>>         <arg value="-ORBInitialPort ${cosname.port}"/>
> >>>      </java>
> >>>   </target>
> >>>
> >>>I get:
> >>>   Buildfile: build.xml
> >>>
> >>>   test1:
> >>>     [echo] Using -ORBInitialHost spoonrest
> >>>     [echo] Using -ORBInitialPort 12345
> >>>     [java] args: -ORBInitialHost spoonrest -ORBInitialPort 12345
> >>>     [java] Initialized orb
> >>>     [java] Exception thrown org.omg.CORBA.COMM_FAILURE:   
> >>>      
> >>>
> >>vmcid: SUN  minor
> >>    
> >>
> >>>code: 201  completed:    No
> >>>
> >>>   BUILD SUCCESSFUL
> >>>
> >>>   Total time: 3 seconds
> >>>
> >>>You can see that the program is getting the command line 
> >>>      
> >>>
> >>arguments from Ant
> >>    
> >>
> >>>correctly. The Ant properties appear to be set up 
> >>>      
> >>>
> >>correctly. Does anyone
> >>    
> >>
> >>>have any idea why this doesn't work?
> >>>
> >>>Thanks in advance for the help.
> >>>---------------------------------
> >>>Michael Bowman
> >>>mbowman@arinc.com
> >>>(410) 266-4876
> >>>
> >>>--
> >>>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>
>
>--
>To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>  
>

-- 
Erik Husby
Group Lead for Software Quality Automation
Whitehead Institute/MIT Center for Genome Research
320 Charles St
Cambridge, MA 02141-2023
mobile: 781.354.6669
office: 617.258.9227
mhusby@genome.wi.mit.edu




--
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