2

I am trying to build and deploy the Struts2 "tutorial" sample project on Tomcat 7 running on another computer on the network. The project builds fine and deploys fine on the local machine, but gives an error(indicated below) while deploying on the remote computer.

The settings in the pom.xml file are :

<plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>tomcat-maven-plugin</artifactId>
             <version>1.1</version>
             <configuration>
                 <url>http://10.0.0.220:8080/manager</url>
                  <server>myserver</server>
             </configuration>
        </plugin>

where, 10.0.0.220:8080 is the address of the computer where I am trying to deploy the WAR file.

The code in my settings.xml of Maven in my local machine are :

<server>
        <id>myserver</id>
        <username>travel</username>
        <password>travel</password>
</server>

the code in the Tomcat 7.0/conf/tomcat-users.xml file on the computer where I am trying to deploy is:

<user name = "travel" password = "travel" roles = "manager-gui,admin-gui" />

Moreover, I can access http://10.0.0.220:8080/manager from my web browser from the local computer and deploy my WAR file manually.

However, when I use mvn tomcat:deploy on the local machine, it says BUILD FAILURE

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy
(default-cli) on project tutorial: Cannot invoke Tomcat manager: Server returned
 HTTP response code: 403 for URL: http://10.0.0.220:8080/manager/deploy?path=%2F
tutorial&war= -> [Help 1]

and when I use mvn tomcat:run I get the following :

    INFO: ... initialized Struts-Spring integration successfully
Apr 21, 2011 3:39:22 PM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
        at java.net.ServerSocket.bind(ServerSocket.java:319)
        at java.net.ServerSocket.<init>(ServerSocket.java:185)
        at java.net.ServerSocket.<init>(ServerSocket.java:141)
        at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(De
faultServerSocketFactory.java:50)
        at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
        at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)

        at org.apache.catalina.connector.Connector.initialize(Connector.java:101
4)
        at org.apache.catalina.startup.Embedded.start(Embedded.java:830)
        at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMo
jo.java:558)
        at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
:255)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.330s
[INFO] Finished at: Thu Apr 21 15:39:23 IST 2011
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run (de
fault-cli) on project tutorial: Could not start Tomcat: Protocol handler initial
ization failed: java.net.SocketException: Unrecognized Windows Sockets error: 0:
 JVM_Bind -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.

What could be causing this problem? I have turned the windows firewall off and UAC settings to "Never Notify" .

Also, if I use mvn tomcat:deploy on my local machine (which is running tomcat 5), it deploys fine.

1 Answer 1

8

I encountered what appears to be the same problem. With Tomcat 7, the default deployment URL changed from http://localhost:8080/manager to http://localhost:8080/manager/html.

1
  • 4
    Actually the right url i found out is "localhost:8080/manager/text" . This works for Tomcat 7. Probably your url is right too, but I didn't test it.
    – vaibhav
    Apr 30, 2011 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.