Old installation guide
From HiWiki
PING Discovery: Pilot implementasjon og utforskning av PING -> Old installation guide
This guide describes how to install the PING Server 3.0 Alpha-2 Release. It does not show how to encrypt the RMI data store. If this is important (it probably is), use the Installation guide instead.
Contents |
Download PING source code
Get the source code from the chip.ping.org repositories:
svn co https://cvs.chip.org/svn/repos/ping/trunk/ pingIf you use windows we recommend installing TortoiseSVN from http://tortoisesvn.tigris.org/. After installation, create a folder for the source code, right click on it and select Checkout. Enter:
https://cvs.chip.org/svn/repos/ping/trunk/
Install Maven 2
Get the distribution archive from http://maven.apache.org/ and follow the installation instructions on this page: http://maven.apache.org/download.html#Installation
JAXB XJC Maven 2 Plugin is a plugin that is able to generate java classes from XML schemas. It has to be installed manually:
Download the plugin from https://jaxb.dev.java.net/jaxb-maven2-plugin/ and expand the .zip contents into your local user-home/.m2/repository directory. If this is the first time you install maven, you probably don't have the .m2/repository folder yet, because these are created the first time you run maven with a java project.
Run:mvnand check that the folders are created (don't worry about any error messages). If they are not, just create them manually. The structure with the plugin should be like this:
user-home/.m2/repository/<the plugin with com/ as the top folder>
Install the source code
From the root of the ping source (e.g. user-home/ping/) run:mvn install
This will among other things compile and test the source code, package it into jar files, verify the packages and install them into the local repository. If you get errors or build failures, this could be due to plugins that are not downloaded properly. Try to run the same command until it works; the plugins should be downloaded eventually.
Run integration tests
From the root of the ping source (e.g. user-home/ping/) run:mvn -Pintegration-test install
This will start up an RMI server store, launch tomcat, deploy the PingServlet demo war on Tomcat, and run a number of tests. After the tests have been run, notice that two database files have been created in ping/integration/target/.
- 00000000.jdb is the data and log file.
- je.lck is the lock file.
If you want to run this integration test several times, you have to remove these files, otherwise the test will try to create the same data twice in the data file and hence the tests will fail. Copy these files to a new folder (e.g. user-home/ping_store/) so that you can begin with an admin and test account when you start the PingServlet later.
Install tomcat
Install tomcat on the server where you want to run your PingServlet.
Deploy the PingServlet on tomcat
Copy the ping-server-servlet-demo-3.0-beta-SNAPSHOT.war file from server/servlet-demo/target/ and place it in tomcat/webapps/. After tomcat has been restarted, the war should be unpacked and the necessary files put in a ping-server folder under webapps. You can try to start the PingServlet from your browser, but it does not respond to GET messages (actually it does but you will know what I mean when you try it), and besides, the RMI data store is not up and running yet.
Start the RMI data store
Run:java -cp $CP org.chip.ping.iostore.berkeleydb.OSStoreDaemon OSStoreServer $1 OSStoreServerAudit $2
Where $CP = your classpath with all the PING jars and dependencies, $1, $2 = the location of your store directory (e.g. user-home/ping_store/)
Note that because this is an alpha release, the revision you download might be newer then the one used in this guide, and some of the jar files could have changed names and even functionality. Hence org.chip.ping.iostore.berkeleydb.OSStoreDaemon might not be the correct path to the OSStoreDaemon class (you will have to find this out by try and fail).
We made a script to start the data store as shown below:
#!/bin/bash export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/activation-1.1.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/commons-codec-1.3.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/javax.xml.bind-jsr173_api-1.0.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/jaxb-api-2.0.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/jaxb-impl-2.0.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/jaxb-jsr173_api-1.0.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/je-2.0.83.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/log4j-1.2.13.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/ping-core-3.0-beta-SNAPSHOT.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/ping-iostore-berkeleydb-3.0-beta-SNAPSHOT.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/ping-iostore-core-3.0-beta-SNAPSHOT.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/ping-model-core-3.0-beta-SNAPSHOT.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/ping-protocol-3.0-beta-SNAPSHOT.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/ping-server-responder-config-3.0-beta-SNAPSHOT.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/ping-server-responder-core-3.0-beta-SNAPSHOT.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/lib/ping-server-servlet-3.0-beta-SNAPSHOT.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/W EB-INF/lib/sunxacml-1.2.jar:$CP export CP=/usr/local/ping/tomcat/webapps/ping-server-servlet-demo-3.0-beta-SNAPSHOT/ WEB-INF/classes/:$CP exec java -cp $CP org.chip.ping.iostore.berkeleydb.OSStoreDaemon OSStoreServer /usr/local/ping/ping_store/ OSStoreServerAudit /usr/local/ping/ping_store/
Restart tomcat
Restart tomcat. The PingServlet should now have contact with the RMI data store. To test the system you can write your own methods (using doPOST) for e.g. based on the integration test classes.
PING and Netbeans
After some experimentation we found that the only IDE that supported maven 2 and Ping in a satisfactory way, was Netbeans. An installation guide can be found here.
