You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rainer Hoeckmann <rh...@gmx.de> on 2003/11/09 16:50:00 UTC

java.util.zip.ZipException while using the ant install target

Hello,

i am trying to use the ant install target from the tomcat-doc sample build.xml 
file, but this leads to the following output:

rainer@rainer:~/sample$ ant install -v
Apache Ant version 1.6beta2 compiled on November 7 2003
Buildfile: build.xml
Detected Java version: 1.4 in: /usr/local/j2sdk1.4.1/jre
Detected OS: Linux
parsing buildfile /home/rainer/sample/build.xml with URI = 
file:///home/rainer/sample/build.xml
Project base dir set to: /home/rainer/sample
 [property] Loading /home/rainer/sample/build.properties
 [property] Loading /home/rainer/build.properties
Build sequence for target `install' is [prepare, compile, install]
Complete build sequence is [prepare, compile, install, reload, remove, list, 
javadoc, clean, dist, all, ]

prepare:
     [copy] WEB-INF/web.xml omitted as WEB-INF/web.xml is up to date.
     [copy] hello.jsp omitted as hello.jsp is up to date.
     [copy] images/tomcat.gif omitted as images/tomcat.gif is up to date.
     [copy] index.html omitted as index.html is up to date.
     [copy]  omitted as  is up to date.
     [copy] WEB-INF omitted as WEB-INF is up to date.
     [copy] images omitted as images is up to date.

compile:
    [javac] mypackage/Hello.java omitted as mypackage/Hello.class is up to 
date.
     [copy]  omitted as  is up to date.
     [copy] mypackage omitted as mypackage is up to date.

install:
   [deploy] FAIL - Encountered exception java.util.zip.ZipException: error in 
opening zip file


BUILD FAILED
/home/rainer/sample/build.xml:361: FAIL - Encountered exception 
java.util.zip.ZipException: error in opening zip file
        at 
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:284)
        at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:240)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:302)
        at org.apache.tools.ant.Task.perform(Task.java:401)
        at org.apache.tools.ant.Target.execute(Target.java:338)
        at org.apache.tools.ant.Target.performTasks(Target.java:365)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
        at org.apache.tools.ant.Main.runBuild(Main.java:669)
        at org.apache.tools.ant.Main.startAnt(Main.java:220)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)
Caused by: FAIL - Encountered exception java.util.zip.ZipException: error in 
opening zip file
        at 
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:280)
        ... 11 more
--- Nested Exception ---
FAIL - Encountered exception java.util.zip.ZipException: error in opening zip 
file
        at 
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:280)
        at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:240)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:302)
        at org.apache.tools.ant.Task.perform(Task.java:401)
        at org.apache.tools.ant.Target.execute(Target.java:338)
        at org.apache.tools.ant.Target.performTasks(Target.java:365)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
        at org.apache.tools.ant.Main.runBuild(Main.java:669)
        at org.apache.tools.ant.Main.startAnt(Main.java:220)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)

Total time: 3 seconds

A servlets-examples.war file is created in Tomcats webapps directory, but it 
is only 36 bytes large and "jar tvf servlets-examples.war" has no output.

What could be the reason for this and what can I do to solve this?

JDK: 1.4.1
Tomcat: 5.0.14
Ant: 1.6beta2

Best Regards,
Rainer Hoeckmann

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.util.zip.ZipException while using the ant install target

Posted by Dustin Whitney <du...@samwellers.com>.
Hey,

I found a great tutorial with a build.xml and build.properties file 
that work (i.e. you don't get the Zip exception).  It is for tomcat4, 
but I got it working with tomcat5: 
http://www.onjava.com/pub/a/onjava/2003/01/08/tomcat4.html?page=1

-Dustin


On Nov 9, 2003, at 7:20 PM, Jacob Kjome wrote:

> <install> is not persistent across Tomcat restarts, which actually 
> makes it nice for development.  It is deprecated for Tomcat-5.0, 
> though.  You'll have to ask the developers why, but I think they just 
> wanted to stick with a single deployment task rather than getting 
> questions about "which one should I use"?
>
> You should probably use the <deploy> task from now on, especially 
> since it will replicate the production environment better, plus it is 
> deployable to servers other than the localhost.
>
> Jake
>
> At 11:53 PM 11/9/2003 +0100, you wrote:
>> I found that my build.xml was using the deployTask instead of 
>> installTask to
>> implement the "ant install" command. After changing this it went 
>> possible to
>> install my application to Tomcat.
>>
>> Now I'm wondering where the difference is between "deployTask" and 
>> the (not
>> documented) "installTask"?
>>
>> Best Regards,
>> Rainer Hoeckmann
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.util.zip.ZipException while using the ant install target

Posted by Jacob Kjome <ho...@visi.com>.
<install> is not persistent across Tomcat restarts, which actually makes it 
nice for development.  It is deprecated for Tomcat-5.0, though.  You'll 
have to ask the developers why, but I think they just wanted to stick with 
a single deployment task rather than getting questions about "which one 
should I use"?

You should probably use the <deploy> task from now on, especially since it 
will replicate the production environment better, plus it is deployable to 
servers other than the localhost.

Jake

At 11:53 PM 11/9/2003 +0100, you wrote:
>I found that my build.xml was using the deployTask instead of installTask to
>implement the "ant install" command. After changing this it went possible to
>install my application to Tomcat.
>
>Now I'm wondering where the difference is between "deployTask" and the (not
>documented) "installTask"?
>
>Best Regards,
>Rainer Hoeckmann
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.util.zip.ZipException while using the ant install target

Posted by Rainer Hoeckmann <rh...@gmx.de>.
I have found a solution without using the deprecated InstallTask:

change the install-Target so that it looks like:

  <target name="install" depends="compile"
   description="Install application to servlet container">

    <deploy url="${manager.url}"
       username="${manager.username}"
       password="${manager.password}"
           path="${app.path}"
           localWar="file://${build.home}"
	   update="true"/>

  </target>

This works great for me. 

Best Regards,
Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.util.zip.ZipException while using the ant install target

Posted by Remy Maucherat <re...@jboss.org>.
Rainer Stransky wrote:

> On Sunday 09 November 2003 23:53, Rainer Hoeckmann wrote:
> 
>>I found that my build.xml was using the deployTask instead of installTask
>>to implement the "ant install" command. After changing this it went
>>possible to install my application to Tomcat.
>>
>>Now I'm wondering where the difference is between "deployTask" and the (not
>>documented) "installTask"?
> 
> 
> I posted the same problem some days ago. But there was no response yet.
> I tried your "solution" but in my enviroment:
> - Tomcat/5.0.12
> - Ant/1.6beta2
> - java/1.4.0_03-b04
> - OS/Linux-2.4.19-4GB

Some comments:
- Since Tomcat 5 is in beta, you should update regularly, as there's a 
significant bugfix activity (which has been slowing down after 5.0.14)
- I only test with Ant 1.5.x for now
- The install task is deprecated, and I recommend you use deploy instead
- If you want a ready to use package to precompile and deploy webapps, 
look at the Tomcat 5 deployer (which is completely optional, of course)
- I think the Ant tasks are quite well documented (see the Tomcat 5 
manager and deployer documentation)

> So i tried your suggestion, and replaced 'deloy' with 'install' as task in the 
> install target. But the 'install' target is not known by my ant.
> 
> Neither deploy nor install is part of the ant core or optional task, i guess 
> they are implemented in catalina-ant.jar which i copied to $ANT_HOME/lib
> A look into the jar gives the indication that there are custom tasks 
> org/apache/catalina/ant/DeployTask.class
> org/apache/catalina/ant/InstallTask.class

-- 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Rémy Maucherat
Senior Developer & Consultant
JBoss Group (Europe) SàRL
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.util.zip.ZipException while using the ant install target

Posted by Rainer Stransky <Ra...@so-fa.de>.
On Sunday 09 November 2003 23:53, Rainer Hoeckmann wrote:
> I found that my build.xml was using the deployTask instead of installTask
> to implement the "ant install" command. After changing this it went
> possible to install my application to Tomcat.
>
> Now I'm wondering where the difference is between "deployTask" and the (not
> documented) "installTask"?

I posted the same problem some days ago. But there was no response yet.
I tried your "solution" but in my enviroment:
- Tomcat/5.0.12
- Ant/1.6beta2
- java/1.4.0_03-b04
- OS/Linux-2.4.19-4GB

So i tried your suggestion, and replaced 'deloy' with 'install' as task in the 
install target. But the 'install' target is not known by my ant.

Neither deploy nor install is part of the ant core or optional task, i guess 
they are implemented in catalina-ant.jar which i copied to $ANT_HOME/lib
A look into the jar gives the indication that there are custom tasks 
org/apache/catalina/ant/DeployTask.class
org/apache/catalina/ant/InstallTask.class

But i cannot find any documentation about them.

Can you give me a hint ?

Regards

Rainer


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.util.zip.ZipException while using the ant install target

Posted by Rainer Hoeckmann <rh...@gmx.de>.
I found that my build.xml was using the deployTask instead of installTask to 
implement the "ant install" command. After changing this it went possible to 
install my application to Tomcat.

Now I'm wondering where the difference is between "deployTask" and the (not 
documented) "installTask"?

Best Regards,
Rainer Hoeckmann

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org