Run Project In Eclipse

From JRapid

Jump to: navigation, search



JRapid provides every project with a cloud development environment where the application runs allowing the preview of the generated code instantly. These servers have limited characteristics, depending on their type.

An important characteristic for the Shared Servers is that they do not allow developers to upload custom code. But if you need to test a customization before deciding to move your project to a Dedicated Server in the JRapid Development Cloud, you may run a local copy of your project from within an embedded Apache Tomcat in your Eclipse installation.

This is also very useful if you need to perform step by step debugging on your code.

Install Apache Tomcat Servlet Container

Download the corresponding distribution for your development environment from here. We recommend downloading the zip file with no installer. Unzip the contents of the downloaded file to a known location in your disk or follow the installation instructions here.

Download JRapid Required Libraries and Add Them To Your Tomcat Installation

Download the JRapid Required Libraries from here and unzip the contents to the common libraries directory of your Apache Tomcat installation. This folder may vary from version to version. The installation folder for Apache Tomcat is commonly referred as $CATALINA_HOME.

For projects in version prior to 1.0nb80, download required libraries from here.

  • Tomcat 5 / 5.5: $CATALINA_HOME/common/lib/
  • Tomcat 6 and 7: $CATALINA_HOME/lib/

Create Server Runtime Environment in Eclipse

Run your Eclipse installation and go to Window -> Preferences.


Use the filter on the top left to search for "Runtime Environments".


Click on the Add button to create a new Server Environment.


Select the corresponding type of runtime environment, making sure the Tomcat version matches the one you downloaded and installed before.


Enter a name and the path to the installation directory, and click Finish.

Create Server

If the Servers view is not being shown, go to the Window -> Show View -> Servers menu option.


Right click on the Servers view and select New -> Server.


Select the server type, name and the Server Runtime environment you created on the previous section and click Finish.


The new server is listed in the Servers view.


Download your project to Eclipse

Follow the Getting Started with Eclipse guide in order to get the JRapid Eclipse Plugin installed and learn how to synchronize your project with a local copy in your local machine.

As we're going to configure the project to run with the newly created server runtime, that already includes all the JRapid required libraries, you should choose not to download or add the JRapid User Library to the building path of this project.

If you have not already downloaded the libraries, you may click on the Cancel button when the plugin prompts for a location to install them.


Then, right click on the downloaded project and select Properties. Go to the JRapid Properties pane. Mark as true the "Do not check for JRapid Required Libs in build path" option.


If you have already downloaded the libraries or the project is already including them in the building path, make sure to remove them by following this simple steps.

Right click on the project in the Project Explorer and select Build Path -> Configure Build Path ...


Switch to the Libraries tab, select the "JRapid Required Libs".


Click the Remove button and click OK.

Configure Project's Build Path

Right click on the project in the Project Explorer and select Build Path -> Configure Build Path ...


Switch to the Libraries tab and click on the Add Library ... button.


Select the Server Runtime option and click Next.


Select the runtime created in the previous sections and click Finish.


The library is added to the project's build path.


Click OK to save the changes and close the window.

Configure Web Modules on the Server

Double click on the Server name in the Servers view to open its configuration file.


Switch to the Modules tab by clicking on the link at the bottom of the editor.


Click on the Add External Web Module button.


Browse your system to find your project's folder in the Eclipse workspace. Be sure to select the WebContent folder in the project's folder as the document base. Enter a Path for accessing the application using your browser. Do not check the auto reloading option.

Click OK.


The Web Modules list shows your project but the file is not saved yet. Make sure you press CTRL + S to save the contents of the file.


Run the Application

Go to the Servers view, right click on your newly created Server and select Run.


Point your browser to the corresponding URL and the application should be running there.


Local Database

It's important to note that this application will still be using the development database schema hosted on the JRapid Development Cloud. There's no problem with doing this, other that you may find it a little bit slower than running your app against a database hosted in your local machine as well.

To do this, you must first install a local MySQL server and configure the database connection properties. You may also choose to dump the contents of the schema on the cloud and use it to populate your local database schema in order to bring along any test data you might have already created.

See Also


If Using Parameters with Slashes

If your application defines services that allow parameters with values that include slashes, such as dates, you must configure Apache Tomcat to allow them. To do this, set theorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH system property to true. You can do this in the CATALINA_OPTS variable on start up. See Apache Tomcat Configuration Reference here:

Personal tools