• 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

Deploying maven-webapp-project in tomcat10

 
Ranch Hand
Posts: 87
  • Number of slices to send:
    Optional 'thank-you' note:
I have generated webapp using maven:archetype selecting maven-archetype-webapp as template

and the below config inside build section of pom.xml

For tomcat in tomcat-users.xml, inside tomcat-users section

and maven settings.xml

I have checked that I am able to go to localhost:8080/ and click on manager-app and able to see Tomcat Web Application Manager

But when I run
<code>mvn clean install tomcat7:deploy </code>

I am getting the below error
```
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project my-webapp: Cannot invoke Tomcat manager: Server returned HTTP response code: 40
5 for URL: http://localhost:8080/manager/deploy?path=%2Fmy-webapp&war= -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

```
What I am trying to do is, get maven to copy the war file and deploy into tomcat-server

P.S I am using tomat 10
 
Bartender
Posts: 2436
13
  • Number of slices to send:
    Optional 'thank-you' note:
Do you think it is helpful :
https://stackoverflow.com/questions/15410914/tomcatdeploy-cannot-invoke-tomcat-manager-connection-refused ?
 
Bhaskar Bantupalli
Ranch Hand
Posts: 87
  • Number of slices to send:
    Optional 'thank-you' note:
No, I have already mentioned most of those steps in original post except for <path>/<path> which also didn't work.
I tried changing plugin from tomcat7 to tomcat and also maven command from tomcat7 to tomcat , they didn't work too which I haven't mentioned in the post.
 
Saloon Keeper
Posts: 27868
196
  • Number of slices to send:
    Optional 'thank-you' note:
Tomcat 7 is seriously ancient at this point.

If your code is still using the javax JEE class packages, you should consider Tomcat 9. If you are using jakarta JEE class packages, use Tomcat 10 or later.

Note that the Maven archetypes are generally not well-maintained and can be unreliable at best. At this point you will probably need to take your archetype-generated project and manually update the obsolete stuff.
 
Bhaskar Bantupalli
Ranch Hand
Posts: 87
  • Number of slices to send:
    Optional 'thank-you' note:
I am not using tomcat 7. I am using tomcat 10. I am trying the tomcat-maven-plugin and tomcat7-maven-plugin which have tomcat7:deploy or tomcat:deploy (plugin:goal). It is in a course about maven.
 
Tim Holloway
Saloon Keeper
Posts: 27868
196
  • Number of slices to send:
    Optional 'thank-you' note:
I would be very wary about using a "tomcat7" component and expecting things to work on Tomcat 10.

I don't use Maven to deploy or run Tomcat, but some similar services would actually be downloading a Tomcat 7 and deploying to it, not to a Tomcat you happened to have installed externally. In any event, there are differences in database connection pools, security roles and Realms between Tomcat 7 and Tomcat 10.

You can download anything from the Internet — or for that matter type it in from a book. But that doesn't mean it will still work properly years later. I must have spent half a decade admonishing people not to use features of JavaServer Faces that had been deprecated when JSF moved from experimental to production because they were getting fed stale info from their web searches.
 
Greenhorn
Posts: 1
  • Number of slices to send:
    Optional 'thank-you' note:
Did you ever find the solution for issue? "tomcat8-maven-plugin" is the best I could find. There is not a "tomcat10-maven-plugin" and don't even know if there will be one which the devs may have a different solution or in mind.
Did you end up using a different maven archetype strictly for tomcat and jakarta conversion?
Does your project happen to use jakarta libraries?

I'm stuck on the same exact issue and struggling to clean and build mine for tomcat10.
 
Bhaskar Bantupalli
Ranch Hand
Posts: 87
  • Number of slices to send:
    Optional 'thank-you' note:
Hi Bruce, I couldn't find any solution. I was following Learning Apache Maven back then
 
Saloon Keeper
Posts: 15621
366
  • 1
  • Number of slices to send:
    Optional 'thank-you' note:
It's a bit confusing, but the tomcat7 plugin is indeed the correct one to use if you want to deploy a web application to Tomcat 10. The name tomcat7 should be understood as tomcat7andhigher.

Things to look out for:

  • Explicitly set a version for all default plugins used in your build.
  • Use a jakarta.servlet-api or a jakarta.jakartaee-web-api version that's compatible with your application container.
  • Ensure that the tomcat7 plugin configuration refers to the correct server ID from your settings.xml.
  • Ensure that the settings.xml uses the same username and password as used in tomcat-users.xml.
  • Ensure that you have the correct roles set for your tomcat user.

  • I created a minimal POM that should work with Tomcat 10:

    My settings.xml looks similar to this:

    My tomcat-users.xml looks similar to this:
     
    Tim Holloway
    Saloon Keeper
    Posts: 27868
    196
    • Number of slices to send:
      Optional 'thank-you' note:
    Just to avoid confusion here:

    1. The pom.xml file is located at the root of the project (of course!)

    2. The settings.xml file is located in the Maven configuration directory for the developer ($HOME/.m2, for Linux users).

    3. The tomcat-users.xmlfile is located (by default) in the Tomcat configuration directory (TOMCAT_HOME/conf).

     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic
    vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
    http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |