mercoledì 2 febbraio 2011

EAR and enterprise servers

The purpose of EAR (Enterprise Archive) files is to have the possibility to deploy an enterprise application on whatever server you want without modify the code.
Unfortunately it is not the case.

I used EAR v5.0 and I tried the following server:

  • Glassfish v3: the application is deployed without problems.
  • JBoss v6.0: error in the deployment., the log is incomprehensible
  • Apache Geronimo: initial error in deployment. The log message says clearly  that a Main class in the application Client is missing. After adding a Main class with an empty main method, the application is correctly deployed.

martedì 25 gennaio 2011

HTML CSS gradient background and rounded corner

Variety is the spice of life (Il mondo è bello perchè è vario)....


I'm wondering how many solution for obtaining a gradient background I found surfing the web. But it is absolute stunning how much solution there are to obtain rounded corner on border!!!! There are sites with lists of such methods.

Fortunately after trying many of theme I found that CSS 3 support this features (unfortunately with many browsew flavours...). A great example of such techniques is present at http://www.webdesignerwall.com/tutorials/css3-gradient-buttons/. Of course the concept can be applied to whatever element, not only buttons.

sabato 15 gennaio 2011

Glassfish v3 and JDBC realm

Surfing the web I was not able to find a clear tutorial on configuring a JDBC realm in Glassfish. Here I publish a short how-to with some screenshot of web administration console.

First of all connect to the console and go to Security / Realms and create a new one. Set name and class as in figure:

And below you have to set the properties according to your database configuration. In fact here you have to tell Glassfish where login information are. According to the database configuration in my precedent post:

lunedì 3 gennaio 2011

Glassfish v3 + Derby DB configuration

I found a great tutorial on using Glassfish v3 with Eclipse at http://programming.manessinger.com/tutorials/an-eclipse-glassfish-java-ee-6-tutorial/ . Here I will summarize how to create a Derby DB in eclipse and how to configure connection pool and JDBC resources using the Glassfish Administration Console.

Before doing this make sure that the Glassfish preference Start the JavaDB database process when Starting GlassFish Server is ticked.

First we have to create the Derby Database, in eclipse is very simple. Go in Data Source Explorer tab and on the contextual menu of Database Connection select new. Now select Derby as Connection Profile Type and set the name of the database, for example ShortRental Database. 
Now in the next step set the database properties as in figure:



Now start the GlassFish server and connect to the administration console (the default port is 4860) and go to Resources / JDBC / Connection Pools. Now create a new Connection Pool. Set the parameters as in figure:

Now pass to the next step, leave the properties at bottom as they are, and set the advanced properties as in the Derby DB, see the next screenshot:


At this point the configuration is completed, make sure the Ping checkbox is enabled and now you can try to ping the database.

The last operation to do is to define a JNDI name for access the database. Go to Resources / JDBC / JDBC Resources, add a new one and connect it to the just cretaed pool.

sabato 25 dicembre 2010

Database structure

After a brief planning, I decide how to organize the (very simple) database. Here is a schema of the DB configuration:


It takes into account the security question providing a table for GROUP that will be used for Role based access control.

giovedì 9 dicembre 2010

DBMS and IDE choice

The DBMS which I choose for the project is Java DB (aka Apache Derby). It is a relational database management system entirely written in Java that can be embedded in Java program and can be used for online transaction processing.
Furthermore it is well integrated whit Eclipse that is the IDE I have decide to use because I already have a discrete experience with it. Eclipse in particular offers automatic tool to generate entities (Java classes) from table which otherwise is a boring and error prone task.
Other Java DBMS was available (H2 and HSQLDB) but HSQLDB does non not have ACID properties and H2 cannot be integrated with Eclipse.

venerdì 3 dicembre 2010

Basic use case diagram

This is the basic use case diagram for the web site. It describes the actors and the main operations that will be available.
Basic use case diagram