IDE
From CauchoWiki
Third parties have developed Plugins for Resin. However, Resin is lightweight and simple enough that most users manually configure their IDE for use with Resin.
Contents |
[edit] Eclipse
The Resin Eclipse plugin is available on the Caucho Eclipse update site at http://caucho.com/eclipse. It is based on the WTP framework and features deployment modes for Resin 3.1 and 4.0.
[edit] Deployment styles
- .war file (default) - the plugin builds a .war file of your project, then starts Resin and copies the .war to the live deploy directory.
- Temporary directory - the plugin builds a .war file of your project, then starts Resin and copies the .war to a temporary deploy directory.
- In-place - the plugin starts Resin, then points it to server your project directly out of the workspace.
- Hot-deploy - (Resin 4.0 only) the plugin builds a .war file of your project, then starts Resin and uses Resin's Git deployment functionality to deploy
[edit] Options for configuration
- The very basic configuration that's included with the plugin itself
- The configuration in the "conf" subdirectory of the Resin home
- A configuration somewhere else in the file system (e.g. /etc/resin).
If you're starting a new project and don't need to do anything fancy, the first option is recommended, copying the configuration from the plugin. If you do need to use a custom configuration, you may need to modify it to recognize the variables that the plugin sets at runtime. The dialog box tells you what these variables are and how to set them, depending on which server profile you use.
[edit] Notes
Eclipse must be run with a JDK, not simply a JRE, to use the Resin plugin.
[edit] References
- Resin Eclipse plugin snapshot (2009-08-18) - Blog post about using the plugin's Server configuration
- Remote deploy in Resin, Part 2 (2009-01-29) - Blog post about using host deploy
[edit] General Principles
[edit] Starting Resin
Two styles find favor with developers. Remote debugging is used to debug a standalone instance of Resin. Starting Resin from within the IDE gives control of the startup and shutdown of the Resin server to the IDE.
[edit] Remote Debugging
Resin is started in a console window, with a remote debugging port enabled. The IDE is configured to attach to the remote debugging port. Resin's builtin facilities for detecting changes to web applications (.class and .java files, .jsp files, etc) enable the Resin server to stay synchronized with changes made in the IDE.
win> httpd.exe -Xdebug -Xrunjdwp:transport=dt_socket,address=9080,server=y,suspend=n ...
unix> bin/httpd.sh -Xdebug -Xrunjdwp:transport=dt_socket,address=9080,server=y,suspend=n ...
The conf file described in development.conf is well suited for development of one web application.
win> httpd.exe -server-root /path/to/webapp -Xdebug
-Xrunjdwp:transport=dt_socket,address=9080,server=y,suspend=n
-J-ea -conf conf/development.conf
unix> bin/httpd.sh -server-root /path/to/webapp -Xdebug
-Xrunjdwp:transport=dt_socket,address=9080,server=y,suspend=n
-J-ea -conf conf/development.conf
[edit] Starting Resin from within the IDE
Resin is started and stopped by the IDE. Console messages appear in the console window of the IDE.
| IDE configuration | value | description |
|---|---|---|
| Classpath | all of the jars in resin.home/lib, see Global Library| | |
| Java argument | -Djava.system.class.loader=com.caucho.loader.SystemClassLoader | |
| Main class | com.caucho.server.resin.Resin | |
| Program argument | -conf conf/development.conf | See development.conf |
| Program argument | -server-root /path/to/webapp | The location of the web-app |
[edit] Additional configuration
Some systems require additional configuration, indicated by Resin error messages.
| IDE configuration | value | description |
|---|---|---|
| Classpath | java.home/lib/tools.jar | Needed for compiling java files |
| Java argument | -Dresin.home=/usr/local/resin | Needed if Resin cannot discover the value programmatically |
[edit] Development resin.conf
development.conf describes a typical configuration file used for development purposes.
