Use of Echo2 in WebScope

Transcription

Use of Echo2 in WebScope
THE AUSTRALIAN NATIONAL UNIVERSITY
Faculty of Engineering and Information Technology
Use of Echo2 in WebScope
(WebScope2)
Zhongshan Tan
(u4084188)
November 2006
Report for the COMP6703 eScience Project (Semester 2, 2006)
TABLE OF CONTENTS
ACKNOWLEDGMENTS
ABSTRACT
1 Introduction......................................................................................................................... 7
1.1 Overview.................................................................................................................. 7
1.1.1 Background ................................................................................................... 7
1.1.2 Purpose.......................................................................................................... 8
1.2 Introduction to WebScope ....................................................................................... 8
1.3 Introduction to WebScope with Echo2 .................................................................. 10
1.4 Key technologies involved..................................................................................... 11
2 Requirements analysis ...................................................................................................... 12
2.1 Client / Supervisor ................................................................................................. 12
2.2 Software involved .................................................................................................. 12
2.3 Operating system ................................................................................................... 12
2.4 Languages .............................................................................................................. 12
2.5 Client requirements................................................................................................ 13
3 Scheduling......................................................................................................................... 14
3.1 Planned timetable................................................................................................... 14
3.2 Actual timetable ..................................................................................................... 14
3.3 Planned project progress and actual project progress ............................................ 15
3.4 Difference between planned timetable and actual timetable ................................. 15
3.5 Statistic of the workload of the project .................................................................. 16
4 Modeling ........................................................................................................................... 18
4.1 Structure of WebScope2 ........................................................................................ 18
4.2 High level design ................................................................................................... 18
4.2.1 System context ............................................................................................ 18
4.2.2 Domains ...................................................................................................... 20
4. 3 Detail design ......................................................................................................... 21
4.3.1 Communication between packages............................................................. 21
4.3.2 Database design .......................................................................................... 22
4.3.3 WebScope2 domain .................................................................................... 22
4.3.4 DataServer domain...................................................................................... 23
4.3.5 Graphics domain ......................................................................................... 24
4.3.6 DataAccess domain..................................................................................... 25
4.3.7 Mapping domain ......................................................................................... 26
5. Implementation ................................................................................................................ 27
6. Testing.............................................................................................................................. 29
6.1 Unit test.................................................................................................................. 29
6.2 Module test............................................................................................................. 29
6.3 Acceptance test ...................................................................................................... 31
7. Evaluation ........................................................................................................................ 32
7.1 Requirements fulfilment ........................................................................................ 32
7.2 Functionality comparison with EScope and WebScope ........................................ 32
7.3 Performance comparison with EScope and WebScope ......................................... 33
8. Future work...................................................................................................................... 35
9. Conclusion ....................................................................................................................... 36
10. REFERENCES .............................................................................................................. 37
2
10.1 Web references..................................................................................................... 37
10.2 Book references ................................................................................................... 37
APPENDIXES ..................................................................................................................... 38
APPENDIX A How does Hibernate work? ................................................................. 38
APPENDIX B Installation and compilation guide ...................................................... 41
APPENDIX C Issues faced during the development of WebScope2 .......................... 45
3
Acknowledgments
During the project of developing WebScope2, I faced uncountable problems to deal with.
However, I was lucky. Whenever I had problems that I could not overcomes, there were
always someone who could help me, at least encouraged me.
Dr. Henry Gardner--my project client as well as supervisor, is the one, who would help me
with kinds of problems, no matter how busy he was. Moreover, he is such a great me that
his encouragement and approval is the impetus that helps me achieve the final success of
the project. I sincerely thank him!
Ajith M. Jose, the form student of eScience, is the developer of WebScope. At the
beginning of my project, he gave me a lot of help. Sometimes he would stay and help me
until mid-night. Without his help, I could not well understand his project, which is the
precondition of doing my project. I appreciate what he did for me.
There are more people I would like to thank. They are:
Raju Karia
Le Ma
Hugh Fisher
Dr. Alistair Rendell
Echo2 development team
Thank them all!
4
Abstract
This report outlines the development of the “Use of Echo2 in WebScope” application for
the eScience project COMP6703 of the Australian National University.
The core idea behind “WebScope”—the current version-- is retrieving the nuclear fusion
datasets from the MDSPlus (a software system developed for the Italy based nuclear
research organization, "The Center for Nuclear Research, Padua") based server through a
web browser. The use of java object/relational package “Hibernate” in caching the
retrieved datasets is the highlight feature of this project.
In the project what I am doing is implementing the whole system with Echo2. Echo2 is the
next-generation of the Echo Web Framework, a platform for developing web-based
applications that approach the capabilities of rich clients. The other change in the project is,
when plotting scientific data, using image instead of Java Applet, which is the plotting
solution in the current system.
This report is divided into 7 major sections.
•
Section 1, Introduction, gives an overview of the project, as well as the expected
outcomes, outputs and the major deliverables of the project. Through this section
the customers and major stakeholders of the project are identified. It also gives a
brief introduction to the Echo2.
•
Section 2, Requirement Analysis, describes detailed user requirements, software
and other tools needed to accomplish this project.
•
Section 3, Scheduling, describes the planned time and actual time spent on various
phases involved in this project, difference between them and analysis of the
difference.
•
Section 4, Modelling, also known as Designing, uses UML model to design the
structure of this software. It also defines the database structure.
•
Section 5, Implementation, describes the ideas and methods used to achieve the
functionalities of “Web Scope” application with Echo2.
•
Section 6, Testing, describes different types of testing applying in the development
of the software.
5
•
Section 7, Evaluation, evaluate the software in different aspects.
•
Section 8, Future Work, gives suggestions on further development.
•
Section 9, Conclusion, draws a conclusion from this project.
•
Section 10, References, shows the various references used for accomplishing the
“Web Scope” application.
•
Section 11, Appendixes.
6
1 Introduction
1.1 Overview
1.1.1 Background
Currently nuclear fusion research is being performed at various locations of the world.
Millions of nuclear fusion datasets are generated as a result of various nuclear fusion
experiments happening at different research organizations. It is very important for the
researchers to share the datasets for mutual research benefits. The safe storage and retrieval
of fusion datasets is currently done using a data storage and management system known as
“MDSPlus”.
For research purposes, various students supervised by Henry Gardner have worked on
“Scope projects” for two years. By the end of Semester 1 2006, there had been two
versions of Scope: “EScope” and “WebScope”. The latter is considered to be a web-based
version of the former, with the intention of enhance universality of usage.
EScope:
Researchers from different parts of the world connect to the MDSPlus and retrieve the
required datasets for their own research purposes. Special client side software applications
like “EScope” are used to retrieve the datasets from the MDSPlus server. The client side
applications plot the retrieved datasets as graphs or as statistical information tables.
However, there are many limitations to this way of retrieving datasets from the MDSPlus
server and the retrieved datasets are not cached at the client side, therefore the researchers
have to wait for the same amount of time even when accessing previously accessed datasets.
The researchers need to install specific software applications to retrieve the datasets from
the MDSPlus server. If they do not have the specific software on the computer they are
unable to connect to the MDSPlus and retrieve the data.
Noticing the deficiencies stated above, “WebScope” was developed.
WebScope:
The project “WebScope” is a project to resolve the existing issues with the retrieval of
datasets from the MDSPlus server. Through this project, the “EScope” dependent issues are
solved. Another highlight of “WebScope” project is the use of Java object relational
mapping solution “Hibernate” to solve the caching issues with “EScope” data retrieval
system.
7
After being used for a period of time, some problems and the need to be modified of
“WebScope” have been uncovered. Firstly, “WebScope” software is developed with JSP
(JavaServer Pages). As the evolution of the industry, traditional web development
technology like JSP was found to be inefficient. The web browsers on client side render the
web page every time when an interaction between user and the web page has occurred,
regardless how minor the change of web page is, comparing to the previous page. Second,
“WebScope” uses applets to display graphs on the client side. As raised by Henry Gradner,
users might be unwilling to download Applet, since it takes time and runs relatively slow.
Based on above-mentioned consideration, Henry Gradner and Raju Karia introduced that
implementing the “WebScope” with Echo2. Echo2 is a Java implemetation of AJAX. I
shall briefly describle both of the below:
Ajax, shorthand for Asynchronous JavaScript and XML(Extensible Markup Language), is
a web development technique for creating interactive web applications. The intent of Ajax
is to make web page response to the exchange of small amounts of data between the
browser and the server, rather than reloading the entire web page each time the user makes
a change. This is meant to increase the web page's interactivity, speed, and usability.
Echo2 is a platform for developing web-based applications. Its Ajax-based rendering
engine enables it to provide users dramatic performance and capability. Echo2 removes
developers from having to think in terms of "page-based" applications and enables them to
develop applications using the conventional object-oriented and event-driven paradigm for
user interface development.
1.1.2 Purpose
The purpose of doing this project is to re-develop “WebScope” with Echo2 so that it
enhances its functionality and performance.
1.2 Introduction to WebScope
“WebScope” is the system proposed by Raju Karia and Henry Gardner and realised by
Ajith Jose. It solved the limitations “EScope” by changing the entire system architecture
and by implementing new technologies. Figure 1.1 describes the “Web Scope”.
8
Figure 1.1 High level structure of WebScope system
WebScope runs on a web server and waits for the client requests coming through web
browsers. It maintains a database (“HSQLBD”) for storing the retrieved datasets from the
MDSPlus server. All database interactions (storage and retrieval of datasets) are handled
using the Hibernate package, which is an object/relational persistence and query service for
Java.
WebScope works in the following way:
When a client request arrives at the “WebScope”, it returns a web GUI to the client.
1) The web-based MDSPlus data retriever application, “Web Scope” runs on a Web
Server (Tom Cat) and accepts the client requests coming through web browsers.
2) Upon receiving a client request the “Web Scope” checks for the client requested data in
the attached HSQL database. If the requested data set is available in the database it is
retrieved and sent to the client Web browser. If the requested data set is not available in
the database, it is retrieved from the MDSPlus server and sent to the client Web
browser. A copy of the retrieved data set is stored in the data base for later use, so that
the later requests for the same data sets can be accomplished faster.
3) Using applets the retrieved data sets are plotted as graphs at the client Web browser.
The benefits of using WebScope are given below
9
•
Users need not install any specific software to retrieve and view the MDSPlus data.
They just needed to connect to the Web Server using a web browser.
•
Users are not restricted to the data sets in the database. If requested data sets are not
available in the database it is retrieved from the MDSPlus server and shown to the
client.
•
The use of hibernate package makes the caching faster.
•
The utilization of the resources at the client side is decreased dramatically
1.3 Introduction to WebScope with Echo2
Compared with WebScope, WebScope with Echo2 (called WebScope2 in the following)
does not change much in terms of architecture and the structure of the system. The main
deference between “WebScope” and “WebScope2” is WebScope uses JSP to create
dynamic web pages, while “WebScope2” uses Java Language in Echo2 framework to
developing web-based applications. It is essentially a technical change, pursuing a more
succinct application and high performance. The change from “WebScope” to
“WebScope2” is shown below:
Echo2
Echo2
Figure 1.2 High level structure of WebScope2 system
10
The main benefits of using “WebScope2” are given below
•
Web pages do not update the whole pages when some changes of web page occur
after the interaction between users and web pages, since Echo2 has an Ajax-based
rendering engine.
•
In the period of development, the developer does not have to think in terms of
"page-based" applications and is able to develop applications using the
conventional object-oriented and event-driven paradigm for user interface
development.
•
Users do not have to download Java Applet to plot graphs. In “WebScope2”,
buffered image is used to chart scientific data retrieved from remote data server
(MDSPlus) or web server where WebScope2 sits and ever accessed data is stored.
1.4 Key technologies involved
The key technologies involved in “The use of Echo2” project are Echo2 and Hibernate. The
former one has been briefly discussed in Section 1.1.1. The following paragraph explains
what Hibernate is. To get more details about how hibernate work, please refer to
APPENDIX A How does Hibernate work.
Hibernate is a Java based object/relational mapping solution. It can dynamically create the
database tables based on the information provided. It is much easier to retrieve and store
data using the Hibernate package than the existing ones. Rather other using SQL query
language to operation the database, developers employing Hibernate deal with database in
conventional object-oriented way. Tables in database are exhibited as objects after wrapped
by Hibernate which plays the role of transitional level.
11
2 Requirements analysis
2.1 Client / Supervisor
Henry Gardner is the client of the project as well as the supervisor of the project.
2.2 Software involved
The main software and other tools used for the development of “Use of Echo2 in
WebScope” are given below.
• Jakarta Tom Cat 5.0
• Hibernate3.0
• JDK1.5
• HSQLDB
• Echo2 framework
• Eclipse 3.1 (or later) with web development plugin
• Web Browser (e.g. IE, Firefox)
2.3 Operating system
Any (platform independent)
2.4 Languages
•
•
Programming Language: Java
Database Language: HQL (Hibernate Query Language)
12
2.5 Client requirements
The following table shows the major requirements specified by the client.
No.
Name
Description
Priority
R1
Using Echo2
High
R2
Using Web
Browser
R3
Plotting Graph
R4
Data Caching
R5
Data Download
R6
Plotform
Independence
User
authentication
Using
Hibernate
“WebScope2” shall use benefit of Ajax-based web
application development tool – Echo2
“WebScope2” shall be able to allow users to
connect to the MDSPlus server and retrieve the
required datasets using a web browser
“WebScope2” shall be able to plot graphs, as its
main function based on the retrieved MDSPlus
datasets.
“WebScope2” shall have the function of caching
data, so that the later access of the data would not
need to connect the MDSPlus
“WebScope2” shall be able to allow users to
download specific data in the form of text file, so
that users can view and analyses data off-line
“WebScope2” shall be able to work on all major
platforms.
“WebScope2” should have the function of user
registration and login.
“WebScope2” should use the Java object relational
mapping solution “Hibernate”, on the purpose of
software integration and extension.
R7
R8
High
High
High
High
High
Medium
Medium
Table 2.1 Major requirements of “WebScope2”
13
3 Scheduling
3.1 Planned timetable
The initial planned timetable is as below: (Table 3.1)
Phase
Date
Expected Duration
Tasks
1
2nd Aug – 6th Aug
5
Understanding requirements
2
7th Aug – 27th Aug
21
Environment Configuration
and Modeling
3
28th Aug – 8th Oct
42
Implementation
4
9th Oct – 22nd Oct
14
Test and Documentation
5
23rd Oct – 29th Oct
7
Final Presentation Preparation
Table 3.1 Planned Timetable for “WebScope2” project
3.2 Actual timetable
The actual timetable is shown as below: (Table 3.2)
Phase
Date
Expected Duration
Tasks
1
7th Aug – 8th Aug
2
Understanding requirements
2
9th Aug – 13th Sep
35
Environment Configuration
and Modeling
3
14th Sep – 15th Oct
31
Implementation
4
16th Oct – 15 Nov
31
Test and Documentation
5
7th Nov – 9th Nov
3
Final Presentation Preparation
Table 3.2 Actual Timetable for “WebScope2” project
14
3.3 Planned project progress and actual project progress
Figure 3.3 Project progress in planned version and actual version
3.4 Difference between planned timetable and actual timetable
As we can see from the Table 3.1, Table 3.2 and Figure 3.3 listed above, since the phase
2(Environment Configuration and Modeling), the project slipped, relative to the planned
timetable. There are various reasons:
z Environment Configuration cost me a long time. Since software involved in the project,
such as Tomcat, Eclipse and Echo2, mostly was new to me, so it was not easy for me
to get all of them correctly installed and make them work.
z Technologies involved in the project also took me along time to learn. Operating
Eclipse, writing Echo2 test program, dealing with the buffer function of Tomcat
(Which was not I wanted) is not easy for a beginner. Worthy of note, the learning
curve of operating Eclipse is very steep at the beginning part, which means it is hard
for a novice to engage into it.
z The difficulty and workload was underestimated in the initial project plan. It was
because of lack of understanding of software and technologies involved in the project
and no experience on relative project.
On the other hand, as depicted in the two tables, the actual days spent on phase 3
(Implementation) was less than the planned one. This is meanly because I concentrated on
the project at that time and daily hours working on the project were increased comparing to
other phases. Figure 3.4 shows the effort allocation (hours spent per day).
15
Effort Allocation
Hours per day
6
5
4
Planned
Actual
3
2
1
0
1
2
3
Phase
4
5
Figure 3.4 Effort Allocation in different phases in “WebScope2” project
3.5 Statistic of the workload of the project
Deducted from Table 3.2 and Figure 3.4, a graph (Figure 3.5) showing total workload
(measured with hours) is generated.
Effort (hours)
9
31
4
140
155
Phase
Phase
Phase
Phase
Phase
1
2
3
4
5
Figure 3.5 Time Allocation on each phase of “WebScope2” project
16
As Figure 3.5 indicates, most time was spent the phase 2 (Environment Configuration and
Modeling) and phase 3 (Implementation). It reasonably reflects the characteristic of the
project:
z New knowledge need to learn (it is a student project);
z Implementation emphasis.
17
4 Modeling
4.1 Structure of WebScope2
The structure of WebScope2 is shown as below in Figure 4.1.
Data Caching
Server
Web
Browser
MDSPlus
Tomcat (Web
server)
Network
WebScope2
Network
Hibernate
HSQLDB
Figure 4.1 Structure of WebScope2 system
Comparing to WebScope, the structure of WebScope has been changed in the following
aspect:
A new data caching server is added. After analysis and discussion with the client, I
decided to remove the function of caching data in HSQLDB, while store data in a
separate server (Data caching server). Because some times the size of data is huge,
it is not wise to put it in HSQLDB. It is more reasonable in a file server which is
“Data caching server” in this system.
4.2 High level design
4.2.1 System context
Figure 4.2.1 shows system context diagram which depicts system interaction with actors.
18
Figure 4.2.1 Context Diagram of “WebScope2”
There are four kinds of actors interacting with “WebScope2”.
z User:
1. The user inputs user authentication (user email and password), after verification, the
system sends back user information to the user.
2. The user specifies what data server to connect with server name, server port,
experiment name and shot name. Then, the system sends data of the specified
experiment, in the form of tree.
3. The user specifies a tree node that he/she wants to view. The system sends two type
of expression of the tree node. One is the graph which is converted from binary
code of the specified tree node. The other is data information such as numbers of
point in the tree node and the text file which enables the user to download and anal
size the data.
z
MDSPlus:
The system connects to MDSPlus server and opens a specific experiment; and it
sends a node path to request a specific data. The MDSPlus server sends the data
which is at the specified node path.
19
z
Caching Server
1. The system sends the data to caching server in two forms: binary file and text file.
Then the data is cached in caching server.
2. The system sends a request to caching server to retrieve a cached data. The caching
server returns the data to the system when request.
z
Database
1. The system sends user information to database. Then user information is saved in
database.
2. The system sends a request to database to retrieve user information. The database
returns user information to the system when queried.
4.2.2 Domains
There are various domains used in WebScope2, the major domains are described as below:
Domain
WebScope2
DatabaseAccess
DataServer
Graphics
Mission Statement
Provides a way for researchers to retrieve and view the fusion
datasets
Controls the access to the database by using Hibernate mapping
solution. This domain is the bridge between the database and
WebScope2 domain
Controls the access to MDSPlus server; caches data in data
caching server in forms of binary and text file, for the later use.
This domain is the bridge between MDSPlus server and
WebScope2 domain
Coverts data to graph based on the dataset supplied to it. The
dataset can be retrieved from MDSPlus server or from caching
server which is a proxy server of MDSPlus server.
The domain chart (Figure 4.2.2) shows the relationship between domains.
20
Figure 4.2.2 Domain Chart of “WebScope2”
4. 3 Detail design
4.3.1 Communication between packages
Figure 4.3.1 shows the communication between packages in WebScope2 system.
Figure 4.3.1 Communication between packages in WebScope2 system
21
4.3.2 Database design
Database design was relatively easy in the project. There is only one table which stores
users’ information for the purpose of authentication and further extension. It has an ID field
which is the primary key; the ID is self-incremental when a new user is registered into the
table. Field details are shown in Figure 4.3.2.
Users
id: long
username: varchar
email: varchar
password: varchar
organization: varchar
education: varchar
address: varchar
creationdate: date
Figure 4.3.2 Table Users and fields
All interactions with the database are handled with the help of java object relational/
mapping solution “Hibernate”. Java persistent classes were created to represent the
database tables and the details of those classes were entered into the Hibernate mapping file
(“hibernate.cfg.xml”). Hibernate dynamically creates the tables corresponding to the
information provided in the mapping file, and performs various actions.
4.3.3 WebScope2 domain
WebScope2 domain provides a way for researchers to retrieve and view the fusion datasets.
The following figure (Figure 4.3.3) shows the classes in WebScope2 Domain and their
relationships.
22
Figure 4.3.3 Classes in WebScope2 Domain and their relationships
4.3.4 DataServer domain
WebScope2 controls the access to MDSPlus server; caches data in data caching server in
forms of binary and text file, for the later use.. This domain is the bridge between MDSPlus
server and WebScope2 domain.
Most classes in DataServer domain in WebScope2 system reuse dataServerDomain in
EScope4 which is developed by Dr. Henry Gardner. Moreover, some additional classes are
included in the domain. They are DataServerCache class, CacheThread class and
TextFileMaker class.
z DataServerCache class is the class for caching data into local server rather other
retrieving data from MDSPlus server every time.
z CacheThread class is the class in which a respective thread runs, which is on the
purpose of enhance the performance and usability. Data can be downloaded while the
system plot graph to user.
23
z
TextFileMaker class converts binary file to text file, which enables users to download
text file format of data to view and analysis off-line. Also, it has the caching function;
any downloaded text file is cached for the later use.
The following figure (Figure 4.3.4) shows the classes in DataServer Domain and their
relationships.
Figure 4.3.4 Classes in DataServer domain and their relationships
4.3.5 Graphics domain
Graphics domain coverts data to graph based on the dataset supplied to it. The dataset can
be retrieved from MDSPlus server or from caching server which is a proxy server of
MDSPlus server.
The following figure (Figure 4.3.5) shows the classes in Graphics Domain and their
relationships.
24
Figure 4.3.5 Classes in Graphics domain and their relationships
4.3.6 DataAccess domain
There is only one class in DataAccess domain—Users class. It is a persistent class used by
the Hibernate package to perform the database operations.
The following figure shows the Users class and its attributes.
Users
id: long
username: String
email: String
password: String
organization: String
education: String
address: String
creationdate: Date
Figure 4.3.6 Users class in DataAccess domain
As you might have noticed, the Users class looks very similar to Figure 4.3.2(Table Users
and its fields). That is the way Hibernate works. In the program, there is a class named
Users, it matches a table Users in database, with the help of Hibernate mapping solution.
25
4.3.7 Mapping domain
Mapping contains two XML files:
z
z
hibernate.cfg.xml which specifies the connection to the HSQL database.
UserInfoMapping.hbm.xml which maps the User class in DataAccess domain to the
corresponding database table—Table Users.
26
5. Implementation
Since the number of technologies involved in the development of “WebScope2” is high,
the whole implementation phase was divided into six sub-phases. The details of these subphases are given below in Table 5.1:
Sub-phase name
Activities involved
1. User authentication
Configuring the Hibernate package and set up a
database for the storage of user information
2. Data retrieval and
z Through a web browser the user view the tree
plotting
form of the specific experiment on MDSPlus
server
z Based on the user’s specification, a graph plotting
the data is shown to the user.
3. Data caching
Check for the availability of user’s specified data in
the data caching server. If the data is available in the
caching server, retrieve it and store it in system
memory. If the data is not available in the caching
server, retrieve it from MDSPlus server; keep a copy
of it in the data caching server for later use.
4. Data download
When getting a user’s request of downloading data,
check for the availability of the text file, which stores
user’s specified data, in the data caching server. If the
text file is available in the caching server, download it
to user’s computer. If the text file is not available in
the caching server, covert the data to text file format
and keep a copy of it in the data caching server for
later use, then down it to user’s computer.
5. Enhance the performance Use multiple thread to enhance the performance,
which enables multiple tasks to be done concurrently
6. Testing
z Test the software by various possibility of use
z Test the software by various conditions (such as
the MDSPlus is out of work, the connection is
interrupted while interacting)
Table 5.1 Sub-phase and involved activities.
Generally, the whole development of the project went smoothly. However, some tough
parts did exist.
27
Getting start is never easy. Since transiting to implementation phase, it took me almost one
week to get a simple test application run. Along with being more proficient with Echo2, I
did the rest work of sub-phase 1 very quickly; as it was quite straightforward once I
understood how to get Echo2, Hibernate and HSQLDB work together.
In sub-phase 2, there are some tricky and tedious things happened that made me suffer a lot.
Around three weeks are spent on solving those problems, with little progress each day. The
reasons are various. The most torturing one is the immaturity of Echo2. However, problems
had been finally solved, regardless whether the way to solve them was directly overcome or
by a circuitous way. More details please refer to Appendix C: Issues faced in the
development of the “WebScope2”.
The screen shot of the main page of WebScope2 showing the data tree and the graph of a
selected tree node is shown below in Figure 5.1.
Figure 5.1 Screen shot of data tree and the graph of a selected tree node
28
6. Testing
Even though the project is relatively small, testing, as the crucial process ensuring
software’s quality, is indispensable. Various kinds of test were carried out in the
development of the software, for different purpose.
6.1 Unit test
Unit test is a process in which units in the program are test. A unit is an individual element
such as a method. Without unit test, the quality of elements in a program can not be
guaranteed and the further development can not be ensured to smoothly carry through.
During the development of “WebScope2”, unit test have not been formally done. There is
no written unit test plan and document. However, it has never been ignored and stopped.
After every a small amount lines of code had been written, I would test if the new written
code worked correctly. Moreover, after every element of program was done, test on that
element was considered and put in practice. I would test it buy check its output according
to its valid input.
The successful of each step I planned is truly contributed to the unit test I did in the
development.
6.2 Module test
A module test is a test on a collection of individual program elements such as class,
package. It ensures the quality of modules in program. It also affects the integration of
modules in later phases.
Because of the structure characteristic of “WebScope2”, it is quite easy to Module test. In
“WebScope2”, the whole program is divided into domains. Each domain has its respective
responsibility for the system; and each class in a domain also fulfils an individual function.
So it is quite loose coupling. The following table (Table 6.2 Module test on domains)
shows module test on domains, the test plan and the result of the test. Note that:
z Test plans in Table 6.2 are partial, only typical and important plans are listed for
demonstration.
z Since WebScope2 is the coordinator domain as all of its functions are reflected in web
page, so the test of this domain is left to do along with Acceptance test. In Table 6.2 it
is intentionally set to be blank.
z Because of the attribute of Hibernate, the test on domain dataAccessDomian and
mapping was designed to do together.
29
No.
1
2
Module(Domain)
WebScope2
dataAccessDomain
3
mapping
4
dataServerDomain
Test plan
TAB
Plan name: add user
Step 1:
Instantiate User class in
dataAccessDomian;
Step 2:
Add a user into database
Expected output:
The input user is in the User table
in database
Plan name: get data tree
and data
Step 1:
Instantiate DataServerFacade
Step 2:
Invoke connect(), open() with
valid parameters
Step 3:
Instantiate a Echo2 tree, invoke
the constructTree of the
instantiated DataServerFacade
with the parameter of the
instantiated Echo2 tree
Expected output:
Data tree is returned
Step 4:
Invoke getPlotData() with a
parameter of simulated node path
Expected output:
Data is returned
5
graphicsDomain
Plan name: get graph
Step 1:
Instantiate GraphicsFacade
Step 2:
Invoke the setGraphData of the
instantiated GraphicsFacade with
the parameter of a simulated
graph data
Step 3:
Invoke the generateImage of the
instantiated GraphicsFacade
Expect output:
Graph is return
Table 6.2 Module test on domains
Test result
TAB
After Step 2:
After checking the database
by using hdb.log (operation
log file) and hdb.script (data
file), it is true that data has
been successfully added into
User table in database
After Step 3:
After checking the tree
model, it is true that the data
tree is returned
After Step 4:
After print out some
information of the return
data (such as getXLabel(),
getMaxX()), it is true that
data is returned.
After Step 4:
Set it to a defined Echo2
ImageMap, the graph is
then. So, it is true the graph
is returned.
30
6.3 Acceptance test
The Acceptance test is for the purpose to check if the software is acceptable to the client,
by verifying the software against the client’s requirements.
In the development of “WebScope2”, I frequently communicated with my client to make
sure I was doing the right thing the client wanted. Moreover, after finishing the
implementation, I checked the functions of the software against the requirements. Table 6.3
shows the click list of software functions against the client’s requirements. It shows that all
requirements have been fulfilled in the software. So it passed the Acceptance test, hence it
is deliverable.
No.
Name
Priority
Completed
R1
Using Echo2
High
Yes
R2
Using Web Browser
High
Yes
R3
Plotting Graph
High
Yes
R4
Data Caching
High
Yes
R5
Data Download
High
Yes
R6
Platform Independence
High
Yes
R7
User authentication
Medium
Yes
R8
Using Hibernate
Medium
Yes
Table 6.3 Checklist of delivered software against the client’s requirements
(For descriptions of requirements, please refer to Table 2.1 Major requirements of
“WebScope2”).
31
7. Evaluation
After the development, it is necessary to evaluate the software product. The “WebScope2”
software will be evaluated in following aspects:
z Requirements achievement
z Functionality comparison with EScope and WebScope
z Performance comparison with EScope and WebScope
7.1 Requirements fulfilment
Evaluating software can not be conducted with checking the requirements fulfilment,
because the quality of software is largely measured by checking if all of the client’s
requirements have been fulfilled in the delivered software. Table 6.3 shows all
requirements of the client have been fulfilled.
7.2 Functionality comparison with EScope and WebScope
Without quantities measurement, the result of an evaluation of software is inconvincible.
Based on my experience of using EScope, WebScope and development WebScope2, eight
factors are taken into functionality comparison. Because some functions are more
important than others, a weight value is assigned on each factor. Note that deciding the
weight value for each factor is based on my experience and understanding. It is more or
less subjective.
Table 7.2 shows factors taken into the functionality comparison and their weights.
Factors
Weight
User authentication
2
Multiple data server concurrently
2
Tree form of viewing data node
2
Multiple graphs & waveforms
2
Interaction
4
Data caching
3
Data download
2
Meta-data Contribution
2
Table 7.2 Functionality comparison factors and their weights
32
Table 7.3 shows whether software has the specific function, 1 if it has, 0 otherwise.
Function
EScope WebScope WebScope2
User authentication
0
1
1
Multiple data server concurrently
1
0
0
Tree form of viewing data node
1
0
1
Multiple graphs & waveforms
1
0
0
Interaction
1
0
0
Data caching
0
1
1
Data download
0
0
1
Meta-data Contribution
0
1
0
Table 7.3 Software capability of specific function
Having Table 7.2 and Table 7.3, we can easily calculate software’s total score. For example:
TOTAL SCOREEscope = 0*2 + 1*2 + 1*2 +1*2 + 0*3 + 0*2 +0*2 = 10
Figure 7.4 shows the functionality comparison between EScope, WebScope and
WebScope2.
Functionality Score
12
10
8
6
4
2
0
EScope
WebScope
WebScope2
Figure 7.4 Functionality Score of EScope, WebScope and WebScope2.
7.3 Performance comparison with EScope and WebScope
It is extremely hard to do performance comparison, because it is difficult to get some data,
such as time consumption for retrieving data from MDSPlus server, and need to much more
work. So, in this section, I will just qualitatively analyze the performance of EScope,
WebScope and WebScope2.
33
z
EScope is fast, comparing to WebScope and WebScope2. Because it is application
running on each user’s computer. Once the data is retrieved from the MDSPlus, any
computation is done on user’s computer. There is no medium level between EScope
and MDSPlus.
z WebScope2 is fast, comparing to WebScope. Because:
First, it is based on Ajax technology, only changed part of web page is sent by
browser and only updated part is sent by web server.
Second, it uses multiple threads to deal with the concurrency of plotting graph and
caching data. While WebScope caches data first, then plots graph to user.
Third, if it is the first time that user uses Java Applet in web browser, it is takes time
to download Java Applet, while WebScope2 does not, as it does not need Java
Applet to plot data graph.
z WebScope can be fast than WebScope2, in terms of non-first-time Java Applet use.
Because if Java Applet is already there, in WebScope computation for plotting graph is
done one user’s computer, whereas in WebScope2 computation for plotting graph is
done on web server .
What is stated above is not from the theoretical analysis. It can not conclude which is faster
and how much faster than the others. However, from my experience of using these three
kinds of software, EScope is the fastest one, while the distinction between WebScope and
WebScope2 is vague.
The high performance and functionality of EScope seems to imply WebScope and
WebScope2 do not need to exist. However, WebScope and WebScope2 do have their
reason to exist, for only one simple reason: ease of acquisition. Browser-based are so
pervasive nowadays. This is also the sense of developing WebScope and WebScope2.
34
8. Future work
1. Integrating with Le Ma’s project which enables Meta-data contribution dynamically.
2. Privilege management. In WebScope2, only user authentication function is realized.
More advanced privilege management needs to apply to the system, if it is an important
part in the future product.
2. Extending the functionality of WebScope2. There is a big distance between
WebScope2 and EScope, in terms of functionality. The further development of
WebScope2 should add more functions, such as multiple graphs, waveform comparison.
3. Enabling interaction between user and graph. It is crucial to make the WebScope2
interactive. To achieve this, a new technology other than Echo2 might need to be
chosen. Since in Echo2, any computation is done by web server. The interaction on
browser side is very limited. For example, if we realize the function of drawing crosshair, which is already existing function in EScope, the movement of cross-hair will
cause an event and the event will be sent to the web server, after computation the web
server returns the browser what position the updated cross-hair should be draw in. It is
obviously unacceptable, since any refresh on browser can take more than one second, if
it continually communicates with web server.
So, our issue is how can run software with functionality of EScope within the web
browser. To do this, we need to have rich-client/smart-client web application which
enables computation on browser side can be done. Java Applet can be an option, but it
is such an outdated technology and I believe in next few years it will completed given
up by the industry.
1: XML-Supported Flash can be a good idea. Flash is used broadly and well supported
by almost all kinds of web browser.
2: Google Web Tool is also a realistic solution. GWT's defining attribute is the Java-toJavaScript compiler. This compiler allows you to develop the web interface to your
application in Java, then compile it to JavaScript. GWT limits the developer to a subset
of the Java 1.4 libraries. GWT applications can be served by any web server, such as
Apache, without the need for server-side processing.
However, before deciding who technology to be chosen, we need to really analysis the
requirements and the characteristics of the optional technologies.
35
9. Conclusion
In the development of WebScope2, various technologies are learned and used in the project.
Through the successful implementation of the project, requirements of the client are mostly
met.
The whole project is developed with agile method, in which different activities intersects
with each other. Requirements analysis and modeling have been done in the whole project
period. Communicating with client never stopped. It is always a good idea to talk with
client to elicit requirement so that the software development is kept one the right track.
36
10. REFERENCES
10.1 Web references
1.
2.
3.
4.
5.
6.
7.
http://www.mdsplus.org/
http://www.nextapp.com/
http://www.hibernate.org/
http://www.eclipse.org/
http://java.sun.com/
http://www.sourceforge.org/
http://www.apache.org
10.2 Book references
1. “Hibernate in Action” by Christian Bauer and Gavin King. Published by
Manning Publications. Co
2. “Core java 2, Volume 1” by Cay S, Gary Cornell. Published by Sun
Microsystems
3. “Core java 2, Volume 2” by Cay S, Gary Cornell. Published by Sun
Microsystems
4. “Design Patterns for e-Science” by Henry J. Gardner and Gabriele manduchi,
COMP6444 Teaching brick
5. “Executable UML—a founcation for model-driven architecture” by Stephen J.
Mellor and Marc J. Balcer. Published by Addison-Wesley
6. “Development of Web Scope” by Ajith M. Jose, the final report for the
COMP6703 eScience Project
37
APPENDIXES
APPENDIX A How does Hibernate work?
(Cited from “Development of Web Scope” final report for the COMP6703 eScience Project,
by Ajith M. Jost)
Hibernate can dynamically create the database tables based on the persistent classes and the
information provided in the “Mapping.hbm.xml” file.
The following class “Message.java” is an example of a java persistent class:
The two fields “id” and “text” are the fields of the persistent class going to be converted to
the fields of the database table. The get and set methods of the persistent class are used to
pass values to the fields of the database table.
The fields of the java persistent class are specified in an xml mapping file. Hibernate
dynamically creates the database tables based on the information provided in the xml
38
mapping file. An example of a mapping file corresponding to the persistent class
“Message.java” is given below.
Hibernate converts the two fields “id” and “text” of the Message class to the corresponding
fields “MESSAGE_ID” and “MESSAGE_TEXT” of the table “MESSAGES”. The
following figure shows “MESSAGES” table:
The following bit of Java code shows how a value is stored to the database table,
MESSAGES.
39
Various steps involved in the storage of data to the table, MESSAGES is explained below:
•
The first line of code creates a new session of the Hibernate.
•
An object of the Message class is created and a value (“Ajith M Jose”) is passed to
the set method of the Message class.
•
The object created (“message”) is stored to the database by using the save method
associated with the session object of the Hibernate package.
The MESSAGES table after the data storage operation is completed is shown below.
40
APPENDIX B Installation and compilation guide
A) Prerequisites:
The “WebScope2” application requires the JRE and Tom Cat running on the target
machine prior to its installation. The various steps involved in the installation of Tomcat
and JRE are explained below as on the web site of Tomcat:
I) Requires JRE 5.0 or later versions
•
Download the Java 2 Standard Edition Runtime Environment (JRE), release version
5.0 or later, from http://java.sun.com/j2se.
•
Install the JRE according to the instructions included with the release.
•
Set an environment variable named JAVA_HOME to the pathname of the directory
into which the JRE is installed, e.g. c:\j2sdk5.0 (Windows) or
/usr/local/java/j2sdk5.0 (Unix).
II) Requires the TomCat5.0 or Later
•
Download the Tomcat version 5.0 or later from
http://jakarta.apache.org/site/downloads/.
•
Unzip the tomcat to the required location (e.g.: unzip jakarta-tomcat-5.zip), so that
the distribution resides in its own directory (conventionally named "jakarta-tomcat5"). For the purposes of the remainder of this document, the symbolic name
"$CATALINA_HOME" is used to refer to the full pathname of the release
directory.
To run the Tomcat:
ƒ Tomcat can be started by executing the following commands:
$CATALINA_HOME\bin\startup.bat
$CATALINA_HOME/bin/startup.sh
ƒ
(Windows)
(UNIX)
After startup, the default web applications included with Tomcat will
be available by visiting: http://localhost:8080/
To Shut Down the Tomcat:
Tomcat can be shut down by executing the following command:
41
ƒ
$CATALINA_HOME\bin\shutdown
$CATALINA_HOME/bin/shutdown.sh
(Windows)
(Unix)
B) Installation of WebScope2:
The following table shows different files in the delivered product file
“WebScope2_all_in_one.zip” which is used to install “WebScope2” or compile the source
code:
File Name
“WebScope2.war”
“WebScope2_src.rar”
“apache-ant-1.6.5-bin.zip”
Description
Installation file of WebScope2
Source code
Ant installation which is used
to compile and deploy
“WebScope2_src”
A. How to run “WebScope2”:
1. Extract ZIP file
Extract “WebScope2_all_in_one.zip”
2. Place “WebScope2.war” into Tomcat
Move the file “WebScope2.war” into the “Webapps” folder in Tomcat root
directory ($CATALINA_HOME/webapps/ or $CATALINA_HOME\webapps\)
3. Run the database (HSQLDB)
By default, the HSQLDB is placed in WebScope/WEB-INF/lib/
So, to run the database, type commands as below:
Command:
(Windows)
java –Xmx256m –cp $CATALINA_HOME\webapps\WebScope2\WEB-INF\lib
hsqldb.jar org.hsqldb.Server -database.0 hdb -dbname.0 hdb
(UNIX)
java –Xmx256m –cp $CATALINA_HOME/webapps/WebScope2/WEB-INF/lib
hsqldb.jar org.hsqldb.Server -database.0 hdb -dbname.0 hdb
Then, “WebScope2” can be accessed through web browser.
42
B. How to compile “WebScope2” source files:
1. Extract ZIP file
Extract WebScope2_all_in_one.zip if you have not.
2. Install Ant
2.1 Extract “apache-ant-1.6.5-bin.zip”
2.2 Install Ant
2.3 Set Environment variables for Ant, java.
Command:
(Windows)
set ANT_HOME=(path you want to put)
set JAVA_HOME=(your java path)
set PATH=%PATH%;(YOU ANT PATH)\bin
For example:
set ANT_HOME=c:\ant
set JAVA_HOME=c:\java\jdk1.5.0_01
set PATH=%PATH%;c:\ant\bin
(UNIX)
export ANT_HOME=(path you want to put)
export JAVA_HOME=(your java path)
export PATH=${PATH}:{ANT_HOME}/bin
For example:
export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/local/java/jdk1.5.0_01
export PATH=${PATH}:{ANT_HOME}/bin
For more detaisl of Ant installation, please refer to Apache Ant manual at Apache
web site http://ant.apache.org/manual/ .
3.
Compile WebScope2_src and deploy it.
3.1 Extract WebScope2_src.rar
3.2 Build war file
Command:
z Go into the WebScope2_src folder
z ant
For example:
(Windows)
C:\WebScope2_all_in_one\WebScope2_src
ant
43
(UNIX)
/usr/local/WebScope2_all_in_one/WebScope2_src
ant
For more details about how to use Ant, please refer to Apache Ant manual at
http://ant.apache.org/manual/
Then you should be able to see a folder named war; and inside it is the WebScope2.war file,
do A: How to run “WebScope2” if you want to install it.
44
APPENDIX C Issues faced during the development of WebScope2
For help future students working on the similar project, main issues faced during the
development of “WebScope2” and their solutions are described below:
Issue 1: Understanding of Echo2
The principle of Echo2 has been discussed in section 1.4 in Introduction. However, at the
very beginning of the project, I did understand it well. What it really is, is it a software, or a
new language? These questions take time to answer.
Stated it in a simplest way, Echo2 is actually are jar files which can be import in to java
application. There are many classes included in those jar files. With the help of those
classes, program can be compiled into so called Echo2 web applications.
Issue 2: Understanding of Echopointng
Echopointng, meaning next generation of echo, is the extension of Echo2. It is also a jar
file with many classes in it. It has many useful functions such as tree, rich text; however, as
date of now, it is still very immature. However, in the development of WebScope2, it is
impossible to deliver a satisfactory product without using Echopointng. Hope bugs in
Echopointng will be solved soon.
Issue 3: Understanding of Hibernate
This issue is similar as Issue1, no matter how fascinating the Hibernate is described. It is
actually a jar file, same as Echo2.
Issue 4: Operating HSQLDB with Hibernate
Since in WebScope2 Hibernate is used to be the mapping solution, there is no direct
operation on HSQLDB. Once you open HSQLDB (Refer to Appendix B), all work is done
by Hibernate.
However, there is one thing need to be particularly aware. HSQLDB has kinds of modes of
operating the database. They are: “create”, “create-drop” and “update”. My advice is
always use “update” value, because other two values will delete when a web server or
database restart happens. In WebScope, “create” value is used, this brings problem. When
Tomcat (web server) is restarted, data storing in HSQLDB will be lost. This is usually what
45
we want. In WebScope, “update” value is used instead of “create” and the problem is
solved.
Issue 5: Download Eclipse with Web Tools Platform
Eclipse is free software that can be downloaded from internet. It is an IDE that perfectly
with Java. It does not need to be installed. Download and extract the zip file, than use it.
Moreover, its ability to extension is strong. For specific use, a plug-in is added into Eclipse.
For example, if we want use Eclipse to develop web application, we just need add WTP
(Web Tools Platform) to Eclipse. It makes you work much more efficient to use Eclipse, at
least it did in my project.
However, because it is free and open-source software, every one can further develop it. So
plug-ins people developed is badly named. There is no standard which confines people to
name plug-ins. It is confusing sometimes. Also, plug-ins are not independent. Sometime,
getting plug-ins correctly working with each other is hard, some anticipated and tedious
problems would happen, such as version conflict or file name is too long and invalid, even
you follow the right guide of integrating them. Use of some might relay on the existence of
others. For developing software like WebScope2, I suggest to download “wtp-all-in-onesdk”. It includes all plug-ins, as well as Eclipse itself, to develop web application. It has
version for working on Windows and Linux. (Address: http://www.eclipse.org/webtools/)
Issue 5: Dealing with the immaturity of Echopointng
As I discussed in Issue2, Echopointng is a jar file full of java classes. There are some bugs
I discovered or I considered as bugs.
z Tree
Similar as tree in java swing, echopointng has a class called Tree. Model of tree can
TreeModel. Theoretically, transplanting tree from java swing to echopintng is very
easy, all need to be done is update the class to make it inherit echopointng tree instead
of java swing tree. However, when I transplanted tree from Escope to WebScope2,
some anticipated problem happens. The number of nodes and their hierarchy is right,
while the display is wrong. The root node is in the right place, while other nodes are on
the other end of the screen and no display of nodes’ names. (As shown in Figure Ad.
Issue5) I spent almost 10 days to find out where the problem was, however, I could not.
Finally, I solved, actually avoided the problem in the following way. 1. Retrieve the
data and generate the tree(name: tree), but not display it. 2 Instantiate another tree
(name: treex), and copy names all tree node in tree to treex, since what matters is only
names of the tree, which is used to identify and retrieve node data. For more details
please refer to PlotDataScreen.java in WebScope2 package.
46
z
Attributes setting
In echopointng, many components (classes, such as Tree, Table) which work with
Model (TreeModel, TableModel) have a common problem. If you want to set an
attribute of the model, it has to be prior to add the model to the component. Otherwise,
the attribute has not affect on the component.
For example,
A. TreeSelectionModel selectionModel = new DefaultTreeSelectionModel();
B.selectionModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELEC
TION);
C: tree.setSelectionModel(selectionModel);
Sentence B has to be written before sentence C, otherwise, the SINGLE_TREESELECTION mode will not work.
Figure Ad.Issue5 Graph of the wrong display of tree in echopointng.
This is actually can be easily solved in echopointng source code, a simple function like
refresh on components after setting model to them.
47
This issue is not expected to be understood unless you really code with these componenets
in echopointng.
Issue 6: Dealing with Tomcat buffering
When the classes are recompiled and deployed into Tomcat, because of buffering function
of Tomcat, the new classes will not work until the buffering period passed. This is not
always what we want.
To deal with this problem, every time before we deploy the new application, we need to
delete a folder to block buffering. The folder is:
$CATALINA_HOME\work\Catalina\localhost\YOURAPPLICATION (Windows)
$CATALINA_HOME/work/Catalina/localhost/YOURAPPLICATION (UNIX)
For example, in my instance, the folder I deleted is:
$CATALINA_HOME\work\Catalina\localhost\WebScope2
Issues listed above are major issues I faced that cost me very long time to solve. There
were some other trivial issues are excluded here.
Issue might also be useful for further project development
The following issues are cited by “Development of Web Scope” by Ajith M. Jose.
They might be useful in future project like “WebScope” and “WebScope2”.
Issue 1
1) To do software installations I didn't have the required administrator privileges on the
Linux machine provided. So I had to contact the system administrator for installing and
configuring the required software.
Administrator had installed the tomcat in the root directory of Linux. When I tried to run
the tomcat it was giving me an error as described below.
Command
[u4083453@esci15 ~]$ $TOMCAT/bin/startup.sh
The “TOMCAT” in the above command refers to the tomcat directory.
Error message
Using CATALINA_BASE: /usr/local/jakarta-tomcat-5
Using CATALINA_HOME: /usr/local/jakarta-tomcat-5
Using CATALINA_TMPDIR: /usr/local/jakarta-tomcat-5/temp
48
Using JRE_HOME:
/usr/java/jdk1.5
touch: cannot touch `/usr/local/jakarta-tomcat-5/logs/catalina.out':
Read-only file system
[u4083453@esci15 ~]$ /usr/local/jakarta-tomcat-5/bin/catalina.sh: line
247: /usr /local/jakarta-tomcat-5/logs/catalina.out: Read-only file system
When
The above error message was obtained when trying to run the Tom Cat server.
Solution
This error was occurring since the tomcat was trying to write to the log file to which I had
only reader access. The problem was solved when I copied the whole tomcat
folder"jakarta-tomcat-5" from the root directory “/usr/local/” to my home directory
"/home/users/u4083453/" as I have administrator privilege to my home directory.
Issue 2
2) Had a real tough time with the setting of the class paths for compiling the servlets that I
wrote. Though I spent considerable amount of time in reading the documentations provided
with the tomcat and online references it didn't give me a clear idea about what exactly I
should do. My client Raju Karia and supervisor Henry helped me in configuring the
settings for compiling the servlets in Linux and deploying the compiled files.
I am describing the steps taken by my client, Raju Karia in configuring the Tomcat in the
section given below.
Solution
a) Made a directory called “jsrc” and associated child directories "src" and "lib" in the
home directory.
([u4083453@esci15 ~]$ mkdir jsrc)
+jsrc
-src
-lib
b) Made a directory called "WEB-INF" and associated child directories "classes" and "lib"
in the home directory
+WEB-INF
-classes
-lib
c) Copied the "web.xml" file from the tomcat folder "/jakarta-tomcat5/webapps/servlets-examples/WEB-INF" and pasted in the "WEB-INF" directory in the
home directory. And changed the "web.xml" to as given below
49
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name> firstServlet </servlet-name>
<servlet-class> firstServlet </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> firstServlet </servlet-name>
<url-pattern>/ firstServlet </url-pattern>
</servlet-mapping>
</web-app>
d) The servlet classes written by me were copied to the folder “src” of "~/jsrc/src" and
were compiled by giving the following command.
[u4083453@esci15 ~/jsrc]$ javac -d /home/users/u4083453/WEB-INF/classes/ -classpath
/home/users/u4083453/jakarta-tomcat-5/common/lib/servletapi.jar:/home/users/u4083453/hibernate-3.0/hibernate3.jar/:. src/ firstServlet.java
e) Make a war file
[u4083453@esci15 ~]$ jar cvMf firstServlet.war WEB-INF/
f) Move the war file to the " ~/jakarta-tomcat-5/webapps/"
[u4083453@esci15 ~]$ mv firstServlet.war ~/jakarta-tomcat-5/webapps/
g) Now its time to run the Tomcat server
[u4083453@esci15 ~]$cd ~/jakarta-tomcat-5/bin/
[u4083453@esci15 ~/bin]$./startup.sh
h) Open any browser and type the URL "http://localhost:8080/firstServlet/firstServlet" to
display the servlet
Issue 3
3) The “Web Scope” application uses the Java Applets to display the datasets obtained
from the MDSPlus server. The web browsers didn’t show the applet graph part of the web
page. I was getting a message saying that the applet loading failed.
50
Solution
The web browser (Debian and FireFox) in the Linux machine doesn't have right plug-in
for displaying the Java applets. So it was impossible to run the applets on that machine.
When the right plug-in for displaying the java applets was provided, it started working.
Issue 4
4) The Hibernate package installed by the system administrator was corrupted due to
reasons .So I downloaded the hibernate3.0 from "wwww.hibernate.org", the official
website of hibernate.
The downloaded hibernate package was (unzipped) installed to my Linux home directory
“\home\users\u4083453\hibernate-3.0\”. Due to some reasons the size of many jar files in
the unzipped hibernate directory were "0 bytes”.
Solution
It was mainly because of lack of enough free space in the home directory. This issue
was solved by moving the unwanted files in the home directory to a mass storage
device, thus providing more free space for the hibernate package.
51