Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Set up Tomcat

 
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, I developed a Java EE application with as fedora 27, eclipse oxygen 3 and maven. for the moment I only packagin with maven, ie there is a program "hello word" in a servlet.
>> https://coderanch.com/t/693233/maven/build-tools/dependencies-modules-project.
I filled some JSP file and I wish I could display them in my server tomcat 8.5, the latter after the compilation of the war of my project, the JSP files do not diplay in firefox has the agreed URL.
I would like to know if it is necessary to set TOMCAT to host my WAR generated by the Goal of Maven?

Regards
Philippe


 
Sheriff
Posts: 6265
167
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know it is possible to setup Tomcat so that every time you build the package, the war is updated in place.  I don't remember how to do that -- perhaps someone more knowledgeable will help.  Until then, I would go into Tomcat's Admin web page and import the war file manually after each build.
 
Saloon Keeper
Posts: 21127
131
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maven has a "deploy" option that a lot of people here use.

I use an alternative method, though.

A WAR can be located anywhere that Tomcat can see it as a file or directory (exploded WAR). It doesn't have to be dropped into the TOMCAT webapps directory. So I create a file named "xxxxxx.xml" in my TOMCAT_HOME/conf/Catalina/localhost that defined the webapp deployment using a Tomcat Context XML element. The docBase attribute of Context points to the WAR file or directory.

That's all there is to it.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you tell me: which line of command should I enter to deploy a WAR:

example:
 
Knute Snortum
Sheriff
Posts: 6265
167
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That'll work.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, I still can not deploy my WAR,

here is the parent POM.XML



the POM.XML of webapp



I do not understand why I have my exit eclipse that can not deploy my WAR?

here output of eclipse after deploy command :

I had to make a mistake setting my POM.XML, but I do not see where is the error!
more I force with a profile in production for not that I have release in the construction of the WAR !

Regards
Philippe
 
Tim Holloway
Saloon Keeper
Posts: 21127
131
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy)
    on project mon-appli: Deployment failed:
    repository element was not specified in the POM inside distributionManagement element
    or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]

 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Tim,
or is my mistake then, I'm not sure I understand everything!

Regards
Philippe
 
Tim Holloway
Saloon Keeper
Posts: 21127
131
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should have something like this:


You apparently are missing the <repostitory> element.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
I still have a detail in the construction of my WAR, apparently Eclipse returns an error:



Tim was referring to additional orders but that is not necessary!

voici le pom.xml de ticket-webapp :


the eclipse report in console mode :

I have a problem with the plugin enforce that I do not know!
Regards
Philippe
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is a packaging version conflict because the war request should not be in a snapshot version
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!