Eclipse

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
(Server Licenses)
 
(76 intermediate revisions by 3 users not shown)
Line 1: Line 1:
(This page is incomplete and currently being actively updated!)
+
Resin includes excellent support for Eclipse much in the same fashion as other Java application platforms.
 
+
This page describes the details of the Resin Eclipse plugin.
Resin includes excellent support for Eclipse much in the same fashion as other Java application platforms like GlassFish, JBoss and Tomcat. This page describes the details of the Resin Eclipse plugin.
+
  
 
===Eclipse Versions Supported===
 
===Eclipse Versions Supported===
Like Tomcat, GlassFish and JBoss the Resin Eclipse plugin is based on WTP. You must have WTP installed for the Resin plugin to work. Generally, if you download the Eclipse IDE for Java EE Developers, it will automatically include WTP. Otherwise, you can add WTP to your Eclipse installation yourself.
+
Like the Eclipse plugins from other vendors, the Resin Eclipse plugin is based on the proven [http://www.eclipse.org/webtools/ Eclipse Web Tools Platform (WTP)]. You must have the WTP installed for the Resin plugin to work. Generally, if you download the [http://www.eclipse.org/downloads/ Eclipse IDE for Java EE Developers], it will automatically include the WTP. This is by far the easiest way to get started. Otherwise, you can add the WTP to your Eclipse installation yourself.
  
The Resin Eclipse plugin supports Helios (Eclipse 3.6) and above. For Indigo (Eclipse 3.7) and above, the Resin plugin need not be installed via the Resin Eclipse plugin update site ([http://www.caucho.com/eclipse http://www.caucho.com/eclipse]) since the Resin plugin is already registered with Indigo. For previous versions, you must install the plugin from the Resin Eclipse plugin site. Both sets of installation instructions are described below.
+
The Resin Eclipse plugin supports Helios (Eclipse 3.6) and above.
 +
For Indigo (Eclipse 3.7) and above, the Resin plugin is already registered.
 +
If you're using Helios (3.6), the plugin should be installed through the [http://www.caucho.com/eclipse/ Resin Eclipse Plugin update site].  
  
===Installing through Eclipse Server auto-discovery===
+
Detailed instructions on how to install the plugin for your version of Eclipse are described below.
 +
 
 +
===Installing through Eclipse Server auto-discovery (Indigo and above)===
 
To install Resin on Indigo or above, go to the 'Servers' View - it is typically in the bottom tabs (make sure you are in the Java EE Perspective). Right click and select 'New->Server'. In the 'New Server' dialog, you will likely not see Resin as an option. To install Resin, you will have to click on the 'Download additional server adapters' option. It will take a few seconds for the 'Install New Extension' dialog to fully load. Once it loads, select the 'Resin (Java EE Web Profile) Server' option and click 'Next'.
 
To install Resin on Indigo or above, go to the 'Servers' View - it is typically in the bottom tabs (make sure you are in the Java EE Perspective). Right click and select 'New->Server'. In the 'New Server' dialog, you will likely not see Resin as an option. To install Resin, you will have to click on the 'Download additional server adapters' option. It will take a few seconds for the 'Install New Extension' dialog to fully load. Once it loads, select the 'Resin (Java EE Web Profile) Server' option and click 'Next'.
 
[[Image:New_extension.png|center|frame|Install Server Support for Resin]]
 
[[Image:New_extension.png|center|frame|Install Server Support for Resin]]
Accept the license terms to start the installation (you might also get an "unsigned content" warning to proceed with the installation). The installation might take a few minutes.
+
Accept the license terms to start the installation (you might also get an "unsigned content" warning; this is OK, accept it to proceed with the installation). The installation might take a few minutes.
 
[[Image:Installing_resin.png|center|frame|Installing Server Support for Resin]]
 
[[Image:Installing_resin.png|center|frame|Installing Server Support for Resin]]
 
Once the installation finishes, you may be asked to restart Eclipse. You should verify a successful installation by checking if Resin is included in the 'New Server' dialog.
 
Once the installation finishes, you may be asked to restart Eclipse. You should verify a successful installation by checking if Resin is included in the 'New Server' dialog.
 
[[Image:New_server_resin.png|center|frame|New Server Dialog with Resin Support]]
 
[[Image:New_server_resin.png|center|frame|New Server Dialog with Resin Support]]
  
===Installing from the Resin Eclipse plugin update site===
+
===Installing from the Resin Eclipse plugin update site (Helios and above)===
Eclipse versions prior to Indigo did not have Resin automatically registered as a server option. For these versions, you will need to install the Resin plugin yourself directly from the Resin Eclipse plugin website (http://www.caucho.com/eclipse). One very nice side-effect of the manual plugin installation option is that you can download the very latest pre-release Resin Eclipse plugin snapshot from the snapshot site (http://www.caucho.com/eclipse-snapshot).
+
Eclipse versions prior to Indigo did not have Resin automatically registered as a server option. For these versions, you will need to install the Resin plugin yourself directly from the [http://www.caucho.com/eclipse/ Resin Eclipse plugin website] ([http://www.caucho.com/eclipse/ http://www.caucho.com/eclipse/]). One very nice side-effect of the manual plugin installation option is that you can download the very latest pre-release Resin Eclipse plugin snapshot from the [http://www.caucho.com/eclipse-snapshot/ Resin Eclipse plugin snapshot site] ([http://www.caucho.com/eclipse-snapshot/ http://www.caucho.com/eclipse-snapshot/]).
  
To install the plugin, you must first register the plugin website as an Available Software Site in Eclipse. You do this by going to 'Help->Install New Software...->Add...'. In the 'Add Repository' dialog, enter a name and the location for the Resin Eclipse plugin website (http://www.caucho.com/eclipse).
+
To install the plugin, you must first register the plugin website as an Available Software Site in Eclipse. You do this by going to 'Help->Install New Software...->Add...'. In the 'Add Repository' dialog, enter a name and the location for the Resin Eclipse plugin website ([http://www.caucho.com/eclipse/ http://www.caucho.com/eclipse/]).
 
[[Image:Add_repository.png|center|frame|Add Resin Eclipse Plugin Site]]
 
[[Image:Add_repository.png|center|frame|Add Resin Eclipse Plugin Site]]
 
After clicking OK, the plugin site will be registered. After the site is registered, select "Resin (Java EE 6 Web Profile) Server" and click 'Next'.
 
After clicking OK, the plugin site will be registered. After the site is registered, select "Resin (Java EE 6 Web Profile) Server" and click 'Next'.
 
[[Image:Install_resin.png|center|frame|Installing Resin]]
 
[[Image:Install_resin.png|center|frame|Installing Resin]]
Review the installation and click 'Next' again. Accept the license terms to start the installation (you might also get an "unsigned content" warning to proceed with the installation). The installation might take a few minutes. Once the installation finishes, you may be asked to restart Eclipse. Once the installation finishes, go to the 'Servers' View - it is typically in the bottom tabs (make sure you are in the Java EE Perspective). Right click and select 'New->Server'. In the 'New Server' dialog, you will see Resin as an option.
+
Review the installation and click 'Next' again. Accept the license terms to start the installation (you might also get an "unsigned content" warning; that's OK right now, simply accept it to proceed with the installation). The installation might take a few minutes. Once the installation finishes, you may be asked to restart Eclipse. Once Eclipse is restarted, go to the 'Servers' View - it is typically in the bottom tabs (make sure you are in the Java EE Perspective). Right click and select 'New->Server'. In the 'New Server' dialog, you will see Resin as an option.
 
[[Image:New_server_resin.png|center|frame|New Server Dialog with Resin Support]]
 
[[Image:New_server_resin.png|center|frame|New Server Dialog with Resin Support]]
  
===Adding a runtime===
+
===Adding a server===
 
To add a server, use the Add Server dialog and choose Resin.
 
To add a server, use the Add Server dialog and choose Resin.
  
The first step to adding a server is adding a Resin runtime. A Resin runtime essentially corresponds to a Resin installation while a server corresponds to particular running instance of the runtime. If you only care about running a single instance of Resin, the runtime and server would be synonymous to you. If you have already created a runtime, you can simply use that to create a new server by choosing it in the first step of the dialog. If the Resin plugin does not find an existing runtime, it will automatically start the Add New Runtime dialog for you as part of adding the server. A runtime consists of a JRE as well as a Resin installation (Resin Home). If you already have Resin installed, point Resin Home to where you installed Resin. If you have not yet installed Resin, you can do so now by clicking the 'Download and Install' button. This will install the latest version of Resin in the Resin Home location.
+
The host name and server name values in this dialog are significant. The host name is the location of Resin instance. If you intend to run Resin locally, the default value of "localhost" is correct. The server name is the name of the server in Eclipse. You should choose a sensible name that is meaningful to you.
 +
 
 +
[[Image:New_server_resin.png|center|frame|New Local Server]]
 +
 
 +
If you plan on using a Resin instance on a remote server, you should enter the IP address or DNS name of that server in the host name field.
 +
 
 +
[[Image:remote_resin.jpg|center|frame|New Remote Server]]
 +
 
 +
===Adding a runtime===
 +
The first step to adding a server is adding a Resin runtime. A Resin runtime essentially corresponds to a Resin installation, while a server corresponds to particular running instance of the runtime. If you only care about running a single local instance of Resin, the runtime and server would be synonymous to you.
 +
 
 +
If you have already created a runtime, you can simply use that to create a new server by choosing it in the first step of the Add Server dialog (as shown in the last diagram in this section). If the Resin plugin does not find an existing runtime, it will automatically start the Add New Runtime dialog for you as part of adding the server as well as omitting the runtime selection choice in the Add Server dialog (as is the case with all the Add Server dialog diagrams shown so far). A runtime consists of a JRE as well as a Resin installation (Resin Home). If you already have Resin installed, point Resin Home to where you installed Resin. If you have not yet installed Resin, you can do so now by clicking the 'Download and Install' button. This will install the latest version of Resin in the Resin Home location.
 +
 
 
[[Image:Add_server.png|center|frame|Add Resin runtime]]
 
[[Image:Add_server.png|center|frame|Add Resin runtime]]
 +
 +
Note that in case of a remote Resin instance, the runtime must match the remote server that you are using, both for the JRE and the Resin version in use.
 +
 
If you need it, you can certainly create more than one Resin runtime. The most common use of this is using more than one Resin version at a time. You create new runtimes by selecting 'Window->Preferences->Server->Runtime Environments->Add...'.  
 
If you need it, you can certainly create more than one Resin runtime. The most common use of this is using more than one Resin version at a time. You create new runtimes by selecting 'Window->Preferences->Server->Runtime Environments->Add...'.  
 +
 
[[Image:Runtimes.png|center|frame|Runtimes]]
 
[[Image:Runtimes.png|center|frame|Runtimes]]
While adding a new server, you can choose the existing runtime that is most suitable.
+
 
 +
While adding a new server, you can choose the existing runtime that is most suitable. The Resin plugin will detect and list all the registered runtimes that it finds.
 +
 
 
[[Image:Existing_runtime.png|center|frame|Choose Existing Runtime]]
 
[[Image:Existing_runtime.png|center|frame|Choose Existing Runtime]]
  
 
===Server Licenses===
 
===Server Licenses===
The next step to  
+
The next step to adding a runtime is requesting a development license. You can use the development license to enable Resin Pro features like clustering or extended health checks. The license will be sent to you via email.
License is requested once per runtime and only if selected directory does not have any *.license files in RESIN_HOME/licenses
+
 
[[Image:Licenses.png|center|frame|Get Development License]]
 
[[Image:Licenses.png|center|frame|Get Development License]]
 +
Note the license dialog will only appear if your Resin installation is missing a license. Otherwise, the license dialog is omitted and your existing license is used.
 +
 +
Requesting a license is completely optional and can be skipped over. All of the Resin Open Source features will still be available to you for development.
 +
 +
===Configure Server===
 +
Once you've setup a Resin runtime, you will need to configure the server instance. The Configure Server dialog is fairly self-explanatory. Resin Home is taken from the Resin Runtime for which you are configuring a server. The working directory can and should be different than the Resin Home if you are running multiple instances against the same runtime. If you are running just one instance of Resin, it makes sense for Resin Home and the working directory to be the same, which is the default.
 +
 +
[[Image:Configure_server-1.png|center|frame|Configure Server]]
 +
 +
The port configuration is the HTTP port for Resin, the default for which is 8080. If you wish, you can use git-based remote deployment. In fact, this is the default choice while working with a remote server.
 +
 +
[[Image:configure_remote-1.png|center|frame|Configure Remote Server]]
 +
 +
You can also change the web apps directory for Resin (you can use relative or absolute paths). In most cases, the default of 'webapps' relative to the Resin working directory is probably fine. By default Eclipse projects are deployed as WAR files to the Resin web apps directory. If you want, you can skip the WAR packaging step by choosing 'Deploy as directory'. This will deploy the web application as in exploded form to the web apps directory instead and skip the WAR file creation altogether. Version 4.0.23 of Eclipse plugin adds a new "Deploy from workspace" deployment option. This option attempts to link WebContent directory of the Web Application project into Resin's 'webapps/$context' directory. The '$context' in the link's path is the name of the context of your Web Application. Along with the link a resin-web-pre.xml configuration file is created in WebContent/WEB-INF. The file configures a classloader that will look for classes in the output path of the Eclipse's project.
 +
 +
You are required to specify an admin user and password for the Resin server. You can use the defaults, but it is prudent to change it. In case of a remote server, the admin user and password values must match the ones for the remote server specified using the <resin:AdminAuthenticator> tag. Also, the remote server must have remote administration enabled using the <resin:RemoteAdminService> tag. For remote servers, you must also specify the remote debug port. The default port, 5005 should be sufficient for most cases. We will discuss remote debugging in greater detail in a later section.
 +
 +
After you configure the server, you can add one or more existing projects to the Resin server as the final step of adding a server. Once a server is added, you will see it in the 'Servers' view.
 +
 +
[[Image:Servers.png|center|frame|Resin instance in Servers View]]
 +
 +
===Local Server Configuration===
 +
Unless you are using a remote server, you can configure servers right from Eclipse.
  
===Server Configuration===
+
The configuration for each Eclipse Resin local server instance is stored under the /Servers directory in your Project Explorer. You will see the main resin.xml configuration file as well as admin-users.xml (pre-filled with the values you entered during server configuration), app-default.xml as well as health.xml. The plugin uses the configuration supplied with Resin for creating the instance configuration. For remote deployment and restart purposes it adds <resin:RemoteAdminService/> to resin.xml, in addition to enabling admin-users.xml.
The next step to adding a server is configuring an instance.  
+
[[Image:Configure_server.png|center|frame|Choose Existing Runtime]]
+
This page allows to choose method of publishing "git", "war" or exploded directory. All methods now require a username and a password which are now prefilled with 'admin' and 'password'. This is needed in order to restart an application automatically after deploying.
+
  
Host field on the first page defaults to localhost, but in case of remote deployment must be changed to that of remote Resin install.
+
[[Image:Resin_configuration_eclipse.png|center|frame|Resin Configuration Files]]
  
===Webapps directory===
+
You can configure your local Resin instance appropriately for development using the configuration files in /Servers.
When prefixed with / or x:\ considered an absolute path, otherwise considered rooted at RESIN_ROOT.
+
  
===Port===
+
===Modifying Server===
It must correspond to the HTTP port of Resin.
+
You can modify the server once it is created, to a greater degree than the server creation wizard allows. In order to modify the server, right click on the instance and select open. This will open a property sheet in Eclipse showing all the configuration options you can modify, including the fine-grained launch configuration.
 +
[[Image:Modify_server-1.png|center|frame|Modify Server]]
 +
You can modify the server name, host name, underlying runtime, where the Resin configuration is stored, the server address, server port, automatic publish settings, server operation timeouts and so on. Generally, the defaults are suitable for most situations.
  
 +
A new 'Do not deploy' deployment option is added as of release 4.0.24. This option allows Eclipse to execute its 'Run As' or 'Debug As' routine without actually deploying the app. You can think of this deployment mechanism as a 'No Operation Deployment'. This can be used when Resin is configured to deploy an application using <web-app> configuration element inside of resin.xm. e.g. <web-app id="/test" root-directory="c:/My Documents/.../workspace/test"/>.
  
===resin.xml configuration===
+
===Server Operations===
The plugin uses default configuration supplied with Resin. For remote deployment and restart purposes it adds <resin:RemoteAdminService/>. For users it adds an admin-users.xml with the user supplied in the dialog.
+
The Resin plugin supports all of the common server operations supported by WTP (for details on these check out a good Eclipse/WTP tutorial for your Eclipse version). You can start a server, stop a server, restart a server, debug on the server, profile a server, add/remove projects to the server, clean the server, deploy/redeploy applications and so on.
  
 +
[[Image:Server_operations.png|center|frame|Server Operations]]
  
 +
A majority of these operations can be accessed by right-clicking the server instance or right clicking a project associated with a Resin server.
  
The Resin Eclipse plugin is available on the Caucho Eclipse update site at [http://caucho.com/eclipse http://caucho.com/eclipse].  It is based on the WTP framework and features deployment modes for Resin 3.1 and 4.0.
+
Note that for remote servers the only operations that are permitted are deployment, un-deployment and remote debugging. These operations are only enabled if the remote server is currently running. The plugin will automatically detect if a remote server is running and will update the remote server status in Eclipse.
  
===Deployment styles===
+
[[Image:Remote_operations.png|center|frame|Remote Server Operations]]
  
* .war file (default) - the plugin builds a .war file of your project, then starts Resin and copies the .war to the live deploy directory.
+
Note that the context menu items for debugging are also disabled for remote servers. This is because remote servers can only be debugged as remote applications through the remote debug port. The following section describes how the plugin supports debugging a remote Resin instance.
* 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
+
  
===Options for configuration===
+
===Remote Debugging===
* The very basic configuration that's included with the plugin itself
+
The plugin supports debugging by automatically creating a remote application debugging profile in Eclipse when you create a remote server. For details on remote application debugging, check out a good Eclipse/WTP tutorial for your particular version.
* 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.
+
To access the remote debugging profile, go to Run->Debug Configurations..., under Remote Applications you will see a debug profile corresponding to the remote server you created.
  
==Notes==
+
[[Image:Remote_debugging.png|center|frame|Remote Debugging Profile]]
* Eclipse must be run with a JDK, not simply a JRE, to use the Resin plugin.
+
* The Resin plugin must be run on Eclipse Galileo with Java EE.
+
* Windows Vista/7 users: administrator privileges may be required to install plugin.
+
  
==References==
+
If you need to, you can change the settings in the remote debugging profile. The project is the Eclipse project that the debugging breakpoints should reside in. The connection type for Resin must be Standard (Socket Attach). The host is the host name or IP address of the remote Resin server. The port is the port specified via -debug-port for the remote server instance. The default, 5005, should be good enough in most circumstances. Note, for remote debugging to work, you must start the remote server with -debug-port. For more information on -debug-port, look at the Resin command line help text.
* [http://blog.caucho.com/?p=228 Resin Eclipse plugin snapshot] (2009-08-18) - Blog post about using the plugin's Server configuration
+
* [http://blog.caucho.com/?p=139 Remote deploy in Resin, Part 2] (2009-01-29) - Blog post about using host deploy
+

Latest revision as of 19:44, 22 December 2011

Resin includes excellent support for Eclipse much in the same fashion as other Java application platforms. This page describes the details of the Resin Eclipse plugin.

Contents

Eclipse Versions Supported

Like the Eclipse plugins from other vendors, the Resin Eclipse plugin is based on the proven Eclipse Web Tools Platform (WTP). You must have the WTP installed for the Resin plugin to work. Generally, if you download the Eclipse IDE for Java EE Developers, it will automatically include the WTP. This is by far the easiest way to get started. Otherwise, you can add the WTP to your Eclipse installation yourself.

The Resin Eclipse plugin supports Helios (Eclipse 3.6) and above. For Indigo (Eclipse 3.7) and above, the Resin plugin is already registered. If you're using Helios (3.6), the plugin should be installed through the Resin Eclipse Plugin update site.

Detailed instructions on how to install the plugin for your version of Eclipse are described below.

Installing through Eclipse Server auto-discovery (Indigo and above)

To install Resin on Indigo or above, go to the 'Servers' View - it is typically in the bottom tabs (make sure you are in the Java EE Perspective). Right click and select 'New->Server'. In the 'New Server' dialog, you will likely not see Resin as an option. To install Resin, you will have to click on the 'Download additional server adapters' option. It will take a few seconds for the 'Install New Extension' dialog to fully load. Once it loads, select the 'Resin (Java EE Web Profile) Server' option and click 'Next'.

Install Server Support for Resin

Accept the license terms to start the installation (you might also get an "unsigned content" warning; this is OK, accept it to proceed with the installation). The installation might take a few minutes.

Installing Server Support for Resin

Once the installation finishes, you may be asked to restart Eclipse. You should verify a successful installation by checking if Resin is included in the 'New Server' dialog.

New Server Dialog with Resin Support

Installing from the Resin Eclipse plugin update site (Helios and above)

Eclipse versions prior to Indigo did not have Resin automatically registered as a server option. For these versions, you will need to install the Resin plugin yourself directly from the Resin Eclipse plugin website (http://www.caucho.com/eclipse/). One very nice side-effect of the manual plugin installation option is that you can download the very latest pre-release Resin Eclipse plugin snapshot from the Resin Eclipse plugin snapshot site (http://www.caucho.com/eclipse-snapshot/).

To install the plugin, you must first register the plugin website as an Available Software Site in Eclipse. You do this by going to 'Help->Install New Software...->Add...'. In the 'Add Repository' dialog, enter a name and the location for the Resin Eclipse plugin website (http://www.caucho.com/eclipse/).

Add Resin Eclipse Plugin Site

After clicking OK, the plugin site will be registered. After the site is registered, select "Resin (Java EE 6 Web Profile) Server" and click 'Next'.

Installing Resin

Review the installation and click 'Next' again. Accept the license terms to start the installation (you might also get an "unsigned content" warning; that's OK right now, simply accept it to proceed with the installation). The installation might take a few minutes. Once the installation finishes, you may be asked to restart Eclipse. Once Eclipse is restarted, go to the 'Servers' View - it is typically in the bottom tabs (make sure you are in the Java EE Perspective). Right click and select 'New->Server'. In the 'New Server' dialog, you will see Resin as an option.

New Server Dialog with Resin Support

Adding a server

To add a server, use the Add Server dialog and choose Resin.

The host name and server name values in this dialog are significant. The host name is the location of Resin instance. If you intend to run Resin locally, the default value of "localhost" is correct. The server name is the name of the server in Eclipse. You should choose a sensible name that is meaningful to you.

New Local Server

If you plan on using a Resin instance on a remote server, you should enter the IP address or DNS name of that server in the host name field.

New Remote Server

Adding a runtime

The first step to adding a server is adding a Resin runtime. A Resin runtime essentially corresponds to a Resin installation, while a server corresponds to particular running instance of the runtime. If you only care about running a single local instance of Resin, the runtime and server would be synonymous to you.

If you have already created a runtime, you can simply use that to create a new server by choosing it in the first step of the Add Server dialog (as shown in the last diagram in this section). If the Resin plugin does not find an existing runtime, it will automatically start the Add New Runtime dialog for you as part of adding the server as well as omitting the runtime selection choice in the Add Server dialog (as is the case with all the Add Server dialog diagrams shown so far). A runtime consists of a JRE as well as a Resin installation (Resin Home). If you already have Resin installed, point Resin Home to where you installed Resin. If you have not yet installed Resin, you can do so now by clicking the 'Download and Install' button. This will install the latest version of Resin in the Resin Home location.

Add Resin runtime

Note that in case of a remote Resin instance, the runtime must match the remote server that you are using, both for the JRE and the Resin version in use.

If you need it, you can certainly create more than one Resin runtime. The most common use of this is using more than one Resin version at a time. You create new runtimes by selecting 'Window->Preferences->Server->Runtime Environments->Add...'.

Runtimes

While adding a new server, you can choose the existing runtime that is most suitable. The Resin plugin will detect and list all the registered runtimes that it finds.

Choose Existing Runtime

Server Licenses

The next step to adding a runtime is requesting a development license. You can use the development license to enable Resin Pro features like clustering or extended health checks. The license will be sent to you via email.

Get Development License

Note the license dialog will only appear if your Resin installation is missing a license. Otherwise, the license dialog is omitted and your existing license is used.

Requesting a license is completely optional and can be skipped over. All of the Resin Open Source features will still be available to you for development.

Configure Server

Once you've setup a Resin runtime, you will need to configure the server instance. The Configure Server dialog is fairly self-explanatory. Resin Home is taken from the Resin Runtime for which you are configuring a server. The working directory can and should be different than the Resin Home if you are running multiple instances against the same runtime. If you are running just one instance of Resin, it makes sense for Resin Home and the working directory to be the same, which is the default.

Configure Server

The port configuration is the HTTP port for Resin, the default for which is 8080. If you wish, you can use git-based remote deployment. In fact, this is the default choice while working with a remote server.

Configure Remote Server

You can also change the web apps directory for Resin (you can use relative or absolute paths). In most cases, the default of 'webapps' relative to the Resin working directory is probably fine. By default Eclipse projects are deployed as WAR files to the Resin web apps directory. If you want, you can skip the WAR packaging step by choosing 'Deploy as directory'. This will deploy the web application as in exploded form to the web apps directory instead and skip the WAR file creation altogether. Version 4.0.23 of Eclipse plugin adds a new "Deploy from workspace" deployment option. This option attempts to link WebContent directory of the Web Application project into Resin's 'webapps/$context' directory. The '$context' in the link's path is the name of the context of your Web Application. Along with the link a resin-web-pre.xml configuration file is created in WebContent/WEB-INF. The file configures a classloader that will look for classes in the output path of the Eclipse's project.

You are required to specify an admin user and password for the Resin server. You can use the defaults, but it is prudent to change it. In case of a remote server, the admin user and password values must match the ones for the remote server specified using the <resin:AdminAuthenticator> tag. Also, the remote server must have remote administration enabled using the <resin:RemoteAdminService> tag. For remote servers, you must also specify the remote debug port. The default port, 5005 should be sufficient for most cases. We will discuss remote debugging in greater detail in a later section.

After you configure the server, you can add one or more existing projects to the Resin server as the final step of adding a server. Once a server is added, you will see it in the 'Servers' view.

Resin instance in Servers View

Local Server Configuration

Unless you are using a remote server, you can configure servers right from Eclipse.

The configuration for each Eclipse Resin local server instance is stored under the /Servers directory in your Project Explorer. You will see the main resin.xml configuration file as well as admin-users.xml (pre-filled with the values you entered during server configuration), app-default.xml as well as health.xml. The plugin uses the configuration supplied with Resin for creating the instance configuration. For remote deployment and restart purposes it adds <resin:RemoteAdminService/> to resin.xml, in addition to enabling admin-users.xml.

Resin Configuration Files

You can configure your local Resin instance appropriately for development using the configuration files in /Servers.

Modifying Server

You can modify the server once it is created, to a greater degree than the server creation wizard allows. In order to modify the server, right click on the instance and select open. This will open a property sheet in Eclipse showing all the configuration options you can modify, including the fine-grained launch configuration.

Modify Server

You can modify the server name, host name, underlying runtime, where the Resin configuration is stored, the server address, server port, automatic publish settings, server operation timeouts and so on. Generally, the defaults are suitable for most situations.

A new 'Do not deploy' deployment option is added as of release 4.0.24. This option allows Eclipse to execute its 'Run As' or 'Debug As' routine without actually deploying the app. You can think of this deployment mechanism as a 'No Operation Deployment'. This can be used when Resin is configured to deploy an application using <web-app> configuration element inside of resin.xm. e.g. <web-app id="/test" root-directory="c:/My Documents/.../workspace/test"/>.

Server Operations

The Resin plugin supports all of the common server operations supported by WTP (for details on these check out a good Eclipse/WTP tutorial for your Eclipse version). You can start a server, stop a server, restart a server, debug on the server, profile a server, add/remove projects to the server, clean the server, deploy/redeploy applications and so on.

Server Operations

A majority of these operations can be accessed by right-clicking the server instance or right clicking a project associated with a Resin server.

Note that for remote servers the only operations that are permitted are deployment, un-deployment and remote debugging. These operations are only enabled if the remote server is currently running. The plugin will automatically detect if a remote server is running and will update the remote server status in Eclipse.

Remote Server Operations

Note that the context menu items for debugging are also disabled for remote servers. This is because remote servers can only be debugged as remote applications through the remote debug port. The following section describes how the plugin supports debugging a remote Resin instance.

Remote Debugging

The plugin supports debugging by automatically creating a remote application debugging profile in Eclipse when you create a remote server. For details on remote application debugging, check out a good Eclipse/WTP tutorial for your particular version.

To access the remote debugging profile, go to Run->Debug Configurations..., under Remote Applications you will see a debug profile corresponding to the remote server you created.

Remote Debugging Profile

If you need to, you can change the settings in the remote debugging profile. The project is the Eclipse project that the debugging breakpoints should reside in. The connection type for Resin must be Standard (Socket Attach). The host is the host name or IP address of the remote Resin server. The port is the port specified via -debug-port for the remote server instance. The default, 5005, should be good enough in most circumstances. Note, for remote debugging to work, you must start the remote server with -debug-port. For more information on -debug-port, look at the Resin command line help text.

Personal tools