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.
3,752
questions
589
votes
16
answers
459k
views
Difference between jar and war in Java
What is the difference between a .jar and a .war file?
Is it only the file extension or is there something more?
371
votes
13
answers
983k
views
How to deploy a war file in Tomcat 7
I have copied the sample.war file into the webapps directory of Tomcat, and I can access localhost:8080.
Now how will Tomcat deploy it, I mean do I need to open it in browser? How can I access the ...
352
votes
23
answers
373k
views
"webxml attribute is required" error in Maven
I am getting the following error:
Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
I have got web.xml in right place which is ...
215
votes
5
answers
231k
views
What is WEB-INF used for in a Java EE web application?
I'm working on a Java EE web application with the following source code directory structure:
src/main/java <-- multiple packages containing Java classes
src/test/java ...
152
votes
6
answers
96k
views
IntelliJ and WAR....changed files are not automatically recognized by server
I am running Intellij Ultimate with Tomcat and deploy a war. Everything deploys fine to the webapp directory of tomcat.
When I change a file like an xhtml file, is there a way for tomcat to ...
146
votes
18
answers
290k
views
How to start jenkins on different port rather than 8080 using command prompt in Windows?
I have jenkins.war and I started it from command prompt in Windows as:
java -jar jenkins.war
It was started well and easily browsed as http://localhost:8080
I want to start on 9090 port. How can I ...
112
votes
15
answers
324k
views
Oracle JDBC ojdbc6 Jar as a Maven Dependency
I cannot seem to get Maven to bundle the ojdbc6.jar file into my project's war file. I have it working within the POM file when specifying a dependency directly for Hibernate tools. But it won't get ...
110
votes
15
answers
137k
views
Update Jenkins from a war file
I have a machine with Ubuntu 12.04 and have installed Jenkins ver. 1.424.6 using apt-get based on *this guide*, but there is a new version:
New version of Jenkins (1.447.2) is available for download (...
108
votes
6
answers
270k
views
Linux command for extracting war file?
How can I extract a .war file with Linux command prompt?
102
votes
3
answers
150k
views
How do I update a Tomcat webapp without restarting the entire service?
I'm new to Tomcat. We have a dev machine with about 5 apps running. Even though it's dev, it's used by our clients pretty heavily during testing.
So say we need to make one small change on one ...
97
votes
13
answers
203k
views
How to create war files
What are the best practices of creating war files (using eclipse) to run on tomcat? tutorials, links, examples are highly appreciated.
97
votes
12
answers
279k
views
How do I run a class in a WAR from the command line?
I have a Java class which has a main and I used to run as a standalone app from the command line e.g.
java -jar myjar.jar params
I needed to repackage the code to run under apache and all my code, ...
93
votes
1
answer
17k
views
Advice deploying war files vs executable jar with embedded container
There seems to be a current trend in java space to move away from deploying java web applications to a java servlet container (or application server) in the form of a war file (or ear file) and ...
86
votes
5
answers
94k
views
Maven WAR dependency
I am writing a project for acceptance testing and for various reasons this is dependent on another project which is packaged as a WAR. I have managed to unpack the WAR using the maven-dependency-...
75
votes
7
answers
77k
views
In Maven, how output the classpath being used?
For my current purposes I have a Maven project which creates a war file, and I want to see what actual classpath it is using when creating the war. Is there a way to do that in a single command -- ...
71
votes
9
answers
341k
views
How to extract .war files in java? ZIP vs JAR
I have a web program where I want the user to be able to import a .war file and I can extract certain files out of the .war file. I have found two class libraries: java.util.zip.* and java.util.jar.*...
69
votes
6
answers
32k
views
Advantages/Disadvantages to exploded WAR files
An answer to a question I read today suggested deploying an application as an exploded (unzipped) WAR. It got me thinking.
Every deployment I've ever done to a JBoss/Tomcat has been with a a WAR/EAR ...
65
votes
14
answers
108k
views
Appending files to a zip file with Java
I am currently extracting the contents of a war file and then adding some new files to the directory structure and then creating a new war file.
This is all done programatically from Java - but I am ...
64
votes
3
answers
119k
views
Deploying Java webapp to Tomcat 8 running in Docker container
I am pretty new to Tomcat and Docker - so I am probably missing a Tomcat fundamental somewhere in this question.
What I am trying to do is build a Docker container that runs a SpringBoot Restful web ...
61
votes
7
answers
70k
views
Differences between jar and war in Spring Boot?
I'm about to build my first website in Java with Spring Framework using Spring Boot and it's much easier to build it in jar, but I have a few questions about it.
What are the differences in general?
...
57
votes
8
answers
231k
views
How to unpackage and repackage a WAR file
I have a WAR file. I would like to open it, edit an XML file, remove some jars and then re-package it.
I used WINRAR to open the WAR file and I removed some Jars and did an 'Add to Archive' in WinRar ...
56
votes
7
answers
13k
views
How To Integrate Clojure Web Applications in Apache
Note
Given this OP was written about two years ago, rather than ask the same question again, I am wondering if step-by-step instructions exist, so that I can integrate a Noir or other Clojure web ...
52
votes
9
answers
42k
views
Executable war file that starts jetty without maven
I'm trying to make an "executable" war file (java -jar myWarFile.war) that will start up a Jetty webserver that hosts the webapp contained in the WAR file I executed.
I found a page that described ...
50
votes
6
answers
39k
views
Java EE Containers vs Web Containers
I'm relatively new to Java EE/EJB, and I've been reading a lot regarding Java EE containers. I've had experience working with a web container (WAR file in JBoss). I am also aware that JBoss can also ...
47
votes
1
answer
176k
views
How to make war file in Eclipse [duplicate]
What is the easy way to make war file?
My project is working when i right click run on server, but i want to deploy on tomcat server.
I have installed m2clipse but it gave me an error.
Is maven ...
47
votes
5
answers
59k
views
Jetty Run War Using only command line
Is it possible to use only the command line to Run jetty with only a specified war file and Context Path.
Something like :
java -jar $jettyHome/start.jar -Dwar.location=myApp.war -DcontextPath=/...
43
votes
4
answers
85k
views
deploying multiple applications to Tomcat
I want to deploy two applications foo.war and bar.war to the same Tomcat instance. Is it possible for them to listen for connections on different ports, e.g. foo listens on port 81 and bar listens on ...
43
votes
7
answers
99k
views
Unable to find a javac compiler
I am trying to package my web application into war file using Ant.
When I build, I am getting the following error:
C:\Documents and Settings\Administrator\workspace\Assignment7\build.xml:67: Unable ...
41
votes
8
answers
114k
views
How to deploy war file to tomcat using command prompt?
I have created a war file and put into tomcat/webapps. How to deploy a war file to tomcat using command prompt?
41
votes
2
answers
25k
views
Why spring boot generates jar or war file with .original extension?
Why after building spring boot app, it generates two jar or war files with .original extension? I use spring boot maven build plugin.
For example:
application.jar
application.jar.original
40
votes
4
answers
24k
views
Does Tomcat require Apache httpd?
If I am given a war file that contains a Java web application, and I want to run that war locally, then do I just need Tomcat, or do I need Tomcat and Apache httpd (or any other web server)? Thanks in ...
36
votes
3
answers
62k
views
In maven - how to rename the output .war file based on the name of the profile in use
I have three profiles in my pom.xml for our application...
dev (for use on a developer's)
qa (for use on our internal qa server)
prod (production).
When we run our maven build all three profiles ...
36
votes
5
answers
22k
views
How can I store Java EE configuration parameters outside of an EAR or WAR?
I want to store configuration for a web project outside of the web project (ear/war file).
The application shouldn't know in which container it's running (WebSphere/JBoss etc.).
What is the best way ...
34
votes
1
answer
31k
views
What is .apt_generated folder in Web project?
What and why .apt_generated folder is created inside the Web Project within Eclipse or RAD workspace?
33
votes
1
answer
22k
views
spring-boot without parent pom.xml cannot generate war packaging
I used the example gs-convert-jar-to-war provided by spring-io. It describes how to generate war packaging within a spring boot project.
The spring-boot documentation allows for using own parent ...
32
votes
6
answers
110k
views
Tomcat not autodeploying war file
I followed the following steps
Shutdown Tomcat
Deployed a war file with a timestamp of 1st December
Start Tomcat - This created the exploded directory for the deployed war file.
Stop Tomcat
Updated ...
32
votes
4
answers
129k
views
UnsupportedClassVersionError unsupported major.minor version 51.0 unable to load class [duplicate]
Possible Duplicate:
Exception in thread “main” java.lang.UnsupportedClassVersionError: a (Unsupporte d major.minor version 51.0)
i have developed an web application in java using jdk ...
31
votes
3
answers
39k
views
Jboss 7 war deployment failed
Jboss 7 war deployment failed and i got the below error message in the log.
ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to ...
31
votes
3
answers
50k
views
Deploy Spring Boot to Tomcat
So I am new to Spring - so I thought I would try Spring Boot
I am using a Maven to build - I set up a view requests, when I run it as "App" looks like it starts tomcat up itself and i have a service ...
30
votes
5
answers
65k
views
spring boot war without tomcat embedded
I want to create a war file without embedded tomcat with maven.
Here the relevant part of my pom
...
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>...
29
votes
3
answers
51k
views
How to setup angular 4 inside a maven based java war project
I'm becoming a bit crazy because I can't find a guide to setup an angular 4 app inside a java war project that will be built with maven. This is because I want to run it into a wildfly server.
Any ...
28
votes
8
answers
71k
views
"Module name is invalid" when exporting an existing eclipse project to a war file
I am trying to export an existing Eclipse project to a war file. But whatever I typed in the "WAR Export" dialog page, the system always returned "Module name is invalid". I do not know how to fix ...
28
votes
7
answers
38k
views
Separating war application name from war file name
Currently if i deploy a war file on tomcat named say myapp.war, I can access its url by http://localhost/myapp/MyServlet.
However what I want is to deploy a war with a version number in the war file ...
27
votes
5
answers
38k
views
what is the right path to refer a jar file in jpa persistence.xml in a web app?
persistence.xml looks like this:
<persistence-unit name="testPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-...
26
votes
4
answers
22k
views
How to make maven place all jars common to wars inside the same EAR to EAR root?
We have a solution with numerous wars. Wars are similar in the sense they all use hibernate and spring. This means that we have a number of same jars inside each war. This is becoming a problem, ...
26
votes
8
answers
28k
views
create a .war file from gwt-project
How do I create a .war-file from my gwt-project in eclipse?
26
votes
3
answers
10k
views
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 ...
25
votes
5
answers
14k
views
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 ...
25
votes
1
answer
16k
views
Gradle: 'dependsOn' to task in other subproject
I have a hierarchical gradle 3.1 project, which looks like this:
root
- build.gradle
- settings.gradle
- server (Java + WAR plugin)
- build.gradle
- client (Node plugin)
...
24
votes
1
answer
30k
views
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 ...