Showing posts with label Tomcat. Show all posts
Showing posts with label Tomcat. Show all posts

Tuesday, June 3, 2008

Set tomcat not to lock any file

Try create context.xml in META-INF:

<Context antiResourceLocking="true" antiJARLocking="true">
</Context>

and redeploy web app.

Tested on Tomcat 5.5

Hot deployment on Tomcat with cargo


<project>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.vlab</groupId>
<artifactId>myproject</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<groupId>org.vlab</groupId>
<version>1.0-SNAPSHOT</version>
<artifactId>deployModules</artifactId>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.vlab.jsf</groupId>
<artifactId>module1</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.vlab.jsf</groupId>
<artifactId>module2</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.vlab.jsf</groupId>
<artifactId>module3</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
<execution>
<id>verify-deploy</id>
<phase>install</phase>
<goals>
<goal>deployer-deploy</goal>
</goals>
</execution>
<execution>
<id>clean-undeploy</id>
<phase>pre-clean</phase>
<goals>
<goal>deployer-undeploy</goal>
</goals>
</execution>
</executions>

<configuration>

<!-- Container Configuration -->
<container>
<containerId>tomcat5x</containerId>
<type>remote</type>
</container>

<!-- Configuration to use with the container -->
<configuration>
<type>runtime</type>
<properties>
<cargo.tomcat.manager.url>
http://localhost:8080/manager
</cargo.tomcat.manager.url>
<cargo.remote.username>
bollig
</cargo.remote.username>
<cargo.remote.password>
test
</cargo.remote.password>
</properties>
</configuration>

<!-- Deployer and Deployables configuration -->
<deployer>
<type>remote</type>
<deployables>
<deployable>
<groupId>org.vlab.jsf</groupId>
<artifactId>module1</artifactId>
<type>war</type>
<pingURL>http://localhost:8080/module1-1.0-SNAPSHOT/helloWorld.jsf</pingURL>
</deployable>
<deployable>
<groupId>org.vlab.jsf</groupId>
<artifactId>module2</artifactId>
<type>war</type>
<pingURL>http://localhost:8080/module2-1.0-SNAPSHOT/helloWorld.jsf</pingURL>
</deployable>
<deployable>
<groupId>org.vlab.jsf</groupId>
<artifactId>module3</artifactId>
<type>war</type>
<pingURL>http://localhost:8080/module3-1.0-SNAPSHOT/helloWorld.jsf</pingURL>
</deployable>
</deployables>
</deployer>

</configuration>
</plugin>
</plugins>
</build>

</project>

Refer to http://www.gorerle.com/vlab-wiki/index.php?title=Tomcat_Deployment_in_Maven2#HotDeploy_With_Cargo

Manager Application of Tomcat

Manager Application is a special web application that allows you to manage other web applications while the Tomcat server is running. You can, for example, deploy, undeploy, start, and stop web applications on the server using this tool.

To enable it on Tomcat 6.x, you need add a user with the manager role to this file "\conf\tomcat-users.xml"

<role rolename="manager"/>
<user username="tomcat" password="tomcat" roles="tomcat, manager"/>

Save the file, restart the tomcat.

Here is the url to visit the manager application
http://localhost:8080/manager/html