Project Setup
Project Setup
Project Setup
The following procedure aims at helping developers to setup the project. The entire
setup is broken into two different parts – Initial setup and Code setup.
The project consists of two replication models – Asynchronous and Synchronous. The
following steps are common to both the models, unless explicitly mentioned.
Initial Setup
1. The project assumes that there are four systems, each with a different Operating
System – Windows Vista, Windows Server 2003, Fedora 10 and OpenSolaris
2008.11.
2. Install the four Operating Systems on four independent machines, or on four
different virtual machines of VirtualBox.
3. Make sure each Operating System has a unique IP address and all the four
systems are in a network.
4. Ping each system from the other three systems to check the integrity of the
network.
If using VirtualBox to setup the four Operating Systems, the following guide can
be used to setup the network –
Networking In VirtualBox
For the Synchronous replication model, the following guides can be used –
Asynchronous Replication
For the Synchronous replication model, the following guide can be used –
Synchronous Replication
01 create
If the replication process is running, the databases and tables will be created at
the slaves also.
12. For the Synchronous replication model, stop the slaves and run the following SQL
script at one of the MySQL nodes in the cluster –
01 create_ndb
01 create
Resynchronize the master properties in the slave and start the slaves.
13. That is it for the initial setup.
Moving to the code setup, there are two important ways in which these applications can
be executed – from the developer’s perspective using IDEs and from the end-user’s
perspective. The following procedures will describe both of them.
Project Setup MySQL Clustering
TelEx_WebService
IP addresses of databases
TelEx_WebService -> Web Services -> TelEx (line 17)
TelEx_WebService -> Source Packages -> <default_package> ->
hibernate.cfg.xml [XML] (line 7)
User Names
TelEx_WebService -> Web Services -> TelEx (line 18)
Passwords
TelEx_WebService -> Web Services -> TelEx (line 19)
TelEx_ASPWebService
TelEx_Swing
IP addresses of databases
TelEx_Swing -> Source Packages -> telex_swing -> TelEx_SwingView.java
[Source Code] (lines 1614, 1615, 1616 and 1617)
User Names
TelEx_Swing -> Source Packages -> telex_swing -> TelEx_SwingView.java
[Source Code] (lines 1620, 1621, 1622 and 1623)
Passwords
TelEx_Swing -> Source Packages -> telex_swing -> TelEx_SwingView.java
[Source Code] (lines 1620, 1621, 1622 and 1623)
TelEx_VisualWebJSF
TelEx_VisualWebJSF -> Web Pages -> options.jsp [JSP] (lines 17, 18, 19, 20, 25,
26, 27 and 28)
TelEx_VisualWebJSF -> Web Pages -> operations.jsp [JSP] (lines 24, 25, 26, 27,
29 and 32)
TelEx_VisualWebJSF -> Web Pages -> operations.jsp [Java] (line 34)
TelEx_VisualWebJSF -> Web Pages -> operationsUpdate.jsp [JSP] (lines 24, 25,
26, 27 and 29)
TelEx_VisualWebJSF -> Web Pages -> operationsUpdate.jsp [Java] (line 34)
TelEx_VisualWebJSF -> Web Pages -> success.jsp [JSP] (line 24)
IP addresses of databases
TelEx_VisualWebJSF -> Web Pages -> success.jsp [Java] (lines 93, 94, 95 and 96)
User Names
TelEx_VisualWebJSF -> Web Pages -> success.jsp [Java] (lines 99, 100, 101 and
102)
Passwords
TelEx_VisualWebJSF -> Web Pages -> success.jsp [Java] (lines 105, 106, 107 and
108)
TelEx_J2MEWeb
TelEx_J2ME
User Names
TelEx_Swing -> Source Packages -> telex -> TelEx_J2ME.java [Source Code] (lines
955, 956, 957 and 958)
Passwords
TelEx_Swing -> Source Packages -> telex -> TelEx_J2ME.java [Source Code] (lines
961, 962, 963 and 964)
23. Allow all Mobile applications to connect to the internet without asking for
permission. (Procedure explained below)
24. Right-click TelEx_Swing and select Run.
TelEx_ASP.net
IP addresses of databases
Project Setup MySQL Clustering
User Names
TelEx_ASP.net -> Success.aspx.cs (lines 30, 31, 32 and 33)
Passwords
TelEx_ASP.net -> Success.aspx.cs (lines 36, 37, 38 and 39)
1. Right-click the project to which the web service reference is being added, and
select New -> Web Service Client.
2. While specifying the location, either link it via a project present in NetBeans 6.5,
i.e. TelEx_WebService -> TelEx. Or specify the WSDL URL obtained in step 5 of the
previous procedure.
3. The Web Service uses classes which are linked directly to the databases by an
ORM model. Because of this, there is a clash between the data-type of Date. The
Web Service layer and XML prefer to use the XMLGregorianCalendar whereas
Hibernate uses the pure Date object.
4. This problem has to be solved manually. In the Project Folder, search for
Teldetails.class and delete it. Search for Teldetails.java and make the following
changes –
Allowing mobile applications to connect to the internet without asking for permission
The above mentioned Developer’s perspective is useful in situations where the source
code is available or where the URLs of the Web Services Layer keep changing frequently.
However in several situations, the entire process can be tedious and is difficult for the
end users to follow. So instead of distributing the source codes, they are made available
for the client in simpler ways involving –
• Distributable binaries in the form of Java archive. This method brings all the
classes used in the application as a single java archive (.jar) and this archive can
be distributed to the clients. This method is used in Java Swing and Java Micro
Edition.
• Web Applications. Here the web page is made available to the clients, generally
through a network (Mainly Internet). Any client knowing the URL of the web page
can connect to it. This process is used in Java Server Faces and ASP.net. However,
this method requires servers to be constantly running remotely.
Pre-Requisites
1. Setup the databases and configure the initial setup as mentioned above.
2. Deploy the Web Services layer on the GlassFish v2 App Server.
3. The IP addresses of the Databases and Web Service should remain static and
should not change often. However if required, the databases and the app server
can be associated with URLs such that even if the IPs change, proper re-direction
should take place.
4. For the GUIs involving Java Swing and the Java Micro Edition, the same procedure
as described above should be followed. On compiling the project, a java archive is
created in the dist subfolder of the project folder. This java archive can be
distributed to various clients.
5. For the GUIs involving Java Server Faces and ASP.net, the same procedure as
described above should be followed.
Project Setup MySQL Clustering
6. However at the end, any client can connect either to the GlassFish v2 app server
(for JSF) or the IIS server (for ASP.net) through the appropriate URLs to access the
applications.