Menu

#75 Preverification error -1072365564

open
nobody
None
5
2009-10-09
2009-10-09
No

Hi,
I am using new Antenna 1.2.0-beta with Java ME SDK 3.0. I have a problem during preverification. I 'm getting error:

[INFO] Preverification failed (result=-1072365564)
[INFO] ----------------------------------------------------------------
[INFO] Trace
Preverification failed (result=-1072365564)
at de.pleumann.antenna.misc.Utility.preverify(Utility.java:566)

I checked your code and I found the reason. At least I think so. In preverify() method you do:

// prepend java bin path to system PATH calling preverify
String env[] = new String[]{
"PATH=" + java_bin + System.getProperty("path.separator") + System.getenv("PATH")
};
Process proc = Runtime.getRuntime().exec(preverify + " " + arguments, env);

I checked this fragment and if I change exec() method to form without env argument everything works ok:

Process proc = Runtime.getRuntime().exec(preverify + " " + arguments);

Probably you invoke version with env arg, because you want to add proper JAVA folder to PATH.
In my opinion you should pass all the system ENV variables together with modified PATH. Then everything will work.

Map<String, String> map = new HashMap<String, String>(System.getenv());
List<String> list = new ArrayList<String>(maps.size());
for (Entry<String, String> e : map.entrySet()) {
list.add(e.getKey() + "=" + e.getValue());
}
// modify PATH
Process exec = Runtime.getRuntime().exec(cmd, list.toArray(new String[0]));

I found that in my case it was 'SystemRoot' env variable that caused a problem. I think that two args exec(...) method works different than one arg. In one arg, all the system variables are passed to child process, in 2-arg you pass only what you declare in table, so it would be safer to copy all variables to table modify PATH position and pass to exec. This problem may depends on operating system.

Discussion

  • Raja Nagendra Kumar

    The same code, i.e running of process with evn variables works fine in wtk 2.5 but not in JavaME SDK 3.0.

    As Tomek pointed out, when evnr is made to null, every thing works both in with 2.5 and sdk 3.0.

    Regards,
    Raja Nagendra Kumar,
    C.T.O
    www.tejasoft.com

     
  • Nobody/Anonymous

    Hello! This is kind of off topic but I need some advice from an established blog. Is it difficult to set up your own blog? I'm not very techincal but I can figure things out pretty fast. I'm thinking about setting up my own but I'm not sure where to start. Do you have any ideas or suggestions? Appreciate it
    cheap north face coats http://tyacvbytzo.wordpress.com/2012/11/08/north-face-pink-ribbon-assad/