This revision made February 11, 2010 08:11, by Felipe Gaúcho

Arena PUJ - Development Environment Configuration

Where is the project specification?

Would you like to know more about the project before to put your hands in the code jar? Here are the docs:

QuickStart - The code up and running in ~10 minutes

The following instructions were tested in Linux Ubuntu 9.10, but we assume it will work in other operational systems as well. If you have questions or problems during your local setup, please feel free to send an email to fgaucho@gmail.com

Environment Setup

  • Put the $GLASSFISH_HOME/bin in your $PATH (%path% on windows). It is required by the Maven script;
  • Create a file called $HOME/.passwords directory, containing the following properties:
 ASADMIN_USER=admin
 
 MAIL_HOST=smtp.some email.com
 MAIL_USER=user
 MAIL_FROM=user@somemail.com
 MAIL_SMTP_USER=user@somemail.com
 MAIL_SMTP_PORT=465
 MAIL_SMTP_PASSWORD=some_password
 
 MYSQL_USER=root
 MYSQL_PASSWORD=adminadmin
 DB_URL=jdbc\\:mysql\\://localhost\\:3306/arena
  • If you are using Windows, create the file %USERPROFILE%\.passwords and copy the above properties, but please change the DB_URL to:
 DB_URL=jdbc\:mysql\://localhost\:3306/arena

Adding permissions to Reflection based frameworks

Adding the permissions to Reflection based frameworks

Add the below lines to the file $AS_HOME/domains/domain1/config/server.policy

 grant codeBase "file:${com.sun.aas.installRoot}/domains/domain1/applications/arena-dwr/-" {
     permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
 };
 grant codeBase "file:${com.sun.aas.installRoot}/domains/domain1/applications/arena-vaadin/-" {
     permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
 };

Install MySql driver in Glassfish

You need to copy the MySql Connector/J jar file to the folder $AS_HOME/domains/domain1/lib/ext

This should be done manually and you should restart the server after copying the file. more...

  • Please check if you are using the default domain1, otherwise modify the above command according your Server domain name.

Checkout and build the source code

  hg clone https://kenai.com/hg/puj~arena 
  cd puj~arena 
  mvn clean install eclipse:eclipse

Done! Now you can import the project in your preferred IDE and play around the source code.

Start the MySql database

If the MySql database is not yet running, please turn it on:

  • Linux Users: /etc/rc.d/init.d/mysqld start
  • Windows Users: C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld

Building and deploying the application

  • Linux Users: use the profile -Phudson:
  cd puj~arena 
  asadmin start-domain
  mvn clean install -Phudson
  • Windows Users: use the profile -PhudsonWin:
  cd puj~arena 
  asadmin start-domain
  mvn clean install -PhudsonWin

Testing the application

If everything worked fine, you should be able to access the following URLs:

Quality assurance

Java Quality Assurance & Continuous integration

Our project has a Continuous Integration Server configured to check the quality of our work continuously. If there is any commit in the last hour, this server will build a clean copy of the source code and generates quality reports based on Findbugs and PMD. Please visit that server regularly to check if your code is sound and considered good quality.

Also, please be sure to have the following plugins installed in your preferred IDE:

Encoding

Always use UTF-8 as the file encoding. If you will include HTML code in Java files, or other resources that will generate HTML output, please convert special characters to HTML encoding.

Image Shrinking

A good tool to compress images without loosing quality is the Yahoo Smush.it. Use it in all static images whenever it is possible. Other hint about images is to always prefer PNG or JPG formats.

Web Resources Quality Assurance

If you are producing a web-application, please install YSlow in the browser you use to validate the quality of your code. And other good practice is to do a functional test of your web-gui against the major browsers on the market (at least Firefox, IExplorer and Chrome). There are some online services to test a web application on different machine configurations and browser versions, like the popular browsershots.org.

Web resources validation: a good quality indicator about our web resources are the W3C validations. Please apply your documents for validation and review the W3C warnings and recommendations before to commit the files:

Other good tools for cleanup & enhance the quality of your web resources are:

References

HTTP Protocol

RESTful Web-Services

Java EE

Tools

Difference compared to previous revision
<span>===Encoding=== Always use UTF-8 as the file encoding. If you will include HTML code in Java files, or other resources that will generate HTML output, please [http://www.stringfunction.com/html-encode.html convert special characters to HTML encoding]. ===<span style="text-decoration:underline;color:green">Image Shrinking=== A good tool to compress images without loosing quality is the [http://www.smushit.com/ysmush.it/ Yahoo Smush.it]. Use it in all static images whenever it is possible. Other hint about images is to always prefer PNG or JPG formats. ===</span>Web Resources Quality Assurance=== If you are producing a web-application, please install YSlow in the browser you use to validate the quality of your code. And other good practice is to do a functional test of your web-gui against the major browsers on the market (at least Firefox, IExplorer and Chrome). There are some online services to test a web application on different machine configurations and browser versions, like the popular ''browsershots.org''. * [http://developer.yahoo.com/yslow/ YSlow]<span>
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2013, Oracle Corporation and/or its affiliates
(revision 20140418.2d69abc)
 
 
Close
loading
Please Confirm
Close