tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henrique Ordine <hord...@gmail.com>
Subject mvn tomcat:deploy fails with HTTP response 401
Date Fri, 27 Apr 2012 09:37:22 GMT
Hi everybody,

I'm trying to deploy my Maven Web App on my local Tomcat using the
tomcat:deploy maven plugin, but the Manager application fails with a
response code 401.

I have Tomcat 6 installed on Mac OS Leopard, with Java 1.5. I manage to
access my Tomcat/manager app with the user "hordine", that I configured and
deploy

I've configured my tomcat-users.xml, settings.xml, and POM files, like this:

I've added this user to my tomcat-users.xml:
  <role rolename="tomcat"/>
  <role rolename="manager"/>
  <role rolename="manager-script"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="maventomcat" password="maventomcat" roles="manager"/>
  <user username="hordine" password="hordine" roles="manager,
manager-script"/>


I've added this server to my settings.xml:
<servers>
    <server>
        <id>hordineLocalTomcat</id>
        <username>hordine</username>
        <password>hordine</password>
    </server>
</servers>

And I've configured my POM like this:

<build>

<finalName>hTask-web</finalName>

 <pluginManagement>

 <plugins>

  <plugin>

         <groupId>org.apache.tomcat.maven</groupId>

           <artifactId>tomcat-maven-plugin</artifactId>

           <version>1.1</version>

           <configuration>

   <url>http://localhost:8080/manager</url>

   <server>hordineLocalTomcat</server>

   <path>/hTask-web</path>

  </configuration>

  </plugin>

 </plugins>

 </pluginManagement>

</build>


I'd appreciate any help.

This is the entire error's stack trace:

Embedded error: Server returned HTTP response code: 401 for URL:
http://localhost:8080/manager/deploy?path=%2FhTask-web&war=
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot invoke
Tomcat manager
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke
Tomcat manager
at
org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:149)
at
org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:70)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
... 17 more
Caused by: java.io.IOException: Server returned HTTP response code: 401 for
URL: http://localhost:8080/manager/deploy?path=%2FhTask-web&war=
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1196)
at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:604)
at org.codehaus.mojo.tomcat.TomcatManager.deployImpl(TomcatManager.java:662)
at org.codehaus.mojo.tomcat.TomcatManager.deploy(TomcatManager.java:295)
at
org.codehaus.mojo.tomcat.AbstractDeployWarMojo.deployWar(AbstractDeployWarMojo.java:85)
at
org.codehaus.mojo.tomcat.AbstractDeployMojo.invokeManager(AbstractDeployMojo.java:85)
at
org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:141)
... 20 more


-- 
Henrique Ordine

http://hordine.wordpress.com/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message