ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Holmqvist, IT, Posten" <>
Subject <java> problem when having xerces in manifest Class-Path. HELP!!
Date Thu, 24 Oct 2002 08:35:39 GMT

I have mailed about this once before but since there was no reaction I'll
try again.

It looks like the Class-Path line in the manifest file in a jar is somehow
overridden by ANT.

I have the following manifest file.

Manifest-Version: 1.0
Created-by: Nisse (Posten IT)
Main-Class: se.posten.logistik.applications.taxering.customs.DPDCustoms
Class-Path: xerces-1.3.jar common.jar business.jar

And the following target to execute the application.
  <target name="execute_init" depends="build">
    <property name="exec_loc" value="${temp}/bin"/>
    <property name="prop_file" value="${config}/"/>
    <mkdir dir="${exec_loc}"/>
    <copy file="${common_loc}" todir="${exec_loc}"/>
    <copy file="${business_loc}" todir="${exec_loc}"/>
    <copy file="${xerces13_loc}" todir="${exec_loc}"/>
    <copy file="${jar_file}" todir="${exec_loc}"/>
    <copy file="${prop_file}" todir="${exec_loc}"/>

  <target name="execute" depends="execute_init">
    <java jar="${jar_file}" fork="true">
      <arg value="${prop_file}"/>

As ya'll see all files needed is copied to the bin directory and then the
application is executed with the java command.
As far as I know this should be equal to the java -jar <jar_file> <argument>
command, right?

But when I do and execute everything works fine until the default handler in
xerces is loaded (with reflection i guess), then I get the following
     [java] java.lang.NoClassDefFoundError:
     [java]     at java.lang.ClassLoader.defineClass0(Native Method)
     [java]     at java.lang.ClassLoader.defineClass(
     [java]     at
     [java]     at
     [java]     at$100(
     [java]     at$
     [java]     at
     [java]     at
     [java]     at java.lang.ClassLoader.loadClass(
     [java]     at

     [java]     at java.lang.ClassLoader.loadClass(
     [java]     at

     [java]     at

If I do it without ant i.e. from the command line (java -jar <jar_file>
<argument> in the bin folder everything works just fine.

Has anyone else encountered this problem? Is it a bug in Ant or am I just

Thanks for all your help!

/Christian Holmqvist


Christian Holmqvist

Posten Sverige AB
Posten IT
105 00 Stockholm

Besöksadress: Ekensbergsvägen 113 ,Solna

Tel: 08 - 781 61 48
Mobil: 070 - 985 00 28 

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message