ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 973] New - Java task fails to pass args and classpath correctly
Date Wed, 14 Mar 2001 16:03:37 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=973

*** shadow/973	Wed Mar 14 08:03:36 2001
--- shadow/973.tmp.12281	Wed Mar 14 08:03:36 2001
***************
*** 0 ****
--- 1,89 ----
+ +============================================================================+
+ | Java task fails to pass args and classpath correctly                       |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 973                         Product: Ant                     |
+ |       Status: NEW                         Version: 1.3                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version:                         |
+ |     Priority: Medium                    Component: Core tasks              |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: cgay@vsegroup.com                                            |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ I am using Ant's <java> task to generate EJB stubs and skeletons via the JOnAS 
+ container's GenIC tool.  When using the nested <arg> and <classpath> elements
I 
+ am unable to get Ant to work.  
+ 
+ It appears that 2 problems occur:
+ 1. When I specify more than one argument for the invoked class (i.e. "-d
+    ${build.classes} ${conf}/vit2.xml") as a single <arg> element or individual
+    <arg> elements, I receive a classpath error claiming it cannot find the
+    file "-d c:\projects\belo\velocit2\build\classes 
+ c:\projects\belo\velocit\confvit2.xml".
+ 2. If I did not specify a destination directory for GenIC using the -d option 
+ (so I provided only <arg value="${conf}/vit2.xml"/>), then it will find the xml 
+ file, but then fail later on in the generation process due to a classpath issue 
+ when it cannot find some of the generated stubs.  Using the -verbose option for 
+ GenIC, I've noticed that it dies when using the rmic tool.  So it appears the 
+ classpath is not passed to GenIC in a way that it can pass it internally.  This 
+ appears to be a problem with the <classpath> element.
+ 
+ I can invoke from the command line successfully as follows:
+ C:\>java -cp c:\projects\belo\velocit2
+ \build\classes;c:\projects\vse\libs\RMI_jonas.jar 
+ org.objectweb.jonas_ejb.tools.GenIC -d c:\projects\belo\velocit2\build\classes 
+ c:\projects\belo\velocit2\conf\vit2.xml
+ 
+ Similarly, I can successfully use the following Ant task:
+ <target name="stubs-all">
+     <!-- Create the stubs and skeletons -->
+     <java fork="yes" classname="org.objectweb.jonas_ejb.tools.GenIC" 
+     taskname="jonas" failonerror="true" 
+     args="-d ${build.classes} ${conf}/vit2.xml"
+     classpath="${build.classes};${vse.lib}/RMI_jonas.jar"/>
+ </target>
+ 
+ However, the following Ant task fails in mid generation of the stubs due to a 
+ classpath problem:
+ <target name="stubs-all">
+     <!-- Create the stubs and skeletons -->
+     <java fork="yes" classname="org.objectweb.jonas_ejb.tools.GenIC" 
+     taskname="jonas" failonerror="true">
+         <classpath>
+             <pathelement path="${build.classes}"/>
+             <pathelement path="${vse.lib}/RMI_jonas.jar"/>
+         </classpath>
+         <arg value="-d ${build.classes} ${conf}/vit2.xml"/>
+     </java>
+ </target>
+ 
+ Please keep in mind that I tried every variation I could think of: seperate arg 
+ elements, not specifying a -d option for GenIC, setting the classpath via the 
+ java -D option, using the sysproperty element, etc.  In short, I spent 9 hours 
+ on this, and have checked everything I can find on Ant or JOnAS.  I am 
+ reasonably sure this is an Ant problem, though it is possible it is an internal 
+ GenIC/JOnAS issue, so I will also submit this bug report to the latter.
+ 
+ Assumptions:
+ 1. All the EJB descriptor and container xml files are in the conf directory.
+ 2. The following is set up within the build xml file "velocit2_build.xml":
+    <project name="velocit2" default="all" basedir="c:/projects/belo">
+       <property name="build" value="${basedir}/${ant.project.name}/build" />
+       <property name="build.classes" value="${build}/classes" />
+       <property name="conf" value="${basedir}/${ant.project.name}/conf" />
+ 3. I am only using the JOnAS RMI_jonas.jar file, and have no other vestiges of
+    the container on my system - not even an environment variable. I do not use
+    any of its property files or scripts.
+ 4. My Ant start script is unmodified.
+ 5. I invoke my buildfile as follows"
+    c:\> ant -buildfile velocit2_build.xml c:\projects\belo\velocit2
+ \conf\vit2.xml
+ 6. My environment is as follows:
+    JDK:   1.3
+    JOnAS: 2.2.7
+    OS:    Win2000
+    Ant:   1.3

---------------------------------------------------------------------
To unsubscribe, e-mail: ant-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ant-dev-help@jakarta.apache.org


Mime
View raw message