CRX Feature for Eclipse HOWTO

Last Updated: Friday, April 24th, 2009 by fmeschbe

This HOWTO has been written by Alexander Klimetschek. Thank you very much.

Prerequisite 1: Make sure the CRX has RMI enabled

  1. Inside the CRX directory, open server/runtime/0/_crx/WEB-INF/web.xml with a text editor
  2. Look for the RMI Configuration section (by default in comments)
  3. Uncomment that section, default port is 1234
  4. Optionally, you can choose the RMI port if there are conflicts
  5. Restart CRX

Prerequisite 2: Install CRX 1.4 plugin

The latest CRX Feature for Eclipse Version 3.6.6 does not include the support plugin for CRX 1.4. You can manually retrieve it and install it as follows:

  1. Grab the CRX 1.4 support plugin: com.day.crx.eclipse.rmi.crx14_1.0.0.jar
  2. Copy the JAR file into the plugins folder of your Eclipse installation
  3. Restart Eclipse

Setup of the CRX Eclipse feature

  1. Install the feature (and maybe restart Eclipse).
  2. Open the JCR perspective
  3. In the left, there's a JCR Repository view, in which you can configure multiple repositories to connect to
  4. Right-click in that view and select New -> Repository
  5. Select Configure a new RMI repository and Next
  6. For the repository RMI URL enter //localhost:1234 (port name same as configured in the web.xml in crx above, hostname or IP depending on where your CRX is reachable) and hit Browse
  7. If RMI is working, you should now see a dialog with a list of registered repositories at localhost:1234; typcially this is only one named //localhost:1234/crx
  8. Select the desired one and hit OK
  9. For the RMI Accessor choose the most appropriate version of the remote repository (normally the dialog preselects the correct version)
  10. Set the password for the JCR session login (admin/admin set by default)
  11. Select the workspace to connect to under Workspace Name (you might need to enlarge the dialog a bit to see that field below the Save Password checkbox); use the Browse button if you have the admin credentials; the default workspace in crx is named crx.default
  12. Hit Finish
  13. Now right-click on the new entry in the JCR Repository view and select Connect to create a new JCR session
  14. Below that node in the tree, a new node for the session (like admin@....) will be visible. If you also open that one, you'll see the root node of the workspace.
  15. Browse the tree including nodes and properties in the left view
  16. For JCR operations, right click nodes or properties to see a context menu with all options
  17. Properties and other node metadata is visible in the Properties view (at the bottom)

Note: The JCR Repository view can be opened in any perspective, particularly I like to have it open in the Debug perspective. The JCR perspective is mainly a convenience because it has all views of the CRX Feature for Eclipse nicely setup.