This page last changed on Feb 08, 2008 by chartra@mcmaster.ca.
NOTES ON SETTING UP THE MONK MIDDLEWARE APPLICATION IN ECLIPSE

1. Do two separate checkouts from svn. Check out both projects into the same directory so they share the same parent directory.

  • svn co svn://nora.lis.uiuc.edu/monkmiddleware/webapp/trunk monkmiddleware-webapp
  • svn co svn://nora.lis.uiuc.edu/monkmiddleware/core/trunk monkmiddleware-core

2. Export the parent pom.xml from svn into the workspace, I.e., into the parent directory of the two projects you just checked out:

svn export svn://nora.lis.uiuc.edu/monkmiddleware/pom/trunk/pom.xml

3. Edit the pom.xml file that you just checked out and change the mysql username and password from whatever is there to whatever will allow you to connect to your local mysql installation

NOTE: The default mysql admin account ( "root" and a blank password) will work if you haven't changed your local mysql install:

<jdbc.username>root</jdbc.username>
<jdbc.password></jdbc.password>

NOTE: at some point when (if) this points to a non-local mysql installation, you'll also have to change the url pointing to the mysql install:

<jdbc.url><![CDATA[jdbc:mysql://localhost/monkmiddleware?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=utf-8]]></jdbc.url>

4. Import the two projects into Eclipse (File, Import, Existing Projects into Workspace)

5. Cd into the monkmiddleware-core directory and run 'mvn'.

6. Cd into the monkmiddleware-webapp directory and run 'mvn'.

7. Two servlets are setup that require a larger heap than the default. If you try to start up the webapp with the default heap size you'll get an error like:

java.lang.OutOfMemoryError: Java heap space

So you can do one of two things. Set your heap to 1024 when you invoke maven:

mvn -server -Xmx1024m -Xms1024m -XX:PermSize=128m -XX:MaxPermSize=192m

Or comment out the references to the servlets in the web.xml file, i.e., comment out the following:

<!-- MONK DB SERVLET NEEDS to be called first as it inits the static data objects
        <servlet>
        <servlet-name>init</servlet-name>
            <servlet-class>org.monkproject.middleware.webapp.servlets.DataStoreInitializeServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
The Collection Servlet will be folded into the Spring framework but for now 

    <servlet>
        <servlet-name>collection</servlet-name>
        <servlet-class>org.monkproject.middleware.webapp.servlets.CollectionManagerServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
  -->

<!-- collection specific  mapping 
    <servlet-mapping>
        <servlet-name>collection</servlet-name>
        <url-pattern>/monkmiddleware/CollectionManager/*</url-pattern>
    </servlet-mapping>
  -->

Commenting out these servlets may be the preferable option in some cases, because the servlets take a while to load.

7. Test your webapp works, run 'mvn jetty:run' from the same monkmiddleware-webapp directory.
NOTE: Ctrl-C to stop jetty
NOTE: The default username/password for an admin user is admin/admin. For a regular user, user/user.

Document generated by Confluence on Apr 19, 2009 15:04