• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem packing with ant

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From a quick glance, it may be that the jar is built from the ${TARGET_DIR}/classes and not from ${TARGET_DIR}/preverified.

I also use ant to package my midlets. Here is the preverify step from one of the build scripts:



In the example above, the jar is created first and the preverify step processes the jar file.
 
Mercor Fitzpatrick
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rashid!

I really appreciate the time you took taking a glance at my script... it helped MUCH more than the many hours I had spent in vain searching the web.

Regards,
Mercor
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic