FindServices.Com

This website allows registered users to add details regarding various services provided by either them or others. This information is used by users who are searching for a service. For example, a user of this site (registered/not registered) can search for details regarding who are providing Java training.

Architecture Of the Project

This project made use of a couple of design patterns. Actually more importance is given to design patterns and technical aspects rather than the domain, as it is a classroom project aimed at showing how to use Java EE to develop a real-world application.

The following is the overall architecture of the project.

Products used in this project

NOTE: Steps related to deploying this application to JBoss 4.0.x are given below.

The following are the steps to be taken to run this application :

  1. Create may22 account with password may22 in Oracle10g Express Edition. This must be done after you log in as SYSTEM user.
    create user may22 identified by may22;
    grant connect,resource to may22;   
  2. Create required tables in may22 account by using commands in project description.txt file (you find it in your project when you go to Files view of NetBeans). .
  3. Create a sequence, which is used to generate service id, with the name ID_SEQ.
  4. In SJSAS's admin console, create the following usin Resouces->JDBC node
  5. Select Connection Pools link and click on New button to create a new connection pool with the following details.
    Name : oraclePool
    Vendor : Oracle
    Datasource name : oracle.jdbc.pool.OracleDataSource            
    In properties of the connection pool, provide value for the following properties and delete the remaining properties (select property and click on Delete Property button)
    User : may22
    Password : may22
    Url : jdbc:oracle:thin:@localhost:1521:xe            
  6. Copy OJDBC14.JAR file from Oracle installation to lib directory of Domain1 in SJSAS
  7. Select JDBC Resource link and click on New button to create a Data Source. Enter jdbc/oracle as the name of the Data Source and oraclePool as the name of the Connection Pool.
  8. Create an account in CMail Server and configure Outlook express to add a mail account for this user
  9. Download findservices.zip and unzip it into d:\ directory. You can substitute d:\ with another path if you like.
  10. Start NetBeans 5.5.
  11. Make sure SJSAS is added as a server using Tools->Server Manager.
  12. Open findservices project using File->Open Project. Findservices project is an Enterprise application with findservices-ejb and webfindservices projects in it.
  13. Build and deploy the project to SJSAS.
  14. Run this project - you must see index.jsp page.

Deploying Application To JBoss

The following procedure explains how to deploy a web application FindServices in JBOSS application server.
  1. You better change port number at which Tomcat in JBoss is running using JBOSS_HOME\server\default\deploy\jbossweb-tomcat55.sar\server.xml file. Change port number of HTTP Container from 8080 to 9999 (or any other unique port number). This is required as Oracle10g also uses 8080.
  2. Uncomment lines related to Java 1.5 support in Tomcat 5.0, otherwise it doesn't support 1.5 features like enhanced for loop etc.
    <init-param>
     <param-name>compilerSourceVM</param-name>
     <param-value>1.5</param-value>
    </init-param>
  3. Copy oracle-ds.xml into depoloy diectory and modify it as follows to include a data source, which also creates a connection pool to Oracle.
    <local-tx-datasource>
     <jndi-name>may22</jndi-name>
     <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
     <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
     <user-name>may22</user-name>
     <password>may22</password>
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
     <metadata>
       <type-mapping>Oracle9i</type-mapping>
     </metadata>
    </local-tx-datasource>
  4. Add  Jboss as a server to NetBeans using Tools->Server Manager.
  5. Change target for findsevices and findservices-ejb projects to JBoss application server.
  6. Change ServiceLocator.java to change JNDI names of session beans as follow
    findservices.MemberEntityFacadeRemote to findservices/MemberEntityFacade/remote
    findservices.ServiceFacadeRemote to findservices/ServiceFacade/remote             
  7. Change JNDI name used in persistence unit - persistence.xml from  jdbc/oracle to java:may22.
  8. Run the application using the following url:
    http://localhost:9999/findsevices 
  9. You should see login page (index.jsp) of the application.