Guide on how to build, run, and debug IME locally -- for backend developers
How to build the IME using NetBeans
1. download and install jdk 1.6 (http://java.sun.com/javase/downloads/index.jsp)
set the JAVA_HOME variable to point to the local jdk directory
2. get maven http://maven.apache.org/download.html. Extract it to a local directory and add the bin directory to your path.
After this, you should be able to type "mvn -version" and get the mvn version info.
3. install a svn client (such as tortoisesvn from http://tortoisesvn.tigris.org/)
4. check out the thalia source from svn+ssh://[username]@svn.mit.edu/zest/thalia. Make sure you are a member of the zest-cvs moira goup.
5. install netbeans 6 from http://www.netbeans.org/
6. install the maven plugin: tools->plugins->available plugins, select maven and click install.
7. open the thalia project: file->open project and browse to zest/thalia/ime/Trunk, choose thalia, and click on "open project"
8. In the project pane, right click on the thalia project and select properties->Actions
put "dev-build" in the active-profiles field for all the actions you want to do such as build project, clean project, and debug project.
9. In the project pane, right click on the thalia project and select properties->Run
pick a deployment server (tomcat), remove any context path, and specify the url as "resttest.jsp"
10. Now you are ready to build Thalia inside Netbeans. to verify that the build is successful, check
target\ROOT\WEB-INF\classes\alfresco\webserviceclient.properties. It should contains the address & port for the appropriate alfresco server.
How to run thalia locally via http:
11. to run thalia locally, you will have to uncomment the following line inside
zest\thalia\ime\Trunk\thalia\src\main\java\edu\mit\thalia\ime\api\resttest.jsp
server = "test.thalia.mit.edu"
Since your localhost doesn't have subdomain set up, we will have to fake it. We only use the first part as the subdomain name. If you
want to test the HST domain, you will have to change from "test.thalia.mit.edu" to "hst.thalia.mit.edu". The host name doesn't matter since
it knows to talk to the right alfresco server configured inside target\ROOT\WEB-INF\classes\alfresco\webserviceclient.properties.
12. Now you can run thalia locally via http. click debug and change the url to http://localhost:8084/libraries
You should see the public library and any library that is publicly readable.
How to run thalia locally via https
1. prepare the certificate key store
mkdir c:\temp
"%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
After executing this command, you will first be prompted for the keystore password. The default password
used by Tomcat is "changeit" (all lower case).
Next, you will be prompted for general information about this Certificate, such as company, contact name,
and so on. This information will be displayed to users who attempt to access a secure page in your application,
so make sure that the information provided here matches what they will expect.
Finally, you will be prompted for the key password, which is the password specifically for this Certificate
(as opposed to any other Certificates stored in the same keystore file). You MUST use the same password here
as was used for the keystore password itself. (Currently, the keytool prompt will tell you that pressing the
ENTER key does this for you automatically.)
If everything was successful, you now have a keystore file with a self-signed cert that can be used by your server in the default keystore location
(In windows it is c:\documents and settings[username]\.keystore. This is the certificate that the server
will present to the client.
2. since Thalia also require client side authentication, we need to create a trust keystore that will be used to keep
the mit client root CA, so all MIT client certs will be trusted by the server:
download the mit root CA from http://ca.mit.edu.ezproxyberklee.flo.org/mitClient.crt and save it to c:\mitClient.crt
import the root CA into the keystore generated in step 1:
"%JAVA_HOME%\bin\keytool" -import -v -file c:\mitClient.cer -keystore c:\temp\tomcat
You will be prompted for the truststore password, use "changeit" for convenience. You will also be prompted if you want to trust the cert or not, answer yes.
c:\temp\tomcat will now contain the MIT client root CA and as a result tomcat will trust any certs that is signed by the root CA.
3. go to the tomcat conf directory (the default location is C:\Documents and Settings[username]\.netbeans\6.0\apache-tomcat-6.0.14_base\conf)
edit the tomcat server.xml file:
uncomment the 8443 connector
change the clientAuth to true
add the keystoreFile and keystorePass if you didn't use the default
so the text for the connector should look like this:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="true" sslProtocol="TLS" truststoreFile="c:\temp\tomcat" truststorePass="changeit"/>
4. You should be all set. Restart the tomcat server inside NetBeans: windows->services
Then inside services pane, click on servers, right click on the tomcat server and select restart
5. Now you can go to https://localhost:8443/libraries and you can see all the libraries you can see.