Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following are a set of instruction for running the Demonstration webapp from within Intellij IDEA.This tutorial assumes that you are familiar with Intellij IDEA Integrated Development Environment and have read the tutorial on Deploying the Demonstration War from Github and set up the XML files and library dependencies correctly for your version of Tomcat.

The goal of this tutorial is to help you set up IDEA so that you can run the OpenRegistry demonstration application from within IDEA allowing you to set break points and better debug/explore the code. This tutorial uses Intellij IDEA 8.1.3 and Tomcat 6.0.20 for examples.

  1. In your IDEA preferences select Application Servers
    • If your Tomcat server is not already identified, click the + and browse the home directory of your desired Tomcat server
    • Click OK to accept the Application Servers settings
      Image Added
  2. Open the OpenRegistry main project file at $OPEN_REGISTRY_PROJECT/openregistry.ipr
    • This will load all the dependent IDEA modules:
      • openregistry-api.iml
      • openregistry-repository-jpa-impl.iml
      • openregsitry-service-impl.iml
      • openregistry-webapp.iml
      • openregistry-webapp-activation.iml
  3. It will also load the Maven pom.xml files in the Maven Projects window
    Image Added
  4. Select Run->Edit Configurations to create a new configuration
    Image Added
    • Click + and choose Tomcat Server -> local
      Image Added
    • On the Server tab select the Application Server that you set up earlier
    • You can tell it to start a browser and go directly to http://localhost:8080/openregistry
    • Everything else should be deselected for simplicity
      Image Added
  5. On the Deployment tab select the Web (in openregistry-webapp) Web Facet
    • Select the Deploy Web Facet 'Web' option
    • Select the openregistry.war Deployment Source
    • If there are no choices in the pull down menu click the Configure button
    • On the Java EE Build Settings tab check off Create web facet war file and enter the location of the built openregistry.war file, probably $OPEN_REGISTRY_PROJECT/openregistry/openregistry-webapp/target/openregistry.war
    • In the Application context box enter /openregistry
      Image Added
  6. Click OK to finish
  7. You should now be able to Run or Debug the openregistry-webapp on the Tomcat server from within Intellij IDEA which means you can set break points and monitor logging in the Console or Tomcat Log. This makes it much easier to debug and understand the code. Good luck!