Thanks.
I tried your suggestions, and the problem concerned that seems to be solved
- thanks!

Now, I get another exception, which seems somehow related to ant libraries -
this is my understanding. I have included all the ant jars in my
application. I post the exception and the new code - hoping in other
suggestions.

Thanks!

Dan

The new code is:

        Project project = new Project();
        Target target = new Target();
        SignJar sj = new SignJar();
        target.addTask(sj);

        project.addTarget("sign_jar", target);

        sj.setAlias("myDep");
        sj.setStorepass("myPrj");
        sj.setProject(project);

        sj.setJar(new File(fileName));
        sj.setSigfile(sigFile);

        project.executeTarget("sign_jar");

Exception:

Exception in thread "main" jarsigner returned: 1
        at
org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:636)
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:662)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:487)
        at
org.apache.tools.ant.taskdefs.SignJar.signOneJar(SignJar.java:407)
        at org.apache.tools.ant.taskdefs.SignJar.execute(SignJar.java:336)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)




On Wed, Nov 5, 2008 at 9:10 PM, Mark Salter <[EMAIL PROTECTED]> wrote:

> Morgan Kinne wrote:
> > try sj.perform()
> >
> It looks to me like you will still need to set a sj.setProject(project).
>
> I can't find anything that states this requirement, sorry.
>
> --
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to