faceCart Installation Guide

 

Thank you for using faceCart shopping platform.

 

faceCart was created using cutting edge technologies – AJAX, JavaServerFace EJB3.0. 

faceCart should run with ease on every application server that support EJB3.0.

faceCart is database independent.

 

Although on theory faceCart is independent both on Application Server realization and database it has been tested on Jboss 4.0.5 with EJB3.0 support and mysql 5.0.X

 

1.   Setting up application server

1.1.        Jboss

 

1.1.1.   Download jboss 4.0.5 or later.

      JBoss4.0.x needs to support EJB3.0.  For JBoss 4.0.x use JEMS installer:

      http://labs.jboss.com/jemsinstaller/downloads/

 

1.1.2.   Configure mysql

 

NOTE: for this guide we will assume that you have configured default datasource name by the name of “DefaultDS”.

 

In facart distribution zip file under /conf/jboss4.x.x locate mysql-ds.xml and copy it to <JBoss_instance_dir>/deploy. Delete hsql-ds.xml.

Change the IP address of the database if necessary. Now skip 1.1.3 and go to 1.1.4.

 

OR

 

Confugure mysq for jboss manually using the following tutorial:

http://www.onjava.com/pub/a/onjava/2004/02/25/jbossjdbc.html

 

of you may use the predefined mysql service file located under

 

NOTE: if you change the datasource name then search all occurrences of the old datasource name and change them to the new one. For example default datasource name is DefaultDS. If you change it to MySqlDS you will have to change all occurrences of DefaultDS in the folder structure of mysql to MysqlDS.

 

 

1.1.3.   Add facecart datasource to mysql-ds.xml. It should be located under

  your /deploy directory if you have followed jboss+mysql manual  above.

Add the following lines:

<local-tx-datasource>

    <jndi-name>faceCartDS</jndi-name>

    <connection-url>jdbc:mysql://localhost:3306/facecart

    </connection-url>

    <driver-class>com.mysql.jdbc.Driver</driver-class>

    <user-name>user</user-name>

    <password>password</password>

    <exception-sorter-class-name>

     org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter

     </exception-sorter-class-name>

    <metadata>

       <type-mapping>mySQL</type-mapping>

    </metadata>

  </local-tx-datasource>

 

1.1.4.   JBoss JMS config

At this moment if you start JBoss it is possible that JMS will throw exceptions. Under /conf/jboss4.x.x  directory of the distribution you will find. mysql-jdbc-state-service.xml and mysql-jdbc2-service.xml. Copy them in <JBoss_Instance_dir>/deploy/jms. And delete default hsql-jdbc-state-service.xml and hsql-jdbc2-service.xml. If

 

 

 

1.1.5.   Logging

Go to <instance_dir>/conf and locate log4j.xml or jboss-log4j.xml (for JBoss4.2.x or later)

Add following lines:

 

<appender name="FACECART_LOG" class="org.apache.log4j.FileAppender">

    <param name="File" value="${jboss.server.home.dir}/log/testlog.log" />

    <param name="Append" value="true" />

                     <layout class="org.apache.log4j.PatternLayout">

    <param name="ConversionPattern" value="%d{dd MMM yyy HH:mm:ss}, %-6p %C:%M:%L %m %n" />

    </layout>

</appender>

 

<category name="com.facecart.ecm">

      <priority value="DEBUG"/>

      <appender-ref ref="FACECART_LOG" />

</category>

 

Read logging documentation in order to fine tune application  logging.

 

 

1.1.6.        The mysql db script is located under /db/facecart-mysql-db.sql execute this script against mysql server.

Use the following command:

mysql  - -user=<user> - -password=<pasword>   <path_to_db_script>

 

Locate /db/mysql-connector-java-5.0.4-bin.jar and copy it under <Instance_dir>/lib

 

1.1.7.   Application content. 

Application content is all the static content delivered to the application. For example all images. In the distribution zip file you will find it under /content directory.

 

In the distribution package you can locate all faceCart content under “content” folder. Set environment variable FACECART_CONTENT_DIR = <content dir> pointing to your content dir.

 

1.1.8.   Web Server for the static content

The installation and configuration of web server for the static content is not part of this tutorial and is different for every web server. So do it yourself.

 

In order to start faceCart we will configure Jboss to serve the static content. This is default configuration and we recommend to use apache or static content specialized web server.

 

Go to /deploy/jbossweb-tomcat55.sar (JBoss4.0.x) or

/deploy/jboss-web.deployer (JBoss4.2.x) and open server.xml

 

Locate “<Host name="localhost"” inside the tag add:

 

docBase must point to your static content home folder.

 

 

<Context path="/content" docBase="Path to content" reloadable="true"

                                         crossContext="true" allowLinking="true"/>

 

 

Now set the Environment Variable

FACECART_CONTENT_ADDRESS=http://localhost:8080/content

 

 

1.1.9.   Count down 3 2 1 fire!

 

 

Copy the to ear files faceCart.customer.ear and faceCart.merchant.ear to <Jboss_instance_dir>/deploy.

 

Start jboss.

 

NOTE: for JBoss4.2.x and later, if you use address other than localhost for the FACECART_CONTENT_ADDRESS you will have to disable JBoss default security setting by starting JBoss with the following commang:

 

run –b 0.0.0.0

 

 

You will locate customer application under:

http://localhost:8080/facecart.web.customer

 

You will locate merchant application under:

http://localhost:8080/facecart.web.merchant

 

NOTE: faceCart has been tested on JBoss4.0.x and JBoss4.2.x. It is not tested for JBoss5.0.x. We encourage you to test it and to send us feedback. We also encourage you to test it on bea weblogic.