• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Problem with War task

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there something wrong with the way I'm creating the war file in the task (see below), the war is built fine but tomcat won't unpack it. Yes the UNPACKWARS has been set to true. If I unpack the war and create the context manually the application runs fine.
 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by Tomcat won't unpack it? What do you get when you start Tomcat? I found that often in Weblogic case, some version of the server requires certain web.xml header/format. Make sure your web.xml fits Tomcat's requirement.
 
Simon Good
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The message in the tomcat log file states the following:

I can quite clearly see the war file in the webapp directory but it remains unpacked so I don't have a quickstart context.
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remember that a war file is only a jar file with a specific internal layout, and that a jar file is just a zip file with a manifest and a different filetype.
I suggest that you first try expanding your created jar to a temporary area using WinZip or a similar tool to see what's actually in it. Don't rely on the cryptic messages from the server.
I also suggest that the Ant "war" task (despite its name) is not a good choice for general purpose construction of web applications. the "war" task is designed for gathering together widely separated application components. If you have control over where the bits of your application are built, it's usually much better to assemble the web application directory structure in a "build directory" somewhere, then use the simpler "jar" task to build the war archive from everything in that directory.
I describe this approach in more detail in part 4 of my "small and simple web applications" article series in the JavaRanch journal.
Let us know how you get on.
 
Simon Good
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Finally realised it's nothing to do with the war file itself. Tomcat is having problems with the context in the server.xml
I guess it's an issue to be discussed else where.
Cheers
 
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic