2

I am trying to do a remote deploy on a running tomcat 5.5.27 using cargo plugin

On the build server in run mvn -P rdeploy-staging clean package cargo:redeploy There is no error on console, but the app does not start on tomcat, it should be started on "/" root context.

This is my maven profile for remote deploy:

<profile>
        <id>rdeploy-staging</id>
        <build>
            <finalName>ROOT</finalName>
            <resources>
                <resource>
                    <directory>src/main/resources-staging</directory>
                </resource>
                <resource>
                    <directory>src/main/resources</directory>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                            <tasks>
                                <copy file="${basedir}\src\main\webapp\WEB-INF\web_staging.xml"
                                        tofile="${basedir}\src\main\webapp\WEB-INF\web.xml" overwrite="true" />
                            </tasks>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
                <!-- Cargo Plug in -->
                <plugin>
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <version>1.2.2</version>
                    <configuration>
                        <!-- Container configuration -->
                        <container>
                            <containerId>tomcat5x</containerId>
                            <type>remote</type>
                        </container>
                        <configuration>
                            <type>runtime</type>
                            <properties>
                                <cargo.remote.username>admin</cargo.remote.username>
                                <cargo.remote.password>admin</cargo.remote.password>
                                <cargo.hostname>server_ip</cargo.hostname>
                                <cargo.tomcat.manager.url>http://server_ip:8080/manager</cargo.tomcat.manager.url>
                            </properties>
                        </configuration>
                        <deployables>
                            <deployable>
                                <groupId>com.mycompany</groupId>
                                <artifactId>myapp</artifactId>
                                <type>war</type>
                            </deployable>
                        </deployables>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

The output of tomcat standard error log:

INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp\1-ROOT\WEB-INF\lib\grizzly-servlet-webserver-1.9.35.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Sep 19, 2012 1:48:47 PM org.apache.catalina.loader.WebappClassLoader validateJarFile

INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp\1-ROOT\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Sep 19, 2012 1:48:48 PM org.apache.catalina.core.StandardContext start

SEVERE: Error listenerStart Sep 19, 2012 1:48:48 PM org.apache.catalina.core.StandardContext start

SEVERE: Context [] startup failed due to previous errors

2
  • Does it work if you deploy the application manually?
    – Augusto
    Sep 20, 2012 at 7:23
  • Yes, it works if you deploy by tomcat manager or just copy the ROOT.war into webapps directory. It also works if I deploy with cargo in my local machine, the problem happens when deploying using cargo in the staging server. Sep 20, 2012 at 13:28

0

Your Answer

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

Browse other questions tagged or ask your own question.