Thanks, Keith. I've rebuilt it using exec, and now I get this:
- % #1: (DONP)LIST/STDERR ON SYSTEM (Records: 1-6 of 6)
BUILD FAILED
/-/JAVATEST2/DIR/DONP/SPEC/build.xml:407: Class
org.apache.tools.ant.types.Comma
ndline$Argument doesn't support the nested "arg" ele
ment
----- End of (DONP)LIST/STDERR ON SYSTEM -----
And my build.xml has this:
<exec executable="/-/${JAVA_PACK}/OBJECT/JAVA">
<arg value="-cp"/>
<arg value="${JDBC_CLASSPATH}:${CLASSPATH}"/>
<arg value="-Dspecjappserver.home=${JAS_HOME}"/>
<arg value="${LoadPkg}.Load${Domain}">
<arg value="${SCALE}"/>
</exec>
Does anyone know what this is all about?
Don Payette
>THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
PROPRIETARY MATERIAL and is thus for use only by the intended recipient.
If you received this in error, please contact the sender and delete the
e-mail and its attachments from all computers.
-----Original Message-----
From: Keith Hatton [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 9:50 AM
To: Ant Users List
Subject: RE: IllegalAccessException
<exec>, though it might not work if your OS is particularly obscure.
>> Remember, I'm new to ant.
Remember, There's a Fine Manual.
http://ant.apache.org/manual/index.html
-----Original Message-----
From: Payette, Don J [mailto:[EMAIL PROTECTED]
Sent: 10 March 2005 15:44
To: Ant Users List
Subject: RE: IllegalAccessException
Yes, the class is public. Could it be that main is static?
This class is normally run from the command line, ala:
c:>javaw.exe -cp <classpath> -DJAVA_HOME=C:\Java
org.spec.jappserver.load.LoadCorp 10");
Then the "main" argv parameter will have "10". The build.xml does the
following:
<target name="_loaddb" depends="load">
<property name="LoadPkg" value="org.spec.jappserver.load"/>
<property name="Domain" value="Ords"/>
<java classname="${LoadPkg}.Load${Domain}" fork="true">
<jvmarg value="-Dspecjappserver.home=${JAS_HOME}"/>
<arg value="${SCALE}"/>
<classpath>
<pathelement path="${JDBC_CLASSPATH}"/>
<pathelement path="${CLASSPATH}"/>
<pathelement location="jars/load.jar"/>
</classpath>
</java>
</target>
However, on my system, the <java> call fails because it can't find java.
On our mainframe, java HAS to be run as a command line, it can't be done
just as a class call. So I changed it to fork="false" so it uses the
JVM that ant is running under. Now I'm getting the current problem.
Apparently I need to do something like the following. Remember, I'm new
to ant.
:-)
<runExe name="javaw.exe"
<arg value="-cp ${JDBC_CLASSPATH}:${CLASSPATH}:jars/load.jar
-DJAVA_HOME=$(JAVA_HOME) ${LoadPkg}.Load${Domain} ${SCALE}">
</runExe>
Is there an ant action such as the one I invented above - runExe? For
the line <property name="Domain" value="Ords"/>, should I just do
-DDomain=Ords?
As an aside, does XML have a way to split wide quoted strings onto two
or more lines? Maybe something like
<arg value="-cp ${JDBC_CLASSPATH}:${CLASSPATH}:jars/load.jar " +
"-DJAVA_HOME=$(JAVA_HOME) " +
"${LoadPkg}.Load${Domain} ${SCALE}">
TIA,
Don Payette
>THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
PROPRIETARY MATERIAL and is thus for use only by the intended recipient.
If you received this in error, please contact the sender and delete the
e-mail and its attachments from all computers.
-----Original Message-----
From: Stefan Bodewig [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 1:02 AM
To: [email protected]
Subject: Re: NoClassDefFoundError
On Wed, 9 Mar 2005, Don J. Payette <[EMAIL PROTECTED]> wrote:
> This is an interesting one (at least to me). Ant is attempting to
> call LoadCorp (as can be seen from my stdout). It gets an
> IllegalAccessException. Inside LoadCorp is a "main" that looks like
> this:
>
> public static void main(String [] argv) throws Exception {
>
> What is ant's problem?
Is the class itself public?
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]