Site icon Antonio's Blog

Install the application

Presentation

The Java EE 5 book enables you to develop an e-commerce application using multiple Java EE 5 specifications. Throughout the chapters you have to develop layer after layer (persistence, session facade, web interface, electronic shopping cart, web services and asynchronous processing) to obtain a web site to sale domestic animals.

Download the code

First of all, you have to download the code of the application.

Directories structure

Uncompress the file that you have just downloaded and you will obtain three principal sub-directories. Those correspond to the various applications:

As you can see it in the images below, each one of these applications is made up of sub-directories.

Each sub-directory contains specific files:

Install the tools

Before running the application, make sure that you have the needed tools installed:

Set up the servers

Now you have to setup GlassFish and the database. Ant admin tasks are in the %PETSTORE_HOME%/admin.xmlfile

%GLASSFISH_HOME%/\bin/\asadmin create-domain --adminport 8282 --user admin --savemasterpassword=true --instanceport 8080 petstore

        Please enter the admin password>adminpwd
        Please enter the admin password again>adminpwd
        Please enter the master password>masterpwd
        Please enter the master password again>masterpwd
	Using port 8282 for Admin.
	Using port 8080 for HTTP Instance.
	Using default port 7676 for JMS.
	Using default port 3700 for IIOP.
	Using default port 8181 for HTTP_SSL.
	Using default port 3820 for IIOP_SSL.
	Using default port 3920 for IIOP_MUTUALAUTH.
	Using default port 8686 for JMX_ADMIN.
	Domain petstore created.

You will then see the %GLASSFISH_HOME%/domains/petstoredirectory

If the server doesn’t start up, check the log file at %GLASSFISH_HOME%/domains/petstore/logs/server.log

[exec] Database started in Network Server mode on host localhost and port 1527.
     ...
     [exec] Command start-database executed successfully.

Check the configuration

Check that the configuration is ok using the %PETSTORE_HOME%/ant -f admin.xml listtask. This will execute the following tasks :

[exec] CallFlowPool
         [exec] TimerPool
         [exec] DerbyPool
         [exec] petstorePool
[exec] jdbc/TimerPool
         [exec] jdbc/CallFlowPool
         [exec] jdbc/default
         [exec] jdbc/petstoreDS
[exec] jms/queue/client
         [exec] jms/topic/order
         [exec] jms/petstoreConnectionFactory

Deploy the application

Now that the servers are setup, you have to deploy the applications on the server.

Déploy the BarkBank application

Déployez l’application PetEx

Déployez l’application Yaps

Use the application

Once the three applications deployed, you can go to http://localhost:8080/petstore/.Look at the animals catalog, create your own account or log on as job/job. Buy some pets, create an order and you’ll use the external web services of BarkBank (to validate bredit cards) and PetEx.

To run the Swing application use the %PETSTORE_HOME%/ant run-clienttask

Stop/Start the servers

Exit mobile version