Posts

Showing posts with the label tomcat

Deploying to Tomcat 7 with Maven

It's sometimes nice to be able to update a development Tomcat 7 server from Maven - this makes it simple to hook automatic deployment into a CI server or just update the dev server as a developer. First, the Tomcat manager application needs to be installed (check Tomcat's webapps directory for the manager application) and configured with the appropriate user credentials: Now, I needed to define the server admin credentials in my maven settings (~/.m2/settings.xml): Then, I updated the POM to configure the maven tomcat plugin : Now, using 'mvn tomcat7:redeploy' lets me update the dev server. Note however, on Windows you may have some problems with undeploying the application - after an undeploy command, some jars may be left over in the webapps/appname directory. When you try to redeploy your app you'll see an error containing " cannot invoke tomcat manager fail - unable to delete... ". To work around this, you can change the TOMCAT_HOME/...

URI "file:./" is not hierarchical

Just recently I came across the following exception when deploying a simple Grails application to Tomcat : URI "file:./" is not hierarchical The application was so simple and ran locally on tomcat-6.0.16 - it had to be something environmental. Comparing the differences between machines showed that it was the JVM that was different. The JVM that produced the error was: java version "1.5.0" gij (GNU libgcj) version 4.2.4 (Ubuntu 4.2.4-1ubuntu3) while the Sun JRE 1.6 was okay: java version "1.6.0_03" Java(TM) SE Runtime Environment (build 1.6.0_03-b05) Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode) Note that this occurred on Ubuntu 8.04 64 bit Linux: Linux dev 2.6.24-21-generic #1 SMP Mon Aug 25 16:57:51 UTC 2008 x86_64 GNU/Linux