Ant deploy and context.xml

2004-05-13 Thread Rich Garabedian
I'm trying to use the ant autodeploy feature with a context.xml fragment in
the MET-INF directory. Mailing lists and all the documentation I've read
show this to be a no-brainer. I'm sure I'm being ignorant of something
incredibly obvious, but I just can't see it.

 

I'm using the basic build.xml  file from the Tomcat site.

I'm using Tomcat version 5.0.16

 

In the source directory I have

 

Build

Dist

Docs

Src

Web

 

Under web I have

 

META-INF

Templates

WEB-INF

 

In META-INF I have a context.xml fragment (contents included below).

 

When I do a build, I see that the META-INF directory and the context.xml
file gets copied the build directory. But when I do an ant deploy, it does
create an xml file in the Catalina conf directory (name of the file when
copied is the name of the web app, not context.xml). However, the contents
of the this file do not contain the specific configuration information I put
in context.xml.

 

 In summary, it does not appear as though the deploy task is using my
context.xml file when it does the install/deploy.

 

Ideas?

 

Many thanks in advance ..

 



RE: Ant install tasks

2003-12-09 Thread Rich Garabedian
Thanks everyone for your comments. Here is more detail:

I'm using the build.xml directly downloaded from the tomcat 5
documentation. The install task of that build file looks like this:

deploy url=${manager.url}
   username=${manager.username}
   password=${manager.password}
   path=${app.path}
war=file://${build.home}/

I noticed that the war target only has two slashes in it. If I add a
third like Mike shows below, I now get this error:

BUILD FAILED
file:C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java/bu
ild.xml:374: FAIL - Encountered exception java.util.zip.ZipException:
error
in opening zip file

This seems logical as the war target doesn't specify a war file, it
specifies a directory. I haven't tried adding a specific war file yet,
but will in a second...

Feels a little strange though, I never had to modify the build.xml file
from the Tomcat documentation before. I must be doing something wrong??


 -Original Message-
 From: Mike [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 08, 2003 10:00 PM
 To: Tomcat Users List; [EMAIL PROTECTED]
 Subject: Re: Ant install tasks
 
 Correct me if I'm wrong, but shouldn't the host be:
 

file:///C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java
/b
 uild.xml
 
 the difference being the three slashes between file: and C?
 
 - Mike
 
 - Original Message -
 From: Rich Garabedian [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, December 08, 2003 11:57 AM
 Subject: Ant install tasks
 
 
  I've used the custom ant tasks to build and install web apps a
zillion
  times. However, I'm setting up a new build/test environment on a
fresh
  machine and I'm having a problem getting the install task to work. I
can
  do all the normal all/compile/dist tasks. plus I can do the LIST
task. I
  can also use the HTML manager app to do the install. Just can't do
the
  install via ant.
 
  Environment:
 
  Windows XP Pro
  jakarta-tomcat-5.0.16
  apache-ant-1.5.4
 
  Error:
 
  BUILD FAILED
 
file:C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java/bu
  ild.xml:368: java.net.UnknownHostException: C
 
  I'm nearly 100% the host is correct - it's simply localhost. Plus,
the
  list task works fine, so it has to be hitting the correct url to do
  that. I've also echoed all the variables being passed to the install
  target (in the build.xml), and they look correct.
 
  Running ant with debug doesn't offer much more insight:
 
  BUILD FAILED
 
file:C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java/bu
  ild.xml:368: java.net.UnknownHostException: C
  at
  org.apache.catalina.ant.DeployTask.execute(DeployTask.java:208)
  at org.apache.tools.ant.Task.perform(Task.java:341)
  at org.apache.tools.ant.Target.execute(Target.java:309)
  at org.apache.tools.ant.Target.performTasks(Target.java:336)
  at
org.apache.tools.ant.Project.executeTarget(Project.java:1339)
  at
  org.apache.tools.ant.Project.executeTargets(Project.java:1255)
  at org.apache.tools.ant.Main.runBuild(Main.java:609)
  at org.apache.tools.ant.Main.start(Main.java:196)
  at org.apache.tools.ant.Main.main(Main.java:235)
  Caused by: java.net.UnknownHostException: C
  at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
  at java.net.Socket.connect(Socket.java:452)
  at java.net.Socket.connect(Socket.java:402)
  at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
  at sun.net.NetworkClient.openServer(NetworkClient.java:118)
  at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
  at sun.net.ftp.FtpClient.init(FtpClient.java:692)
  at
 
sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.ja
  va:175)
  at
 
sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnec
  tion.java:257)
  at
  org.apache.catalina.ant.DeployTask.execute(DeployTask.java:205)
  ... 8 more
  --- Nested Exception ---
  java.net.UnknownHostException: C
  at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
  at java.net.Socket.connect(Socket.java:452)
  at java.net.Socket.connect(Socket.java:402)
  at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
  at sun.net.NetworkClient.openServer(NetworkClient.java:118)
  at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
  at sun.net.ftp.FtpClient.init(FtpClient.java:692)
  at
 
sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.ja
  va:175)
  at
 
sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnec
  tion.java:257)
  at
  org.apache.catalina.ant.DeployTask.execute(DeployTask.java:205)
  at org.apache.tools.ant.Task.perform(Task.java:341)
  at org.apache.tools.ant.Target.execute(Target.java:309)
  at org.apache.tools.ant.Target.performTasks

RE: Ant install tasks

2003-12-09 Thread Rich Garabedian
I'm not sure adding the extra slash is right or not. I don't get the
host exception anymore, but I continue to get the zip error (below).
After looking at my tests, I see that the war file created by ant dist
is 1,149 KB. Yet, when I run ant install, the task is copying a war
file to the webapp directory that is only 1 KB in size. If I run jar
-tvf on that 1KB war file, it shows it's empty.

If I simply copy the war file ant dist creates to the webapp
directory, everything works fine

 -Original Message-
 From: Rich Garabedian [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 09, 2003 9:40 AM
 To: 'Tomcat Users List'
 Subject: RE: Ant install tasks
 
 Thanks everyone for your comments. Here is more detail:
 
 I'm using the build.xml directly downloaded from the tomcat 5
 documentation. The install task of that build file looks like this:
 
 deploy url=${manager.url}
username=${manager.username}
password=${manager.password}
path=${app.path}
 war=file://${build.home}/
 
 I noticed that the war target only has two slashes in it. If I add a
 third like Mike shows below, I now get this error:
 
 BUILD FAILED

file:C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java/bu
 ild.xml:374: FAIL - Encountered exception java.util.zip.ZipException:
 error
 in opening zip file
 
 This seems logical as the war target doesn't specify a war file, it
 specifies a directory. I haven't tried adding a specific war file yet,
 but will in a second...
 
 Feels a little strange though, I never had to modify the build.xml
file
 from the Tomcat documentation before. I must be doing something
wrong??
 
 
  -Original Message-
  From: Mike [mailto:[EMAIL PROTECTED]
  Sent: Monday, December 08, 2003 10:00 PM
  To: Tomcat Users List; [EMAIL PROTECTED]
  Subject: Re: Ant install tasks
 
  Correct me if I'm wrong, but shouldn't the host be:
 
 

file:///C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java
 /b
  uild.xml
 
  the difference being the three slashes between file: and C?
 
  - Mike
 
  - Original Message -
  From: Rich Garabedian [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, December 08, 2003 11:57 AM
  Subject: Ant install tasks
 
 
   I've used the custom ant tasks to build and install web apps a
 zillion
   times. However, I'm setting up a new build/test environment on a
 fresh
   machine and I'm having a problem getting the install task to work.
I
 can
   do all the normal all/compile/dist tasks. plus I can do the LIST
 task. I
   can also use the HTML manager app to do the install. Just can't do
 the
   install via ant.
  
   Environment:
  
   Windows XP Pro
   jakarta-tomcat-5.0.16
   apache-ant-1.5.4
  
   Error:
  
   BUILD FAILED
  

file:C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java/bu
   ild.xml:368: java.net.UnknownHostException: C
  
   I'm nearly 100% the host is correct - it's simply localhost. Plus,
 the
   list task works fine, so it has to be hitting the correct url to
do
   that. I've also echoed all the variables being passed to the
install
   target (in the build.xml), and they look correct.
  
   Running ant with debug doesn't offer much more insight:
  
   BUILD FAILED
  

file:C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java/bu
   ild.xml:368: java.net.UnknownHostException: C
   at
   org.apache.catalina.ant.DeployTask.execute(DeployTask.java:208)
   at org.apache.tools.ant.Task.perform(Task.java:341)
   at org.apache.tools.ant.Target.execute(Target.java:309)
   at
org.apache.tools.ant.Target.performTasks(Target.java:336)
   at
 org.apache.tools.ant.Project.executeTarget(Project.java:1339)
   at
   org.apache.tools.ant.Project.executeTargets(Project.java:1255)
   at org.apache.tools.ant.Main.runBuild(Main.java:609)
   at org.apache.tools.ant.Main.start(Main.java:196)
   at org.apache.tools.ant.Main.main(Main.java:235)
   Caused by: java.net.UnknownHostException: C
   at
 java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
   at java.net.Socket.connect(Socket.java:452)
   at java.net.Socket.connect(Socket.java:402)
   at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
   at
sun.net.NetworkClient.openServer(NetworkClient.java:118)
   at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
   at sun.net.ftp.FtpClient.init(FtpClient.java:692)
   at
  
 sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.ja
   va:175)
   at
  
 sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnec
   tion.java:257)
   at
   org.apache.catalina.ant.DeployTask.execute(DeployTask.java:205)
   ... 8 more
   --- Nested Exception ---
   java.net.UnknownHostException: C
   at
 java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
   at java.net.Socket.connect

Ant install tasks

2003-12-08 Thread Rich Garabedian
I've used the custom ant tasks to build and install web apps a zillion
times. However, I'm setting up a new build/test environment on a fresh
machine and I'm having a problem getting the install task to work. I can
do all the normal all/compile/dist tasks. plus I can do the LIST task. I
can also use the HTML manager app to do the install. Just can't do the
install via ant.
 
Environment:
 
Windows XP Pro
jakarta-tomcat-5.0.16
apache-ant-1.5.4
 
Error:
 
BUILD FAILED
file:C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java/bu
ild.xml:368: java.net.UnknownHostException: C
 
I'm nearly 100% the host is correct - it's simply localhost. Plus, the
list task works fine, so it has to be hitting the correct url to do
that. I've also echoed all the variables being passed to the install
target (in the build.xml), and they look correct.
 
Running ant with debug doesn't offer much more insight:
 
BUILD FAILED
file:C:/Documents%20and%20Settings/rich/My%20Documents/workbench/java/bu
ild.xml:368: java.net.UnknownHostException: C
at
org.apache.catalina.ant.DeployTask.execute(DeployTask.java:208)
at org.apache.tools.ant.Task.perform(Task.java:341)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
at org.apache.tools.ant.Main.runBuild(Main.java:609)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: java.net.UnknownHostException: C
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.NetworkClient.openServer(NetworkClient.java:118)
at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
at sun.net.ftp.FtpClient.init(FtpClient.java:692)
at
sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.ja
va:175)
at
sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnec
tion.java:257)
at
org.apache.catalina.ant.DeployTask.execute(DeployTask.java:205)
... 8 more
--- Nested Exception ---
java.net.UnknownHostException: C
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.NetworkClient.openServer(NetworkClient.java:118)
at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
at sun.net.ftp.FtpClient.init(FtpClient.java:692)
at
sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.ja
va:175)
at
sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnec
tion.java:257)
at
org.apache.catalina.ant.DeployTask.execute(DeployTask.java:205)
at org.apache.tools.ant.Task.perform(Task.java:341)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
at org.apache.tools.ant.Main.runBuild(Main.java:609)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
 
Total time: 11 seconds
 
Anyone have a hint? I've never run into this before and I'm going crazy
trying to figure out what's wrong.
 
Many thanks,
 
Rich