5

I am trying to redeploy a war from my local machine to a remote Tomcat 7 using command prompt in Windows. I am able to upload the war with the tomcat-maven-plugin for the first time but subsequent uploads gives me a message something like this.

pom.xml

 <!-- Deploy to Remote Tomcat -->
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <url>${unix.tomcat.url}</url>
                    <server>sandbox-tomcat</server>
                    <path>/${project.artifactId}</path>
                </configuration>
            </plugin>

Maven Command:

mvn tomcat7:redeploy

Maven Log:

[INFO] Deploying war to http://secdevapp11.gspt.net:8080/istore-tax-service
Uploading: http://secdevapp11.gspt.net:8080/manager/text/deploy?path=%2Fistore-tax-service&update=true
Uploaded: http://secdevapp11.gspt.net:8080/manager/text/deploy?path=%2Fistore-tax-service&update=true (1334 KB at 512.7 KB/sec)

[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] FAIL - Unable to delete [/nfs/home_04/chandeln/installations/apache-tomcat-7.0.52/webapps/istore-tax-service]. The continued presence of this file may cause problems.
[INFO] FAIL - Application already exists at path /istore-tax-service
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.704s
[INFO] Finished at: Wed Mar 26 15:34:55 EDT 2014
[INFO] Final Memory: 21M/224M
[INFO] ------------------------------------------------------------------------
4

5 回答 5

6

我也有这个问题。对我来说,它可以在 tomcat-plugin 中放入更新标签

        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>     
            ... 
            <update>true</update>

            ...

并再次使用 tomcat7:deploy 命令(而不是“重新部署”)。

(只是注意到答案仍然存在......,抱歉重复)

于 2014-04-13T09:35:07.273 回答
4

这可能是由于文件被tomcat锁定所致。

<Context antiResourceLocking="true">您可以通过添加到 tomcat 上下文来解锁它

于 2014-03-26T19:52:10.073 回答
2

利用

<update>true</update>

http://tomcat.apache.org/maven-plugin-2.2/tomcat7-maven-plugin/deploy-mojo.html#update

于 2014-03-27T04:25:46.617 回答
1

This problem happened to me when deploying maven application from Netbeans IDE 8.0.2 and path in context.xml was set with trailing slash.

<Context antiJARLocking="true" path="/foo/" />

Removing the trailing slash resolved the issue for me.

<Context antiJARLocking="true" path="/foo" />
于 2014-12-19T08:53:02.777 回答
0

我将 antiJARLocking = "true" 添加到我的 context.xml 文件中,如下所示

<Context antiJARLocking = "true" path="/somepath" />

然后右键单击项目并选择“清理并构建”,

并运行您的项目。

这对我有用。

于 2017-01-30T02:25:32.010 回答