You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2012/01/12 06:04:00 UTC

DO NOT REPLY [Bug 52456] New: ant 1.7.1 build J2ME project error: JAR file creation failed with error 32512

https://issues.apache.org/bugzilla/show_bug.cgi?id=52456

             Bug #: 52456
           Summary: ant 1.7.1 build J2ME project error: JAR file creation
                    failed with error 32512
           Product: Ant
           Version: unspecified
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Build Process
        AssignedTo: notifications@ant.apache.org
        ReportedBy: charleybin@gmail.com
    Classification: Unclassified


Environment:
Apache Ant version 1.7.1 compiled on June 27 2008
antenna-bin-1.2.1-beta.jar
OS: Ubuntu 1104 amd64
$locale: zh_CN.GBK


Description:
1, There are some GBK constants defined in java source code file.

2, bash shell environment been sets to support GBK encoding:
LANG=zh_CN.GBK

3, Build from shell command line everything is ok. 
for example, if we run command: ant -buildfile buildkjava.xml deploy
the project can be built successful.


4, If we run the same command from a tomcat servlet, it's must be failed.

the source code is:

String cmd = "ant -buildfile buildkjava.xml deploy"
String[] envp = new String[] {"LANG=zh_CN.GBK"};
Process process = Runtime.getRuntime().exec(cmd, envp);


bellowing is the error logs:


[wtkobfuscate]   Copying resources from program jar
[/home/mic-oem-dev/workspace/code/kjava/mini-baseline/KJAVA_MINI.jar]
[wtkobfuscate] Updating JAD file
/home/mic-oem-dev/workspace/code/kjava/mini-baseline/KJAVA_MINI.jad
[echo] preverify...
[wtkpreverify] Preverifying
/home/mic-oem-dev/workspace/code/kjava/mini-baseline/KJAVA_MINI.jar
[wtkpreverify] Executable:
/home/mic-oem-dev/workspace/sdk/WTK2.5.2/bin/preverify
[wtkpreverify] Arguments : -classpath
/home/mic-oem-dev/workspace/sdk/WTK2.5.2/lib/cldcapi11.jar:/home/mic-oem-dev/workspace/sdk/WTK2.5.2/lib/mmapi.jar:/home/mic-oem-dev/workspace/sdk/WTK2.5.2/lib/jsr75.jar:/home/mic-oem-dev/workspace/sdk/WTK2.5.2/lib/midpapi20.jar:/home/mic-oem-dev/workspace/code/kjava/mini-baseline/lib/nokia-ui.jar:/home/mic-oem-dev/workspace/code/kjava/mini-baseline/lib/wma.jar
-d /home/mic-oem-dev/workspace/code/kjava/mini-baseline/54590625.tmp -target
CLDC1.1
/home/mic-oem-dev/workspace/code/oem/bdmobile/kjava/mini-baseline/KJAVA_MINI.jar
[wtkpreverify] JAR file creation failed with error 32512
[wtkpreverify] The preverified classes if any are in tmp884869193. See jar log
of errors in
/home/mic-oem-dev/workspace/code/kjava/mini-baseline/54590625.tmp/jarlog.txt 
[wtkpreverify] sh: sh: not found

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52456] ant 1.7.1 build J2ME project error: JAR file creation failed with error 32512

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52456

--- Comment #2 from charley <ch...@gmail.com> 2012-01-13 09:59:10 UTC ---
Thanks Stefan, I think you have found a key point to avoid the error 32512. 
I just followed your suggestion to add a 'PATH' to the run-time environment,
when I ran the build command, and the error messages has changed. you can see
the error from below. I'm very appreciates if you have any idea about how to
solve the new error, thanks. 


my new code is:

String cmd = "/home/mic-oem-dev/workspace/tools/apache-ant-1.8.2/bin/ant
-buildfile buildkjava.xml deploy"

String[] envp = new String[] {"PATH=" + System.getenv("PATH"),
"LANG=zh_CN.GB2312"};
String[] cmds = {"/bin/sh", "-c", cmd};            
Runtime.getRuntime().exec(cmds, envp);


the log info is.
[102]->[wtkobfuscate]   Number of vertically merged classes:         0
[103]->[wtkobfuscate]   Number of horizontally merged classes:       3
[104]->[wtkobfuscate]   Number of removed write-only fields:         170
[105]->[wtkobfuscate]   Number of privatized fields:                 347
[106]->[wtkobfuscate]   Number of inlined constant fields:           83
[107]->[wtkobfuscate]   Number of privatized methods:                159
[108]->[wtkobfuscate]   Number of staticized methods:                73
[109]->[wtkobfuscate]   Number of finalized methods:                 1023
[110]->[wtkobfuscate]   Number of removed method parameters:         25
[111]->[wtkobfuscate]   Number of inlined constant parameters:       63
[112]->[wtkobfuscate]   Number of inlined constant return values:    9
[113]->[wtkobfuscate]   Number of inlined short method calls:        125
[114]->[wtkobfuscate]   Number of inlined unique method calls:       206
[115]->[wtkobfuscate]   Number of inlined tail recursion calls:      3
[116]->[wtkobfuscate]   Number of merged code blocks:                25
[117]->[wtkobfuscate]   Number of variable peephole optimizations:   1386
[118]->[wtkobfuscate]   Number of arithmetic peephole optimizations: 211
[119]->[wtkobfuscate]   Number of cast peephole optimizations:       35
[120]->[wtkobfuscate]   Number of field peephole optimizations:      16
[121]->[wtkobfuscate]   Number of branch peephole optimizations:     868
[122]->[wtkobfuscate]   Number of simplified instructions:           1104
[123]->[wtkobfuscate]   Number of removed instructions:              6902
[124]->[wtkobfuscate]   Number of removed local variables:           233
[125]->[wtkobfuscate]   Number of removed exception blocks:          57
[126]->[wtkobfuscate]   Number of optimized local variable frames:   504
[127]->[wtkobfuscate] Shrinking...
[128]->[wtkobfuscate] Removing unused program classes and class elements...
[129]->[wtkobfuscate]   Original number of program classes: 155
[130]->[wtkobfuscate]   Final number of program classes:    150
[131]->[wtkobfuscate] Obfuscating...
[132]->[wtkobfuscate] Preverifying...
[133]->[wtkobfuscate] Writing output...
[134]->[wtkobfuscate] Preparing output jar
[/home/mic-oem-dev/workspace/code/kjava/mini-baseline/19490792.tmp/output.jar]
[135]->[wtkobfuscate]   Copying resources from program jar
[/home/mic-oem-dev/workspace/code/kjava/mini-baseline/KJAVA_MINI.jar]
[136]->[wtkobfuscate] Updating JAD file
/home/mic-oem-dev/workspace/code/kjava/mini-baseline/KJAVA_MINI.jad
[137]->     [echo] preverify...
[138]->[wtkpreverify] Preverifying
/home/mic-oem-dev/workspace/code/kjava/mini-baseline/KJAVA_MINI.jar
[139]->[wtkpreverify] Executable:
/home/mic-oem-dev/workspace/sdk/WTK2.5.2/bin/preverify
[140]->[wtkpreverify] Arguments : -classpath
/home/mic-oem-dev/workspace/sdk/WTK2.5.2/lib/cldcapi11.jar:/home/mic-oem-dev/workspace/sdk/WTK2.5.2/lib/mmapi.jar:/home/mic-oem-dev/workspace/sdk/WTK2.5.2/lib/jsr75.jar:/home/mic-oem-dev/workspace/sdk/WTK2.5.2/lib/midpapi20.jar:/home/mic-oem-dev/workspace/code/kjava/mini-baseline/lib/nokia-ui.jar:/home/mic-oem-dev/workspace/code/kjava/mini-baseline/lib/wma.jar
-d /home/mic-oem-dev/workspace/code/kjava/mini-baseline/c59edc2a.tmp -target
CLDC1.1 /home/mic-oem-dev/workspace/code/kjava/mini-baseline/KJAVA_MINI.jar
[141]->[wtkpreverify] 
[142]->[wtkpreverify] ERROR: failed to open tmp1945431482/META-INF/MANIFEST.MF
[143]->[wtkpreverify] Error preferifying, log file not found: 
/home/mic-oem-dev/workspace/code/kjava/mini-baseline/c59edc2a.tmp/jarlog.txt
[144]->
[145]->BUILD FAILED
[146]->Preverification failed (result=1)
[147]->
[148]->Total time: 22 seconds

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52456] ant 1.7.1 build J2ME project error: JAR file creation failed with error 32512

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52456

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|                            |All

--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2012-01-12 15:28:33 UTC ---
I'm pretty sure this issue is not related to Ant at all (you already said it
worked from the command line).

I don't have any idea what error 32512 may be, the error message stems from a
task wtkpreverify that is not developed by the Ant team.

The very last line

> [wtkpreverify] sh: sh: not found

makes me suspect you may need to put a few more variables (like PATH) into your
environment.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52456] ant 1.7.1 build J2ME project error: JAR file creation failed with error 32512

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52456

charley <ch...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from charley <ch...@gmail.com> 2012-01-16 08:54:23 UTC ---
Hi Stefan, 
I just try to build it again in the morning, it's somehow works ! I can't
understand & I can't explain why. the code is completely the same as last week,
I have do nothing in the weekend, I just leave it on there and spend my weekend
as usual. it's so weird :(

I also removed "/bin/sh -c" prefix from the command string, it's works as well. 

anyway, let's just simplify to close this bug, and thanks for you support & fix
method, it's really a good experience for me. 


my conclusion is:
if we can run ant build from command line, it's should work from another
command shell. the most important part is that we should provide a proper
environment like add "PATH" to the command environment.


Thanks Sincerely.

Bin

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52456] ant 1.7.1 build J2ME project error: JAR file creation failed with error 32512

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52456

Jesse Glick <jg...@netbeans.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jglick@netbeans.org
         Resolution|FIXED                       |WORKSFORME

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.