Questions tagged [war]

Web Application Archive - Is a JAR file used to distribute JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries and static Web pages (HTML and related files) that together constitute a Web application.

In software engineering, a WAR file (or Web application ARchive) is a JAR file used to distribute a collection of pages, Java , classes, files, tag libraries, static web pages ( and related files) and other resources that together constitute a web application.

A WAR file may be digitally signed in the same way as a file in order to allow others to determine what source the code came from.

There are special files and directories within a WAR file.

The /WEB-INF directory in the WAR file contains a file named web.xml - the Web Application Deployment Descriptor - which defines the structure of the web application. If the web application is only serving JSP files, the web.xml file is not strictly necessary.

If the web application uses servlets, then the servlet container uses web.xml to ascertain to which servlet a URL request will be routed to. web.xml is also used to define context variables which can then be referenced within the servlets.

Environmental dependencies which the deployer is expected to set up can also be defined in this file. An example of an environmental dependency is a dependency on a mail session used to send email. The servlet container is responsible for providing this service.

Useful links

3745 questions
26
votes
8 answers

create a .war file from gwt-project

How do I create a .war-file from my gwt-project in eclipse?
derp
  • 277
  • 1
  • 4
  • 7
25
votes
3 answers

Deploy WAR or "fat" JAR?

I'm noticing a lot of projects (DropWizard, Grails, etc.) starting to embrace the notion of a "fat" JAR (using an embedded web server like Jetty or Tomcat) vs. the traditional WAR deploy. Both methods involve a single JVM process (i.e. no matter how…
AdjustingForInflation
  • 1,571
  • 2
  • 26
  • 50
25
votes
5 answers

Where to add .ebextensions in a WAR?

Scenario: AWS Elastic Beanstalk Java application .ebextensions currently placed in src/main/resources/.ebextensions Commands are not being executed. Where is the .ebextensions supposed to go in a Java application?
flavian
  • 28,161
  • 11
  • 65
  • 105
24
votes
3 answers

Maven: how to get a war package with resources copied in WEB-INF?

when I create a war package with maven, files and directories under the directory "src/main/resources" are copied in /WEB-INF/classes instead of /WEB-INF. How can I get them copied in /WEB-INF? thanks, rand UPDATE: in my pom now I use…
Randomize
  • 8,651
  • 18
  • 78
  • 133
22
votes
5 answers

Server is not connected when trying to deploy with intellij

I am trying to build, deploy and debug my webapp inside intellij. I have setup my tomcat using this answer and I was able to get the server running. The issue is that my webapp is not being deployed, though it is defined in the deployment tab. I…
special0ne
  • 6,063
  • 17
  • 67
  • 107
22
votes
2 answers

Gradle ear is putting JAR instead of WAR

I'm trying to build an ear using Gradle. I've my project tree like: /project | |--> /web-application | | | |--> /src (stuff of web app) | | | |--> build.gradle | |--> build-gradle |--> settings.gradle I'm trying to generate the ear…
rascio
  • 8,968
  • 19
  • 68
  • 108
22
votes
2 answers

JBAS015893: Encountered invalid class name

I'm currently cleaning up my Project and related Errors / Warnings a bit. Everytime i deploy my Maven Project to the JBoss AS 7.1.1.Final I get a lot of Warnings. I found a lot of posts / comments stating to just ignore or hide those warnings. Okay,…
dognose
  • 20,360
  • 9
  • 61
  • 107
21
votes
2 answers

EAR vs separate EJB + WAR

What's the difference in deploying application as EAR (with 1 EJB and 1 WAR module) vs separate modules? I want to use GlassFish 3 web profile but it does not support EAR archive. Can I simply use EJB and WAR as separate modules? Any other options?
karolkpl
  • 2,189
  • 10
  • 39
  • 60
21
votes
9 answers

How to deploy WAR of Maven Project to JBoss server from Eclipse?

I want to deploy WAR of Maven project to JBoss server. I know that from Eclipse Export->War deploy the WAR file to JBoss. But How can I do this for Maven Project. Any step by step information or useful website link will be very helpful to me. Thank…
Tapas Bose
  • 28,796
  • 74
  • 215
  • 331
21
votes
1 answer

How to allow Tomcat WAR app to write in folder

I'd like for my webapp which is deployed as a war ROOT.war to have write access to /var/www/html/static/images so that it can write uploaded and converted images to that folder so nginx can serve it statically. Currently it doesn't work and triggers…
aardbol
  • 2,147
  • 3
  • 31
  • 42
21
votes
2 answers

favicon.ico in Java WAR file

Can anybody provide some instruction on how to setup a war file to show a favicon.ico in the browser address bar?
David Snowsill
  • 1,467
  • 2
  • 16
  • 21
21
votes
7 answers

Gradle compileJava cannot find symbol from source file

I'm new with Gradle, so there's a chance that I am missing something obvious here. I am working on using Gradle for automated building of our projects. I've tackled most of them, but one is causing me unending trouble. Since this is for my company,…
JorganPubshire
  • 777
  • 1
  • 6
  • 16
21
votes
5 answers

Gradle: How to exclude JAR from a WAR?

I have a multi-project Gradle build structure, where child project depends on a JAR, which I don't want to be in WAR file. I tried "exclude" but it does not work. The main project script: apply plugin: 'war' war { dependencies { runtime…
isobretatel
  • 3,812
  • 7
  • 34
  • 49
21
votes
4 answers

WARNING The requested profile "projectname" could not be activated because it does not exist

I get this WARNING when I try to build my maven project. I have searched google but with no luck. This is really annoying since I wanna release my project but it wont work with this warning (I think). The build is successful, but when I try to…
benskiiii
  • 439
  • 3
  • 11
  • 23
21
votes
2 answers

Tomcat failing to deploy .war

I'm trying to follow this tutorial on creating a simple REST web service, however I get to deploying it on tomcat and it throws an exception: FAIL - Application at context path /restful could not be started FAIL - Encountered exception…
Pete
  • 1,095
  • 3
  • 9
  • 17