English 中文(简体)
Hot Deploy of development changes with Eclipse, Tomcat, and Jetspeed
原标题:

I am developing a Jetspeed portal application running on Tomcat, using the Eclipse IDE with the Sysdeo Tomcat launcher plugin to enable debugging of the application running in Tomcat/Jetspeed.

I was wondering how to enable hot deploy of development changes for this environment? Does anyone know how to configure a Jetspeed portal web application to be hot-deployed from Eclipse? Can t really find any information on the net for Jetspeed hot deployment.

问题回答

I usually create an ant build file, loosely based on:

http://tomcat.apache.org/tomcat-6.0-doc/appdev/build.xml.txt

and use the install / remove targets to deploy to a remote tomcat

Similar question here: Remote deploy Tomcat webapp from Eclipse

If you re talking about only developing on your local machine- you don t need an external plugin to eclipse, it has built in support for Tomcat and hot redeployment.

You might want to take a look at jrebel. I ve been meaning to take a look myself - From my understanding, jrebel makes it possible to make source code changes and then be able to immediately see the results in a live environment (such as tomcat) without redeploying and/or restarting services.

From your question it is not entirely clear if you want to deploy your Jetspeed Portal project or a portlet application. The first is in fact a regular web application and theoretically can be hot-deployed using the Eclipse WTP plugin. If you are developing portlet applications, it is more complicated because they are not deployed to Tomcat directly, but to the Jetspeed deployement running in Tomcat (actual /webapps/jetspeed-portal/WEB-INF/deploy ).

A trick I used is deploying your application using your Maven build script. After that, you can copy the modifications made by tomcat to your web.xml of your portlet into your web.xml and deploy directly from Eclipse.

You can use the bult-in (in the Java EE version) Servers plugin:

  1. Go to Windows > Preferences > Server > Runtime environments and add your tomcat
  2. Either try using publishing, or use the FileSync plugin. There you can tell which folders from your project should be copied (live) to what directory on your machine (the tomcat/webapps/yourapp). With a little more effort the filesync configuration can be made machine independent (only using one parameter as TOMCAT_ROOT), in case you want to check-in the project to a repository where others will use it.
  3. Start your tomcat in debug mode and you have hot-deploy of everything you save.

I m aware that using the FileSync plugin is not generally accepted, and publishing is the most common option, but FileSync gives you additional freedom to rearrange your classes and resources.

Obviously it is not the solution for all the cases, but a simple symbolic link will do the job for many cases, even in windows xp or windows 7, that now permit the creation of symbolic links.

My solution is depicted here





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签