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

Set up Tomcat

 
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That'll work.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is a packaging version conflict because the war request should not be in a snapshot version
 
reply
    Bookmark Topic Watch Topic
  • New Topic