-
Notifications
You must be signed in to change notification settings - Fork 20
Full installation for developers
drierat edited this page Aug 24, 2012
·
69 revisions
(this page is under construction)
Notice this is a big project, so there are lots of different modules, libraries, dependencies, etc. That makes it a bit complicated to configure. Here you can find the steps to prepare everything you need to develop new plugins and/or services.
- If you do not have a github user, go to the github site and register.
- Once registered, go to the kPAX repo. This is the repo of the current stable branch of the kPAX project. Create a new branch from this one by forking it. That will be your work branch.
- Install github (local) in your computer. Follow the instructions in the github help page. Do not forget to add your SSH key to github.
- Clone the repo from the "Git bash" just installed, following these instructions (notice that you only need to execute the first steps). This will bring a copy of the project to your hard disk allowing to work locally.
- Download and install [Java SE Development kit 6] (http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u31-download-1501634.html). There are some installation instructions (for Windows).
- Download and install eclipse (or another IDE/editor. Notice that the present documentation is prepared for eclipse) Do not forget to configure the environment variables after the installation.
- Download and install maven 3.0.3 or later. Follow the instructions in the maven installation web.
- Download and install jBoss 4.2.3. Notice that this is not the latest version of jBoss. The zip file can be unziped wherever you want. Then, from eclipse (or other) configure it following these instructions. Do not worry about the Prerequisites. Only follow the "Create a localhost-only server configuration in Eclipse" section. Try to start the jBoss server. If your PC is too slow, you will need to increase the Start timeout in the Overview dialog of the jBoss local server you just created.
- Open a command window and, having moved to the Java project root, execute the command "mvn install" to get all the necessary libraries for the platform right operation.
- If everything went right, execute "mvn eclipse:eclipse" in order to make eclipse correctly detect all the variables.
- In eclipse, create the M2_REPO variable. To do that, go to Project properties --> Java build path --> Add variable --> Create a new variable with name M2_REPO with the repository route (for instance /user/juanfra/.m2/repository/)
- Modify tag \Users\juanfrasr\servidor\jboss-4.2.3-1.GA\server\default\deploy to the path where your server is located. This has to be done in the pom.xml file.
- Execute "mvn -Denv=local clean package". Notice that this step has to be repeated every time the developer wants to compile.
- Add mysql connector/j library to JBoss. This step needs to be done since no other process will take care of it so download the current version of it for your platform (see: http://www.mysql.com/downloads/connector/j/) and copy the contained compressed jar (i.e.: mysql-connector-java-5.1.19-bin.jar) to the directory: $JBOSS_HOME/server/default/lib, in this way the server will have access to the mysql connection once the application has been deployed.
- Install a WAMP structure (e.g. WAMP, XAMPP, etc.).
- Use the script in the folder doc/sql in the k-pax project to create an empty database.
- Once the database has been created, edit the file srvKpax-ds.xml and include the database configuration (host, port, user, password), and store this file where the application is deployed, for instance /home/server/jboss/server/default/deploy/*
- Download elgg code (version 1.8.X) from the elgg download page.
- Save the content in the www folder of the wamp/xammp server.
- Start the wamp/xammp server and all services.
- Create an empty database for elgg (in a browser, go to http://localhost/phpmyadmin).
- Activate the rewrite module in wampserver.
- During the installation (next step) you will be asked for a temporal folder. Create it where you prefer, in the hard disk.
- Install elgg from http://localhost/elgg-1.8.3/install.php (write the corresponding version in your path). In the "Requirements check" step, check that the httpd.conf file has got the AllowOverrride set to ALL.
- Go to localhost/FOLDERNAME (for instance http://localhost/elgg) and copy mod folder's content from elgg project.
- Activate the apiadmin 1.8b1, kpax and likeskpax modules in the elgg Administration page
Important notes:
- the apiadmin 1.8b1 delivered in mods-kpax is broken, there is a new version in the author's page but it has not been tested in this environment. The code can be edited following instructions for a workaround.
- deactivate "likes" (Elgg module) before activating likeskpax module or you will get a blank page in admin from which it is difficult to recover.
- Now, create a key pair in API administration. Include it in the following files:
- /www/elgg/mod/kpax/lib/kpaxSrv.php -> $apikey = "YOUR KEY";
- /src/main/java/uoc/edu/svrKpax/util/ConstantsKPAX.java -> public final static String ELGG_API_KEY ="YOUR KEY";
Once everything has been set up, the Jboss server can throw errors at startup similar to:
18:59:55,739 ERROR [STDERR] 24-abr-2012 18:59:55 com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
uoc.edu.svrKpax.rest
18:59:55,788 ERROR [STDERR] 24-abr-2012 18:59:55 com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
class uoc.edu.svrKpax.rest.Jsonp
class uoc.edu.svrKpax.rest.User
class uoc.edu.svrKpax.rest.Games
18:59:55,789 ERROR [STDERR] 24-abr-2012 18:59:55 com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
18:59:55,864 ERROR [STDERR] 24-abr-2012 18:59:55
com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
These errors are Jersey framework configuration related and can be safely ignored.
Other troubles can arise in a Mac computer environment:
JDK 1.6 related, if running Maven you get the message:
[WARNING] Workspace defines a VM that does not contain a valid jre/lib/rt.jar: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
then use the solution outlined in the message and the fourth comment on the link:
http://bruehlicke.blogspot.com.es/2009/11/missing-rtjar-mac-os-x-using-proguard.html
Jboss manual start related. If on start you get the message:
$ ./run.sh
./run.sh: line 89: ulimit: open files: cannot modify limit: Invalid argument
run.sh: Could not set maximum file descriptor limit: unlimited
then a possible workaround is to execute
$ sysctl -n kern.maxfilesperproc
10240
and change line 89 of run.sh, where it says:
MAX_FD="unlimited"
by
MAX_FD="10240" (where 10240 is the number obtained in the previous step)
More info in: https://issues.jboss.org/browse/JBAS-4948