facebook

tomcat integration – context name between project and pom.xm

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #289613 Reply

    james1969
    Member

    I think I have tomcat integrated with Maven4MyEclipse in MyEclipse 6.5. I seem to be having an issue with the Web Project’s context name and the Maven context name when used to do a tomcat:redeploy.

    I *think* the issue is keeping the Web Project’s context name in sync with the Maven generated context name? How is this handled?

    My Project Settings has the Web Context-root: /cot

    My pom.xml looks like:

    
    <modelVersion>4.0.0</modelVersion>
      <groupId>cot</groupId>
      <artifactId>cot</artifactId>
      <packaging>war</packaging>
      <name/>
      <version>0.0.1-SNAPSHOT</version>
      <description/>
    

    This is the error I am seeing:

    
    The following mojo encountered an error while executing:
    Group-Id: org.codehaus.mojo
    Artifact-Id: tomcat-maven-plugin
    Version: 1.0-alpha-1
    Mojo: redeploy
    brought in via: Direct invocation
    
    While building project:
    Group-Id: cot
    Artifact-Id: cot
    Version: 0.0.1-SNAPSHOT
    From file: /Users/james/code/myeclipse65/cot/pom.xml
    Reason: Cannot invoke Tomcat manager
    
    java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/reload?path=%2Fcot-0.0.1-SNAPSHOT
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1170)
        at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:619)
        at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:574)
        at org.codehaus.mojo.tomcat.TomcatManager.reload(TomcatManager.java:438)
        at org.codehaus.mojo.tomcat.RedeployMojo.invokeManager(RedeployMojo.java:48)
        at org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:132)
        at org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:59)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:577)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
        at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
        at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:903)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:52)
    
    
    
    Error stacktrace:
    org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.codehaus.mojo:tomcat-maven-plugin:1.0-alpha-1:redeploy': Mojo execution failed.
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:505)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForProject(DefaultLifecycleExecutor.java:265)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:191)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:149)
        at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223)
        at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:304)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.java:903)
        at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbedder.java:304)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:63)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:52)
    Caused by: org.apache.maven.plugin.PluginExecutionException: Mojo execution failed.
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:599)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:498)
        ... 12 more
    Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke Tomcat manager
        at org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:140)
        at org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:59)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:577)
        ... 13 more
    Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/reload?path=%2Fcot-0.0.1-SNAPSHOT
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1170)
        at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:619)
        at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:574)
        at org.codehaus.mojo.tomcat.TomcatManager.reload(TomcatManager.java:438)
        at org.codehaus.mojo.tomcat.RedeployMojo.invokeManager(RedeployMojo.java:48)
        at org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:132)
        ... 15 more
    
    
    #289646 Reply

    HTTP 401 error is an authentication problem. Please see here: http://mojo.codehaus.org/tomcat-maven-plugin/usage.html details on how to configure user name and password.

    Please note, Tomcat server installation embedded into MyEclipse was specifically tweaked for optimal performance when using MyEclipse deployment tools and may not be completely compatible with external tools. You should use your own Tomcat installation with Maven.

    #289684 Reply

    james1969
    Member

    Great, thanks for the information.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: tomcat integration – context name between project and pom.xm

You must be logged in to post in the forum log in