The following is 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 SVN. 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.
- Place the openregistry.xml file in $TOMCAT_HOME/conf/Catalina/localhost
- Place C3P0 Connection Pooling Library and database driver in shared dir ($TOMCAT_HOME/lib in tomcat 6)
- Tell Intellij IDEA about your Tomcat Server
- Open $OPEN_REGISTRY_PROJECT/openregistry.ipr
- This will load openregistry-api.iml, openregistry-repository-jpa-impl.iml, openregsitry-service-impl.iml, openregistry-webapp.iml, openregistry-webapp-activation.iml
- It will also load the Maven pom.xml files in the Maven Projects window
- run the maven Lifecycle commands clean, package and install (easier to run these all at once from the command line, see Deploying the Demonstration War from SVN)
- Select Run->Edit Configurations to create a new configuration
- Click + and choose Tomcat Server -> local
- 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
- On the Deployment tab select the Web (in openregistry-webapp) Web Facet
- Check 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
- Click OK to finish
- 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!