You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jerome Lacoste <la...@altern.org> on 2002/08/19 13:39:29 UTC

Re: System.getProperties() returns an empty list when unit test runwithin Ant

Erik Hatcher wrote:

> I recommend using fork="true" for <junit>.  Will that solve this problem? 


Eric,

this solved my problem! Great!
I just hope that this doesn't have some side effects on some of my other 
tests.
But this still doesn't tell me why the System properties were created 
with some default properties.
Can this be a bug in Ant? Does anybody has an idea where this comes from?

I am checking with ant 1.5 right away.

jerome


>
>
> Jerome Lacoste wrote:
>
>> Hi Anties,
>>
>> I've got this strange problem: one of my UnitTest fails when I run it 
>> within Ant, while it doens't fail when I run it directly from the 
>> same VM.
>> I've had trouble like that before and they are usualy environment 
>> related but this one is very strange:
>> Here's the code of my Unit Test:
>>
>> public void testSystemGetProperties() {
>>    // Skip debug code to printout System.getProperties()
>>    ...
>>    if (System.getProperties().size() == 0)
>>    {
>>      fail("WARNING something is wrong in your environment. 
>> System.getProperties().size() == 0");
>>    }
>>  }
>>
>> As you can see, System.getProperties().size() == 0 fails when I run 
>> this test within ant. According to the API this should never happen.
>> Even more strange is that if I try to access any single System 
>> property within the same code, I will obtain it without problem!
>> I.e. System.getProperty("user.dir") works OK but 
>> System.getProperties() still returns an empty list!!
>
[...]



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Execute failed: signjar error=2

Posted by Diane Holt <ho...@yahoo.com>.
CreateProcess: ... error=2 means it can't find the command in your path;
including wherever 'jarsigner' lives in your Path env var should fix it.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Execute failed: signjar error=2

Posted by "David M. Smith" <da...@home-free.demon.co.uk>.
Hi,

I am using ant 1.4.1 with NetBeans 3.4 RC1 under Windows 2000 SP2.
When I execute the following task using ant.bat, it works fine.

<target description="Sign ${jarName}." depends="jar" name="sign"> 

         <signjar alias="MyProject" jar="${jarName}"
         keypass="${signingPassword}"
         keystore="${ant.rootDir}/keystore"
         storepass="${signingPassword}"/>
</target>

If I execute it within NetBeans I get the following error. Any idea what 
is going wrong here? I have searched the mailing lists for both ant and 
NetBeans with out success.

Also, is there a list of the error codes (like error=2), I can't find it 
in the documentation.

Regards,
David

sign:
Signing Jar : 
D:\Projects\MyProject\Rules\MyProjectRulesDevelopmentBuild.jar
Current OS is Windows 2000
jarsigner -keystore D:/Projects/MyProject/keystore -storepass xxxxx 
-keypass xxxxx 
D:/Projects/MyProject/Rules/MyProjectRulesDevelopmentBuild.jar myriad
build.xml [155] Execute failed: java.io.IOException: CreateProcess: 
jarsigner -keystore D:/Projects/MyProject/keystore -storepass xxxxx 
-keypass xxxxx 
D:/Projects/MyProject/Rules/MyProjectRulesDevelopmentBuild.jar myriad 
error=2
     at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:281)
     at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:177)
     at org.apache.tools.ant.taskdefs.SignJar.doOneJar(SignJar.java:255)
     at org.apache.tools.ant.taskdefs.SignJar.execute(SignJar.java:168)
     at org.apache.tools.ant.Task.perform(Task.java:217)
     at org.apache.tools.ant.Target.execute(Target.java:184)
     at org.apache.tools.ant.Target.performTasks(Target.java:202)
     at org.apache.tools.ant.Project.executeTarget(Project.java:601)
     at org.apache.tools.ant.Project.executeTargets(Project.java:560)
     at 
org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:27
7)
     at 
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:119)
--- Nested Exception ---
java.io.IOException: CreateProcess: jarsigner -keystore 
D:/Projects/MyProject/keystore -storepass xxxxx -keypass xxxxx 
D:/Projects/MyProject/Rules/MyProjectRulesDevelopmentBuild.jar myriad 
error=2
     at java.lang.Win32Process.create(Native Method)
     at java.lang.Win32Process.<init>(Win32Process.java:61)
     at java.lang.Runtime.execInternal(Native Method)
     at java.lang.Runtime.exec(Runtime.java:546)
     at java.lang.reflect.Method.invoke(Native Method)
     at 
org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.
java:564)
     at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:384)
     at 
org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:250)
     at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:279)
     at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:177)
     at org.apache.tools.ant.taskdefs.SignJar.doOneJar(SignJar.java:255)
     at org.apache.tools.ant.taskdefs.SignJar.execute(SignJar.java:168)
     at org.apache.tools.ant.Task.perform(Task.java:217)
     at org.apache.tools.ant.Target.execute(Target.java:184)
     at org.apache.tools.ant.Target.performTasks(Target.java:202)
     at org.apache.tools.ant.Project.executeTarget(Project.java:601)
     at org.apache.tools.ant.Project.executeTargets(Project.java:560)
     at 
org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:27
7)
     at 
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:119)
BUILD FAILED
-- 
David M. Smith

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>