Problem packing with ant

Guys,

I'm having a hard time packing a J2ME application w/ ant.

The scenario is this: my ant does all the job right (compile, preverify, and package w/o warnings or errors). Though, when I deploy and run it on my Nokia 6230 (or emulator) I get the following error message:

java/lang/VerifyError: net/benhui/btgallery/spp_gui/SPP_MIDlet

The funny thing is that when I create a package w/ the EclipseME plug-in, the application runs smoothly.

I would really appreciate if anyone could take a look on the following ant script, and point out what I might be getting wrong.

Regards,

Mercor

<path id="project.classpath">

<pathelement location="lib/jsr082.jar"/> <!-- [jsr082] -->

<pathelement location="lib/cldcapi11.jar"/> <!-- [cldcapi11] -->

<pathelement location="lib/midpapi20.jar"/> <!-- [midpapi20] -->

</path>

<property name="project.classpath" refid="project.classpath"/>

<target name="init" >

<mkdir dir="${TARGET_DIR}"/>

</target>

<target name="compile" depends="init" >

<mkdir dir="${TARGET_DIR}/classes"/>

<javac srcdir="${SRC_DIR}" destdir="${TARGET_DIR}/classes" source="1.3" target="1.1">

<bootclasspath refid="project.classpath"/>

</javac>

</target>

<target name="preverify" depends="compile">

<mkdir dir="${TARGET_DIR}/preverified"/>

<exec executable="${J2ME_HOME}/bin/preverify">

<arg line="-classpath ${project.classpath}"/>

<arg line="-d ${TARGET_DIR}/preverified"/>

<arg line="${TARGET_DIR}/classes"/>

<arg line="-target CLDC1.1"/>

</exec>

</target>

<target name="jar" depends="preverify">

<mkdir dir="${TARGET_DIR}/dist"/>

<jar basedir="${TARGET_DIR}/classes" jarfile="${TARGET_DIR}/dist/BenhuiMIDlet.jar" >

<manifest>

<attribute name="MIDlet-Version" value="1.0.0"/>

<attribute name="MIDlet-Vendor" value="Midlet Suite Vendor"/>

<attribute name="MIDlet-Jar-URL" value="BenhuiMIDlet.jar"/>

<attribute name="MicroEdition-Configuration" value="CLDC-1.1"/>

<attribute name="MicroEdition-Profile" value="MIDP-2.0"/>

<attribute name="MIDlet-1" value="SPP_MIDlet,,net.benhui.btgallery.spp_gui.SPP_MIDlet"/>

<attribute name="MIDlet-Name" value="Midlet Suite"/>

</manifest>

</jar>

<copy file="util/BenhuiMIDlet.jad" tofile="${TARGET_DIR}/dist/BenhuiMIDlet.jad"/>

</target>

[3849 byte] By [Mercora] at [2007-10-3 3:13:55]
# 1

Hey,

It looks like you are not using the preverified sources when building the jar...

your call to preverify places the verified sources in ${TARGET_DIR}/preverified

but your jar is grabbing from ${TARGET_DIR}/classes

also check out antenna, adds some useful ant tasks...

-Maurice

mcarrona at 2007-7-14 21:04:59 > top of Java-index,Java Mobility Forums,Java ME Technologies...