Skip to content
sheldonabrown edited this page Feb 22, 2013 · 17 revisions

(This page still in progress)

Prerequisites:

  • git
  • a username on github
  • java JDK
  • maven (3, not 2 – see below for Ubuntu install),
  • tomcat6
  • postgresql or mysql (details below, we'll move them here later).
  • zeromq libraries (details below)

Here are some more detailed instructions on the above.

Running locally

There are several different deployment styles, as represented in maven profiles. What you choose is largely based on peference. "local-multi-port" is recommended otherwise. These have been tested on Ubuntu, but should work on OSX as well.

  • local-front-end: run the front-end locally off of the TDF in the dev environment. This profile isn't applicable to other modules. Use this when you are only concerned with the HTML front end. (Essentially you plug yourl local HTML front end into a live OBA in the development environment)
  • local-single-port: run either the front-end/API/TDF or the inference engine on 8080, and optionally hook up the archive as well. In either case, the modules listen to the dev queue. Use this when you only want to run the Front-end or the Inference engine, but not both. (You run OBA yourself, and subscribe to data from the development environment)
  • local-ie: run the front-end off of a local VTW, all on port 8080. (This is more for IE development)
  • local-multi-port: run each module on a separate port and hence seperate process. (Preferred method cause it just works)

You can run this directly on the command line using Maven, or use the Maven Build run configurations in Eclipse to run it there, for example if you need to debug.

Profile local-front-end (For front end only, uses TDF in dev environment)

  1. Build the onebusaway-nyc module with the profile "local-single-port"

    $ cd ~/src/onebusaway-nyc $ mvn clean && mvn install -Plocal-front-end,skip-integration-tests

  2. Run

This step describes running the application using two application servers. You need to use only one of the two application servers depending on the environment. Jetty server should be used for dev environment whereas production should use Tomcat.

2.1. via Jetty

    //create jetty-env.xml to set datasource
    $ mv onebusaway-nyc-webapp/src/main/webapp/WEB-INF/jetty-env.xml.mysql onebusaway-nyc-webapp/src/main/webapp/WEB-INF/jetty-env.xml

2.1.1. execute

        $ xterm -l -hold -T "app" -e "cd ~/src/onebusaway-nyc/onebusaway-nyc-webapp && mvn jetty:run -Plocal-front-end"

2.2. via Tomcat

2.2.1. Configure the appDB resource reference in tomcat; edit /var/lib/tomcat6/conf/context.xml

            <!-- Default set of monitored resources -->
            <WatchedResource>WEB-INF/web.xml</WatchedResource>

            <Resource name="jdbc/appDB"
                auth="Container"
                type="javax.sql.DataSource"
                maxActive="100"
                maxIdle="30"
                maxWait="10000"
                username="root"
                password=""
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost:3306/onebusaway_nyc" />

2.2.2. deploy to Tomcat and start

        // note we change the war file name to have it deploy at the root context
        $ sudo /etc/init.d/tomcat6 stop
        $ sudo cp ~/src/onebusaway-nyc/onebusaway-nyc-webapp/target/onebusaway-nyc-webapp.war /var/lib/tomcat6/webapps/ROOT.war
        $ sudo /etc/init.d/tomcat6 start
  1. Point your browser to http://localhost:8080/
Clone this wiki locally