You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dean Pullen <De...@msp-uk.com> on 2009/06/14 14:26:35 UTC

Tomcat Maven Plugin - 401 error

Hi all,

Trying to deploy my first app to Tomcat using the Tomcat Maven Plugin.

I only ever seem to get this error however I configure the plugin:

[INFO] Deploying war to http://localhost:8080/suzcrmdata-web
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot invoke Tomcat manager
Embedded error: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/deploy?path=%2Fsuzcrmdata-web&war=



My tomcat-users.xml file states:
<tomcat-users>
 <role rolename="manager"/>
 <role rolename="admin"/>
 <user username="admin" password="admin" roles="admin,manager"/>
</tomcat-users>

My settings.xml states:
<servers>
                <server>
                                <id>localserver</id>
                                <username>admin</username>
                                <password>admin</password>
                </server>
</servers>

My pom.xml states:
<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <configuration>
                                <server>localserver</server>
                                <path>/suzcrmdata</path>
                                <warFile>C:/Home/MSPDev/trunk/suzcrmdata/web/target/suzcrmdata-web-1.0-SNAPSHOT.war</warFile>
                </configuration>
</plugin>


I'm not sure why it tries to deploy using a null war param and also why it tries to deploy to suzcrmdata-web when I've put put the path in the plugin configuration as 'suzcrmdata'.

Any advice would be very much appreciated.

Regards,

Dean.


Scanned by MailDefender - managed email security from intY - www.maildefender.net

RE: Tomcat Maven Plugin - 401 error

Posted by Dean Pullen <De...@msp-uk.com>.
Thanks Oliver, but the explicit username/password configuration doesn't change anything.

tomcat:run isn't a workable idea in the long-term, I need to get the tomcat plugin working in its most basic form...

Can anyone else help?


-----Original Message-----
From: oliver.lamy@gmail.com [mailto:oliver.lamy@gmail.com] On Behalf Of Olivier Lamy
Sent: 15 June 2009 00:20
To: Maven Users List
Subject: Re: Tomcat Maven Plugin - 401 error

Hi,
Perso, I'm using a configuration as this one:

                <configuration>
                  .......
                  <username>${tomcat.user}</username>
                  <password>${tomcat.password}</password>
                  ....
                </configuration>

But if you are in a dev phase (working locally), you don't have to
deploy to a local tomcat instance just use : tomcat:run.

--
Olivier

2009/6/14 Dean Pullen <De...@msp-uk.com>:
> Hi all,
>
> Trying to deploy my first app to Tomcat using the Tomcat Maven Plugin.
>
> I only ever seem to get this error however I configure the plugin:
>
> [INFO] Deploying war to http://localhost:8080/suzcrmdata-web
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Cannot invoke Tomcat manager
> Embedded error: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/deploy?path=%2Fsuzcrmdata-web&war=
>
>
>
> My tomcat-users.xml file states:
> <tomcat-users>
>  <role rolename="manager"/>
>  <role rolename="admin"/>
>  <user username="admin" password="admin" roles="admin,manager"/>
> </tomcat-users>
>
> My settings.xml states:
> <servers>
>                <server>
>                                <id>localserver</id>
>                                <username>admin</username>
>                                <password>admin</password>
>                </server>
> </servers>
>
> My pom.xml states:
> <plugin>
>                <groupId>org.codehaus.mojo</groupId>
>                <artifactId>tomcat-maven-plugin</artifactId>
>                <configuration>
>                                <server>localserver</server>
>                                <path>/suzcrmdata</path>
>                                <warFile>C:/Home/MSPDev/trunk/suzcrmdata/web/target/suzcrmdata-web-1.0-SNAPSHOT.war</warFile>
>                </configuration>
> </plugin>
>
>
> I'm not sure why it tries to deploy using a null war param and also why it tries to deploy to suzcrmdata-web when I've put put the path in the plugin configuration as 'suzcrmdata'.
>
> Any advice would be very much appreciated.
>
> Regards,
>
> Dean.
>
>
> Scanned by MailDefender - managed email security from intY - www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Scanned by MailDefender - managed email security from intY - www.maildefender.net

Scanned by MailDefender - managed email security from intY - www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Tomcat Maven Plugin - 401 error

Posted by Olivier Lamy <ol...@apache.org>.
Hi,
Perso, I'm using a configuration as this one:

                <configuration>
                  .......
                  <username>${tomcat.user}</username>
                  <password>${tomcat.password}</password>
                  ....
                </configuration>

But if you are in a dev phase (working locally), you don't have to
deploy to a local tomcat instance just use : tomcat:run.

--
Olivier

2009/6/14 Dean Pullen <De...@msp-uk.com>:
> Hi all,
>
> Trying to deploy my first app to Tomcat using the Tomcat Maven Plugin.
>
> I only ever seem to get this error however I configure the plugin:
>
> [INFO] Deploying war to http://localhost:8080/suzcrmdata-web
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Cannot invoke Tomcat manager
> Embedded error: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/deploy?path=%2Fsuzcrmdata-web&war=
>
>
>
> My tomcat-users.xml file states:
> <tomcat-users>
>  <role rolename="manager"/>
>  <role rolename="admin"/>
>  <user username="admin" password="admin" roles="admin,manager"/>
> </tomcat-users>
>
> My settings.xml states:
> <servers>
>                <server>
>                                <id>localserver</id>
>                                <username>admin</username>
>                                <password>admin</password>
>                </server>
> </servers>
>
> My pom.xml states:
> <plugin>
>                <groupId>org.codehaus.mojo</groupId>
>                <artifactId>tomcat-maven-plugin</artifactId>
>                <configuration>
>                                <server>localserver</server>
>                                <path>/suzcrmdata</path>
>                                <warFile>C:/Home/MSPDev/trunk/suzcrmdata/web/target/suzcrmdata-web-1.0-SNAPSHOT.war</warFile>
>                </configuration>
> </plugin>
>
>
> I'm not sure why it tries to deploy using a null war param and also why it tries to deploy to suzcrmdata-web when I've put put the path in the plugin configuration as 'suzcrmdata'.
>
> Any advice would be very much appreciated.
>
> Regards,
>
> Dean.
>
>
> Scanned by MailDefender - managed email security from intY - www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org