• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ant script fails because of bad Context Path?

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what the problem is here, so this question is a little hard to ask when I don't know what to provide.
I have a web project which gets compiled through and ant script. That script contains the code:


and my server.xml has this:


C:\Workspace\TollfreeReporting is the base directory
C:\Workspace\TollfreeReporting\work is a directory that ant creates and puts the compiled code into
C:\Workspace\TollfreeReporting\WebRoot is the webroot for the project

when I attempt to compile I get this:
BUILD FAILED: C:\Workspace\TollfreeReporting\build.xml:19: Compile failed; see the compiler error output for details.
and it takes me to the line
<javac srcdir="${src}" destdir="${webroot}/${bin}" debug="true"> in that ant script

Any ideas?
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aren't there compiler errors displayed?


BUILD FAILED: C:\Workspace\TollfreeReporting\build.xml:19:
Compile failed; see the compiler error output for details.
and it takes me to the line...


for example like this:


[ April 22, 2005: Message edited by: Carol Enderlin ]

[ April 22, 2005: Message edited by: Carol Enderlin ]
[ April 22, 2005: Message edited by: Carol Enderlin ]
 
Gran Roguismo
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a whole slew of errors, of which I am only going to post the last couple of lines for readability:



package javax.servlet.http does not exist seems to be a rather reoccuring theme in many of these. Where does this come from, what package do I need to include to get this?
 
Gran Roguismo
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have added servlet-api.jar and jsp-api.jar to the project build path (I am working in eclipse) but the result is the same.
 
Carol Enderlin
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should start by looking at the very first compile error. The compiler starts telling you about errors that are only there because of the earlier errors.

Adding something to your eclipse build path doesn't help with an ant build.
 
Gran Roguismo
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this was the first line in the error log:


I have taken the jar out of the build path and put them into the classpath


I then restarted the computer and tried again. same errors.
 
Gran Roguismo
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
problem solved, you were right, I was just putting it in the wrong classpath

I have now put it into the anti build path: (in eclipse)

Windows > Preferences > Ant > Runtime > Classpath

compiles fine now.
 
Carol Enderlin
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adding a directory to the classpath doesn't add the jars in that directory to the classpath.

Add the tomcat jars to the classpath in your build file

[ April 22, 2005: Message edited by: Carol Enderlin ]
reply
    Bookmark Topic Watch Topic
  • New Topic