This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

How to create Beer-V1 war

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I am able to run the Beer-V1 application. But I want to create a Beer-V1 war file and deploy the same in tomcat.

Can anybody help in this.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A war file is nothing more than a zip file with a ".war" extension.

To do this with Java's jar command, cd to the root directory of your webapp and type:


This will create a war file named myApp.war in the root of your C drive.

To deploy in Tomcat, just move that war file to your webapps directory.
 
satya mahapatra
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben,
Normally my application is workin fine. But when I created the war file and deployed the same in webapps of tomcat it sin't running. Do
I need to give any entries in any of the web.xml file. Or anywhere else I
need to change?

Thanks,
satya
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat looks for war in webapps folder.It its not able to deploy the web application then you would get exceptions in Tomcat log.What is tomcat log saying ?
You can even see in the following folder to check whether tomcat was able to unjar the war or not.

TOMCAT_HOME\work\Catalina\localhost

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First look to the logs in tomcat/logs to see what, if anything is going wrong.

In cases like this I like to stop Tomcat, delete all the log files in tomcat/logs, then start it up and try to deploy the app.

This way you won't have to sift through reams of old logging messages to find what's relevant.
 
satya mahapatra
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rahul/Ben,

Your guess is correct. Tomcat isn't able to unjar the war file. I checked at the location you specified. TOMCAT_HOME\work\Catalina\localhost.

Log File:

2007-05-03 17:54:40 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2007-05-03 17:54:41 StandardContext[/jsp-examples]ContextListener: contextInitialized()
2007-05-03 17:54:41 StandardContext[/jsp-examples]SessionListener: contextInitialized()
2007-05-03 17:54:41 StandardContext[/servlets-examples]ContextListener: contextInitialized()
2007-05-03 17:54:41 StandardContext[/servlets-examples]SessionListener: contextInitialized()

I didn't get anything from this logo file. If you have any clues where I am going wrongthen please help.
 
crispy bacon. crispy tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic