projet fin d’etude : i-way...
TRANSCRIPT
![Page 1: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/1.jpg)
DISSERTATION Presented at
National School of Engineers of Sfax
(Department of Computer Science and Applied Mathematics)
In order to obtain
the National Diploma in Engineering in Computer
by
Fatma REKIK
Study, conception and development of
module of errors, exceptions and logging
management for J2EE and Symfony2
applications
Defended on the 20th of June 2013 in front of a jury:
Mme Fadoua DRIRA President
Mme Salma MASMOUDI Reviewer
Mme Mouna TORJMEN Supervisor
Mr Mohamed GUERMAZI Visitor
Républic of Tunisia
Training Cycle Engineering in the
discipline
Computer Engineering
Final Study Project
N° d’ordre: DIMA-074
Ministry of High Education and Scientific
Research
University of Sfax
National School of Engineers of Sfax
![Page 2: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/2.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 2
I dedicate this work
To my dear mother Faiza
To my dear father Hedi
To my little sister Zainab
To my brothers Mohamed And Malek
Almighty Allah preserve you healthy
To my dear friendS
To all those who are dear to me.
As a token of my affection and my
great great love
Fatma Rekik
Dédication
![Page 3: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/3.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 3
Acknowledgement
At the end of this modest work I wish to express my gratitude to
Mohamed Guermazi, office Sfax manager of I-Way Company that gave me the confidence
to propose this subject as a final study project and has not stopped me to provide his
advice and pertinent suggestions.
Mr. Amine Turki general director of I-Way Company that I entrusted this work despite
its confidentiality
The I-Way team is for the hosting of this warmly for the duration of our project
graduation embodying our integration team.
Ms. Mouna Torjmen, assistant professor at the National School of Engineers of Sfax ENIS,
she made me agreeing to frame my final study project
![Page 4: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/4.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 4
Context
GENERAL INTRODUCTION ____________________________________________________________________ 8
BACKGROUND AND SPECIFICATION ____________________________________________________________ 9
INTRODUCTION ____________________________________________________________________________ 10
1. ABOUT THE PROJECT ____________________________________________________________________ 10
2. PRESENTATION OF THE COMPANY ___________________________________________________________ 10
2.1. The company services ___________________________________________________________ 10
2.2. Business areas _________________________________________________________________ 11
3. PRELIMINARY STUDY ____________________________________________________________________ 12
3.1. The Errors, exceptions and logs existing system ______________________________________ 12
3.2. Disadvantages and solutions _____________________________________________________ 13
4. SPECIFICATION ________________________________________________________________________ 14
4.1. Data Flow Diagram _____________________________________________________________ 15
4.2. Actors ________________________________________________________________________ 17
4.3. Description of logging handling ___________________________________________________ 17
4.4. Description of exception handling _________________________________________________ 17
4.5. Description of error handling _____________________________________________________ 18 4.5.1. Display the error message _____________________________________________________________ 18 4.5.2. List of error messages ________________________________________________________________ 18
CONCLUSION ______________________________________________________________________________ 18
CONCEPTION ______________________________________________________________________________ 19
INTRODUCTION ____________________________________________________________________________ 20
1. THE UML METHODOLOGY ________________________________________________________________ 20
2. CONCEPTION PRESENTATION ______________________________________________________________ 21
2.1. Class diagram _________________________________________________________________ 21 2.1.1. General class diagram of the module ____________________________________________________ 21 2.1.2. Data dictionary ______________________________________________________________________ 21 2.1.3. List of associations ___________________________________________________________________ 23
2.2. Sequence diagram ______________________________________________________________ 23 2.2.1. Sequence diagram of « logging handling » ________________________________________________ 23 2.2.2. Sequence diagram of « exception handling » ______________________________________________ 25 2.2.3. Sequence diagram of « errors handling » _________________________________________________ 26
2.3. State Chart diagram ____________________________________________________________ 27
2.4. Activity diagram _______________________________________________________________ 28
CONCLUSION ______________________________________________________________________________ 29
REALIZATION ______________________________________________________________________________ 30
INTRODUCTION ____________________________________________________________________________ 31
1. TOOLS _____________________________________________________________________________ 31
1.1. Development environment _______________________________________________________ 31
1.2. Applications architectures ________________________________________________________ 32
1.3. Frameworks ___________________________________________________________________ 34 1.3.1. Symfony2 __________________________________________________________________________ 34 1.3.2. MAVEN 3 __________________________________________________________________________ 35 1.3.3. Spring Framework ___________________________________________________________________ 36
![Page 5: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/5.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 5
1.4. Development tools _____________________________________________________________ 38
1.5. Using APIs ____________________________________________________________________ 39
2. MODULE REALIZATION __________________________________________________________________ 39
2.1. Logging management ___________________________________________________________ 40
2.2. Exception management _________________________________________________________ 41
2.3. Error management _____________________________________________________________ 45
CONCLUSION ______________________________________________________________________________ 46
GENERAL CONCLUSION______________________________________________________________________ 47
![Page 6: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/6.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 6
Figures:
FIGURE 1: PROJECT MANAGEMENT SERVICE AND FUNCTIONAL TESTS ___________________________________________ 11
FIGURE 2: EXAMPLE OF AN EXCEPTION SCREEN _________________________________________________________ 12
FIGURE 3 : DATA FLOW DIAGRAM OF MODULE _________________________________________________________ 16
FIGURE 4 : CLASS DIAGRAM OF OUR MODULE __________________________________________________________ 21
FIGURE 5 : SEQUENCE DIAGRAM OF « LOGGING HANDLING » ________________________________________________ 24
FIGURE 6: SEQUENCE DIAGRAM OF « EXCEPTION HANDLING » _______________________________________________ 25
FIGURE 7: SEQUENCE DIAGRAM OF «ERRORS HANDLING» __________________________________________________ 26
FIGURE 8: STATE CHART DIAGRAM OF « EXCEPTION HANDLING » _____________________________________________ 27
FIGURE 9: ACTIVITY DIAGRAM OF ACTION « DISPLAY ERRORS MESSAGE » ________________________________________ 28
FIGURE 10: JAVA/J2EE ARCHITECTURE ______________________________________________________________ 33
FIGURE 11: MVC ARCHITECTURE __________________________________________________________________ 34
FIGURE 12: SYMFONY2 FRAMEWORK _______________________________________________________________ 35
FIGURE 13: MAVEN ARCHITECTURE ________________________________________________________________ 36
FIGURE 14 : SPRING ARCHITECTURE _________________________________________________________________ 37
FIGURE 15: LOGS IN THE CONSOLE__________________________________________________________________ 40
FIGURE 16: LOGS IN THE LOG FILE FOR J2EE APPLICATIONS _________________________________________________ 40
FIGURE 17: LOGS IN THE LOG FILE FOR SYMFONY2 APPLICATIONS _____________________________________________ 41
FIGURE 18: EXCEPTION SCREEN WHEN THE USER IS THE FINAL CUSTOMER _______________________________________ 41
FIGURE 19: EXAMPLE OF EXCEPTION.PROPERTIES FILE FOR EXCEPTION OPTIONS FOR JAVA/J2EE APPLICATIONS _____________ 42
FIGURE 20: EXCEPTION SCREEN WHEN THE USER IS THE DEVELOPER ___________________________________________ 43
FIGURE 21: EMAIL OF EXCEPTION DETAILS ____________________________________________________________ 44
FIGURE 22: THE .VM FILE ________________________________________________________________________ 44
FIGURE 23: EXCEPTIONS DETAILS IN THE DATABASE ______________________________________________________ 45
FIGURE 24: LIST OF ERRORS MESSAGE DETAILS _________________________________________________________ 46
FIGURE 25: SEARCH PART _______________________________________________________________________ 46
![Page 7: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/7.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 7
Tables:
TABLE 1: ACTORS LIST __________________________________________________________________________ 17
TABLE 2: DESCRIPTION OF LOGGING HANDLING _________________________________________________________ 17
TABLE 3: DESCRIPTION OF EXCEPTION HANDLING ________________________________________________________ 17
TABLE 4: DESCIPTION OF THE ACTION "DISPLAY THE ERROR MESSAGE"__________________________________________ 18
TABLE 5: DESCRIPTION OF ERROR LIST _______________________________________________________________ 18
TABLE 6: DATA DICTIONARY ______________________________________________________________________ 22
TABLE 7: LIST OF ASSOCIATIONS ___________________________________________________________________ 23
TABLE 8: THE FEATURES AND THE POWERS OF JETTY _____________________________________________________ 32
![Page 8: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/8.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 8
General Introduction
The software tools become necessary in all sectors for facilitating, accelerating work
and improving its quality. Indeed, it is sufficient that the number of parameters, stakeholders
and data exceed a certain limit so as the computerization moves from the optional stage to the
stage needed.
Nowadays, Information Technology (IT) services have an important role in all
companies regardless of their fields and services. These companies want to adopt new ways
of working with new technologies. Because of a high pressure of customer’s need, they want
to progress their internal information system.
In this context, our final study project, conducted in Intelligence Way (I-WAY)
company, consists of studying, conceiving and developing a management and logging module
(API) of errors and exceptions for Symfony2 and JAVA/J2EE applications.
To specify the benefit of this project, we present three chapters in this report. In the
first chapter, we start by presenting the general framework in which we define the subject of
our study internship followed by the presentation of the "I-Way" company, as well as the
review of existing works and the project specification.
In the second chapter, we define an application conception, released by the UML
methodology. Third chapter discusses our work environment and a released application
illustrated by some interfaces. Finally, we conclude this report with same future perspectives
![Page 9: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/9.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 9
Background and
specification
CHAPTER 1
![Page 10: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/10.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 10
Introduction
In this chapter, we will present the I-WAY Company which we did our training. Then,
we describe the existing management of errors, exceptions and logs in this company. We
propose then solutions for each disadvantage of this management. Finally, we end this chapter
by a conclusion.
1. About the project
This project is prepared as a final study project to get a computer engineering degree. It is
proposed by Intelligence Way (I-WAY) company. This project consists of an API errors and
exceptions management for JAVA/J2EE and Symfony2 applications.
2. Presentation of the company
Intelligence Way (I-Way sarl) is a Tunisian Computer Engineering Services’ company
based in Tunis and Sfax. Mostly, it was created by engineers who have multiple experiences
and proven skills.
Since 2005, its specialties are in providing quality, cutting-edge technologies in
customers with large accounts. The majority of its customers are from the offshore market.
Team I-Way is made up of various, young and dynamic skills. It provides to its
customers a group of experienced computer scientist in IT projects of different types (web,
mobile & standalone) using new development technologies (J2EE, PHP, .Net ...).
2.1. The company services
During its experience years, I-Way has developed and validated its tools and work
methods in order that its organizational model meets its customers’ requirements.
Today, it provides to its customers an offer SLM (Service Level Management) based
on the following services (Figure 1):
Governance of IT projects,
![Page 11: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/11.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 11
The project management of Information System (IS): Architecture, Refactoring &
Specific development
The recipe and functional validation: manual & automatic
The non-functional testing: technical audit, integration and test performance
Assistance in setting production IT projects
Confirmation the delegation of senior resources
Figure 1: Project management service and functional tests1
2.2. Business areas
Through its long experiences in the IS implementation and IT consultancy, I-Way
could develop some expertise and form a professional team which is able to manage the IT
development projects in general and, specifically, the IT projects with strong business layer in
the following areas :
Finance Market, Credit and Financing
Insurance and Mutual Health
1 DEV : development; TPS: Third Party Software; AM: Application Management
![Page 12: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/12.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 12
Hotel services
Public administration
Etc.
3. Preliminary study
3.1. The Errors, exceptions and logs existing system
The developer has many problems when he develops the JAVA/J2EE or Symfony2
applications. We classify these problems in 3 classes:
Error management: The errors are mistakes when the user write a wrong data and
are detected by the application. The problem is that the developer writes the error
message in the codes of applications. He can rewrite the same error message in the
different files or the same means of errors message with different words (no
standardization).
Exception management: The exception is a mechanism that is based on a normal
interruption flow of execution of a program and is not pretreated.
Figure 2: Example of an exception screen
During software testing, an exception message is displayed when the developer (or the
final client) does an operation which the program can’t execute or trait. For example,
if the customer clicks an invalid link, the exception message is displayed (Figure 2).
This message is so long and it will disrupt the customer (or the final client).
![Page 13: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/13.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 13
Logs management: Log is event or action that is affected by the application and is
stored in a support (file, database, email, etc.). To better understand the usefulness of
logs, we give an example: The customer make the same operation (save the data) but
he looks that the data doesn’t be saved. So, he calls the responsible (or the developer)
for solving the problem. The responsible doesn’t find the logs of this operation
because they don’t be saved in a support. He searches the cause in the source code
files or in the console and maybe repeats this operation many times for specifying the
place of the cause.
We find many problems in this management. So, we must find solutions. In the next part,
we resume the problems (or the disadvantages) of this management and we will propose our
solutions.
3.2. Disadvantages and solutions
The developer losses his time and his energy when he seeks the cause of exceptions or
bugs.
We propose that the system store the logs in a support like a file, database,
email, etc. With this method, the developer searches the cause of any problem
(or bug) which is made with the customer in the pass. Also, we suggest that an
email is sent to the responsible (or the developer) when an exception is made.
The client disrupts when the exception message is displayed
We propose to make a personal page which has a meaningful message. This
page replaces the default page of exception and is displayed to the customer
(or the developer). We can also display the exception details in this page, it’s
optional.
The error messages are not referenced (coded) and are standardized
We propose to make a database in which we can store the code, the category,
the language and the error message. The error code must be significant. The
error message can classify by category. You can find the same message with
different languages.
![Page 14: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/14.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 14
All of our proposed solutions are compatible with all JAVA/J2EE or Symfony2
applications. So, we will make two modules: One for the JAVA/J2EE applications, called
LEEM4J (Logging Exceptions Errors for JAVA), and the second for the Symfony2
applications, called LEEM4SF (Logging Exceptions Errors for Symfony2). This module is
called an API with JAVA, and it is called Bundle with Symfony2.
In the next, we specify the advantages of our solutions and how our system can help
and simplify the work for the developers.
4. Specification
The aim of our work is to develop a management module for logging exceptions and
errors for J2EE and Symfony2 applications.
Error management: The developer writes the code and the error message. Then, he
chooses the category and the message language. He can also see the list of the error
messages and do a research using many criteria (category, code, language and
message).
During the development, the developer writes only the error message’s code.
When the main application catches an error, the API searches the error message by its
code in the database of the main application. Finally, the error message will be
displayed.
Exception management: when the exception of the main project will be triggered, the
system catches it and replaces it by another significant message. In the same time, the
system stores the exception message in the database of the main application and sends
an email to the administrator.
Logs management: during the execution of the application, the system saves
automatically and periodically the logs of the J2EE (or Symfony2) application in the
log files. If the user has a problem, he calls the administrator. This latter access the log
files, read the different processes that were executed and specifies the place and the
cause of the problem.
![Page 15: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/15.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 15
4.1. Data Flow Diagram
A data flow diagram (DFD) is a graphical representation of the information system. It
defines the exchanged data between the external actors and our module or into our internal
processes of our module.
![Page 16: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/16.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 16
Figure 3 : Data Flow Diagram of module
![Page 17: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/17.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 17
4.2. Actors
Actors Description
Developer He integrates and uses our module in the JAVA/J2EE or Symfony2
application
JAVA/J2EE or
Symfony2 applications
They are programs in which the developer integrates his module and are
used by the final client.
Table 1: Actors list
4.3. Description of logging handling
Title Actions
precondition The customer uses the JAVA/J2EE or Symfony2 application
scenarios 1. The customer makes an operation
2. The API saves the processes of this operation in the log files
post condition The costumer continues the operations
exceptions No exceptions found
Table 2: Description of logging handling
4.4. Description of exception handling
Title Actions
Precondition The customer makes an operation
Scenarios 1. The API catches the exception
2. The API saves the exception’s information in the database : date of
exception, the message of exception, the stack trace of exception
3. The API sends the exception’s information to the administrator :
date of exception, the message of exception, the stack trace of
exception, the name of project
4. A specified page is displayed in the screen
post condition The costumer comes back the previous page
Exceptions No exceptions found
Table 3: Description of exception handling
![Page 18: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/18.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 18
4.5. Description of error handling
4.5.1. Display the error message
Title Actions
Precondition The customer writes the data
Scenarios 1. The application verifies the data :
a. If the data is right
i. The application saves the data
ii. The customer goes to the next page
b. If the data is wrong
i. The application sends to the API the message code
and the language.
ii. The API searches the error message with the message
code and the language.
iii. The API sends the error message to the application
iv. The application displays the error message under the
text field
post condition The costumer corrects mistakes
Exceptions No exceptions found
Table 4: Desciption of the action "display the error message"
4.5.2. List of error messages
Title Actions
Precondition
Scenarios 1. The developer accesses the list of error messages
2. The developer writes the key word and choose the criteria : code,
category, language or error message
3. The API searches the key word in the database
4. The API displays a result in the table
post condition
Exceptions No exceptions found
Table 5: Description of error list
Conclusion
In this chapter, we present our company and the problem that the developer meets in
his work. We propose many solutions and explain how they make easy the developer’s work.
In the next chapter, we design our module and we use the UML methodology.
![Page 19: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/19.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 19
Conception
CHAPTER 2
![Page 20: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/20.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 20
Introduction
In this chapter, we will first define our design methodology. Then, we will present the
different design diagrams. Finally, we will conclude.
1. The UML methodology
The Object Management Group2’3 (OMG) specification states: “The Unified Modeling
Language (UML) is a graphical language for visualizing, specifying, constructing, and
documenting the artifacts of a software-intensive system…". This is a simple definition of
UML.
UML describes our system graphically and make to understand easy our system and how
it works. This methodology specifies the internal parts of our system and the external parts
which exchange the information with them.
For making easy this graphical language, we choose Power AMC 11 as a
collaborative enterprise modeling tool. Power AMC is produced by Sybase. It is the data
modeling software and metadata management solution for data architecture and information
architecture. It contains all models of UML and Merise diagrams and facilitates the code’s
generation (JAVA, C#, etc.)
Now, we are finishing the definition of our methodology. Then, we pass to present our
conception and we use the UML diagrams.
2 http://www.omg.org/gettingstarted/gettingstartedindex.htm
3 http://www.sparxsystems.com/uml-tutorial.html
![Page 21: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/21.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 21
2. Conception presentation
2.1. Class diagram
The class diagram expresses the static structure of the system. It presents the entities of the
application as classes, their properties as attributes and the relationships between them.
We apply this definition in the next part. We define our entities and their properties.
2.1.1. General class diagram of the module
Figure 4 defines the class diagram of our module.
0..*
1..1
1..1
0..*
1..1
0..*
category
-
-
-
id_category
category_label
category_state
: int
: String
: String
error
- error_code : String
language
-
-
-
language_code
language_label
language_state
: String
: String
: String
error_language
-
-
error_message
error_message_state
: String
: String
exception_logs
-
-
-
-
-
id_exception
exception_date
exception_message
exception_stackTrace
exception_state
: int
: Date
: String
: String
: int
log
-
-
-
-
-
-
id_log
date_heure_log
classe_log
ligne_classe_log
niveau_gravité_log
message_log
: int
: Date
: String
: int
: String
: String
Figure 4 : Class diagram of our module
2.1.2. Data dictionary
At this section, we explain the entities’ properties as data dictionary.
![Page 22: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/22.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 22
Alphabet Classes N° symbolic name Property’s designation
C Category 1 ID_CATEGORY Category’s identification
2 CATEGORY_LABEL Category’s name
3 CATEGORY_STATE Category’s status (able / disable)
E Error 4 ERROR_CODE Error message’s code
Error_language 13 ERROR_MESSAGE The text of the error message
14 ERROR_MESSAGE_STATE Error message’s status(able / disable)
Exception_logs 5 ID_EXCEPTION Exception’s identification
6 EXCEPTION_ DATE The date when the exception was
triggered
7 EXCEPTION _MESSAGE Exception’s type
8 EXCEPTION _STACKTRACE It contains the classes’ name, the
methods’ name and the line
9 EXCEPTION_STATE It indicates the exception’s status when
the developer solve it
L Language 10 LANGUAGE_CODE Language’s code
11 LANGUAGE_LABEL Language’s name
12 LANGUAGE_STATE Language’s status Category’s status
(able / disable)
Table 6: Data dictionary
![Page 23: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/23.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 23
2.1.3. List of associations
The list of association defines the relationships between the entities (or classes)
From class A To class B Type of
association
Description
Category Error 0,* A category is for zero or many error
message
Error Category 1,1 The error message has only one category
Error Error_language 0,* We have an error code for the same error
message with different languages.
Error_language Error 1,1 We can find that the error message with
different languages have the same error
code
Error_language Language 1,1 The error message is written with specific
language
Language Error_language 0,* We can write zero or many error messages
by a language
Table 7: List of associations
2.2. Sequence diagram
The sequence diagram provides the interactions between the system actors. It presents
the exchanged messages, which are based on a time sequence.
2.2.1. Sequence diagram of « logging handling »
Figure 5 presents the processes of logging handling. The customer (or the final client)
is an external actor of our system. He uses the JAVA/J2EE or Symfony2 applications.
![Page 24: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/24.jpg)
[Study, conception and development of module of errors, exceptions and
logging management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 24
execute an operation
send output execute
write_operation_in_file()
fi le is written
Customer
J2EE or Symfony2 application API (or Bundle)
execute an operation
send output execute
write_operation_in_file()
fi le is written
Figure 5 : Sequence diagram of « logging handling »
![Page 25: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/25.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 25
2.2.2. Sequence diagram of « exception handling »
Figure 6 describes the exchanged messages when an unhandled exception is made.
The responsible (or the developer) is the personal who develops the JAVA/J2EE applications
or its part.
send details exception(exception)
details of exception shown in the personal page
OPT exception in the mail
OPT exception in the database
OPT exception in the personal displayed page
make an unhandler exception
send info exception(exception)
save details of exception(exception)
details of exception saved
personal displayed page
Customer
J2EE or Symfony2 application API (or Bundle)
Responsible
send details exception(exception)
details of exception shown in the personal page
make an unhandler exception
send info exception(exception)
save details of exception(exception)
details of exception saved
personal displayed page
Figure 6: Sequence diagram of « exception handling »
![Page 26: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/26.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 26
2.2.3. Sequence diagram of « errors handling »
Figure 7 explains the utility of the errors handling. It gives the general ideas how the
error messages are displayed from the database of the module.
save_data(data)
search_error_message(code_error_message
error messageinfo
error message shown
write the data
search_error_message(code_error_message,language)
want l ist of error messsages
list error message()
list of error messages displayed
search error messages
search error message(key word)
error message searched
ALT data is wrong
data saved with success
data is rightALT
verify_data()
Customer
J2EE or Symfony2 application API (or Bundle)
Developer
save_data(data)
search_error_message(code_error_message
error messageinfo
error message shown
write the data
search_error_message(code_error_message,language)
want l ist of error messsages
list error message()
list of error messages displayed
search error messages
search error message(key word)
error message searched
data saved with success
verify_data()
Figure 7: Sequence diagram of «errors handling»
![Page 27: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/27.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 27
2.3. State Chart diagram
State chart is a diagram which presents the states for object in a system. It explains the
different states of this object from its created to its death (or its achievement) when the system
is executed.
Figure 8 clarify the different states of exception when actions are executed.
<<do an operation>>
<<display>><<send>>
<<save>>
making an unhandler exception
saving the exception sending the exception displaying the exception
Figure 8: State Chart diagram of « exception handling »
![Page 28: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/28.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 28
2.4. Activity diagram
Activity diagram presents the actors or the system and the actions of an activity. It
explains that each actor or system has its actions and its relationships with others to clear
more the idea of this activity.
Figure 9 details the actions exchanged between different actors.
Customer JAVA/J2EE or Symfony2 application API (or Bundle)
[Data is right] [Data is wrong]
Write the data
Verify the data
OR
Save data
Display the next page
Continue the work
Search the error message
Find the error message
Display the error message
Correct the errors
Figure 9: Activity diagram of action « Display errors message »
![Page 29: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/29.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 29
Conclusion
We design the module which we will realize. We use UML as the methodology. In the
chapter 3, we will give the interfaces and the files of the module and we will present the tools
that we use.
![Page 30: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/30.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 30
Realization
CHAPTER 3
![Page 31: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/31.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 31
Introduction
This chapter is divided into two main parts: The first part describes the tools which
allow to facilitate our works, and the second part presents the interfaces and the files of our
module. The tools part contains development environment, applications architectures,
frameworks, development tools, logging API
1. Tools
1.1. Development environment
Eclipse: Eclipse is multi-language Integrated Development Environment IDE
comprising an extensible plug-ins system. Its aim is for the developers to facilitate
their works. With it, they can integrate easily many plug-in by Eclipse Marketplace
like MAVEN, Velocity, Spring, etc.
NetBeans: NetBeans plateform is an IDE developed by Sun. It’s oriented mostly to
JAVA, PHP, C/C++ and HTML5 developers. The user can integrate easily the
Symfony2 framework and the plug-in Twig.
JETTY Server: Jetty4 is a pure Java-based HTTP server and Java Servlet container. It
is developed as a free and open source project and as a part of the Eclipse Foundation.
The web server is used in its products such as Alfresco, Apache Maven, Google App
Engine, Eclipse, etc.
Jetty has a philosophy “Don't deploy your application in Jetty; deploy Jetty in your
application”. It means that putting an HTTP module into the application, rather than putting
your application into an HTTP server.
Table 8 aboves explains the features and the powers of JETTY:
Features Powers
Full-featured and standards-based
Open source and commercially
usable
Large clusters, such as the Yahoo Hadoop
Cluster
Cloud computing, such as theGoogle
4 http://en.wikipedia.org/wiki/Jetty_(web_server)
![Page 32: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/32.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 32
Flexible and extensible
Small footprint
Embeddable
Asynchronous
Enterprise scalable
Dual licensed under Apache and
Eclipse
AppEngine
SaaS, such as Yahoo! Zimbra
Application Servers, such as Apache
Geronimo
Frameworks, such as GWT
Tools, such as the Eclipse IDE
Devices, such as phones
More...
Table 8: The features and the powers of JETTY
XAMPP: XAMPP(X Apache MySQL Perl PHP) is a free and open source server. It’s
quick and easy to install in the computer. It contains phpMyAdmin where the
application stores its data and the developer can access to it, it executes the Symfony2
applications, etc.
1.2. Applications architectures
JAVA/J2EE architecture
The J2EE platform uses a distributed multi-part application model for enterprise
applications. J2EE application is divided into several components. Every component has a
specific function. Figure 10 shows the J2EE application parts.
J2EE applications are considered generally to be three-part applications because they
are distributed over three locations: client machines (Struts2), the J2EE server machine
(Spring IoC/DI), and the database (MySQL).
![Page 33: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/33.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 33
Figure 10: JAVA/J2EE architecture
MVC architecture:
MVC5 or Model View Controller architecture (Figure 11) divides display functionality
and maintains data to reduce the degree of coupling between components.
5 http://www.java-forums.org/blogs/j2ee/689-explain-mvc-architecture-relating-j2ee.html
![Page 34: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/34.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 34
Figure 11: MVC architecture6
Model: It presents the state and core business logic. Data present in database is
mapped by the model and holds the core business logic.
View: It renders model’s contents. Data is accessed by a view from the model and
display logic is added for presentation of the data.
Controller: It performs the functions between a view and a model.
1.3. Frameworks
1.3.1. Symfony2
Symfony27 (Figure 12) is PHP framework with MVC model. It simplifies the
development of the Intranet-Internet websites.
6 http://www2002.org/CDROM/alternate/478/
7 http://symfony.com/doc/2.0/quick_tour/the_architecture.html
![Page 35: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/35.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 35
Figure 12: Symfony2 framework
o App: the application configuration
o Src: the PHP code of project
o Vendor: the bundles of the projects
o Web: the web root directory, images, CSS files, the views pages, etc.
o Composer.json: the links of the bundle which are used in the Symfony2 application
o Composer.lock: information about the packages which are used in the Symfony2
application
1.3.2. MAVEN 3
Maven (Figure 13) is a project management tool which encompasses a project object
model, a set of standards, a project lifecycle, a dependency management system, and logic for
executing plug-in aims at defined phases in a lifecycle.
![Page 36: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/36.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 36
Figure 13: MAVEN architecture
o src/main/java: the java code files of the project
o src/main/resources: other sources files such as jbdc.properties, struts.xml, etc.
o src/main/webapp : project’s webapp
o src/test/java: unit tests
o src/test/resources: Resources for unit tests, which will not be deployed
o Maven Dependencies : contents the jar files (or the libraries) that we use especially in
our maven project
o Target: result files, binaries (code and tests), packages and generated test results
o pom.xml: Relations between different projects and subprojects are based on a single
source of information pom.xml file (Project Object Model). One POM points to
another POMs which can have flat or hierarchical structure.
1.3.3. Spring Framework
Spring8 is a lightweight and open source application framework covering all tiers of
your typical business J2EE application. It simplifies the development effort. The most import
goal of Spring is to address the complexity of enterprise application development. The
developer can integrate other frameworks in Spring as Struts2, Alfresco, etc.
8 http://www.developersbook.com/spring/spring-tutorials/spring-tutorials.php
![Page 37: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/37.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 37
Spring Framework (Figure 14) has seven modules: Spring Core, Spring MVC,
Spring Web, Spring Context, Spring ORM, Spring DAO, Spring AOP.
Figure 14 : Spring architecture
We use Spring Core, Spring Context, Spring DAO, Spring ORM in our API.
Spring Core: The core container provides the fundamental functionality of the Spring
Framework. It uses the Factory Pattern and it has BeanFactory as an implementation
of this pattern. This Bean applies IoC/DI (Inversion of Control / Dependecy Injection)
Pattern to separate an application's configuration and dependency specification from
the actual application code.
Spring Context: It’s presented by a file (applicationContext.xml) that contents the
different information and services about the application.
Spring DAO: The DAO (Data Access Object) support in Spring is primarily for
standardizing the data access work using the technologies like JDBC, Hibernate or
JDO.
Spring ORM: The ORM package is related to the database access. It’s presented
by the popular object-relational mapping APIs such as Hibernate.
![Page 38: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/38.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 38
1.4. Development tools
MySQL: MySQL9’10
is an open source and relational database management system. It
uses a query language (SQL) for adding, removing and modifying the data of
application. We need MySQL in our module for storing the details of error message
and the details of exceptions.
XML: XML11
(eXtensible Markup Language) is a specification developed by W3C
(World Wide Web Consortium). XML is actually a simpler and easier-to-use subset
of the Standard Generalized Markup Language (SGML), the standard for how to
create a document structure. The main XML file is applicationContext.xml in the
JAVA/J2EEE applications: It is used for the configuration of the application.
HTML: HTML12
(HyperText Markup Language) is a language used to create a
static or dynamic web page. It has a layout and tags. The developer can integrate with
other codes like CSS13
(Cascading Style Sheets), JAVA codes for JSP pages in the
JAVA/J2EE applications and PHP codes for PHP pages in the Symfony2 applications.
YAML: YAML14
(YAML Ain't Markup Language) is a data serialization standard for
programming languages PHP. YAML is a great format for your configuration files. It
is used in the Symfony2 applications. In the configuration part, we configure the
MONOLOG logging in the YAML file. The extension of YAML file is .yml.
JAVA: JAVA15
technology is both an object-oriented programming language and a
platform developed by Sun Microsystems.
The source code is written in the .java files. These files are in the business layer with
other files like .properties files16
, .vm files, .xml files, etc.
The presentation layer contains the .jsp files, images, CSS files, .html file, etc.
The JAVA/J2EE application can connect to different database like MySQL, Oracle,
Access, etc.
9 http://www.techterms.com/definition/mysql
10 http://www.mysql.fr
11 http://searchsoa.techtarget.com/definition/XML
12h ttp://www.webopedia.com/TERM/H/HTML.html
13 http://www.techterms.com/definition/css
14 http://symfony.com/doc/2.0/components/yaml/introduction.html
15 http://docs.oracle.com/javase/tutorial/getStarted/intro/definition.html
16 http://patatos.over-blog.com/article-lire-un-fichier-de-proprietes-en-java-47382363.html
![Page 39: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/39.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 39
Velocity: Velocity17
is a Java-based template engine. It permits web page designers to
reference methods defined in Java code. Velocity can be used to generate posts emails
and other output from templates. It can be used either as a standalone utility for
generating source code and reports, or as an integrated component of other systems
PHP: PHP (PHP Hypertext Preprocessor) is a free programming language embedded
into an HTML, which is used to create the dynamic web page. WordPress, Drop,
Joomla, Symfony 1.x and 2.x, and others are frameworks based by PHP.
Twig: Twig18
is a template engine for PHP. It’s a bundle of Symfony 2.x. It's both a
designer and developer by sticking to PHP's principles and adding functionality useful
for templating environments.
1.5. Using APIs
LOG4J: LOG4J19
is a logging library for Java. With this library, it is possible to
enable logging at runtime without modifying the application binary. It writes the
logging in many supports (file, email, HTML, etc.).
MONOLOG: MONOLOG20
is a logging library for PHP 5.3 used by Symfony2. Its
configurations are in the config_dev.yml.
2. Module realization
In the Symfony2 or JAVA/J2EE API, we have 3 parts:
Logging management
Exception management
Errors message management.
17 http://velocity.apache.org/engine/devel/user-guide.html#What_is_Velocity
18 http://twig.sensiolabs.org/
19 http://logging.apache.org/log4j/1.2/
20 http://symfony.com/doc/2.0/cookbook/logging/index.html
![Page 40: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/40.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 40
2.1. Logging management
In this part, we use the API Log4j for the JAVA/J2EE applications (or the API Monolog
for Symfony2 applications). When the application is executed, the operations are written in
the console (Figure 15), and at the same time, they are written in the log file (Figure 16 –
Figure 17).
Figure 15: Logs in the console
Figure 16: Logs in the log file for J2EE applications
![Page 41: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/41.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 41
Figure 17: Logs in the log file for Symfony2 applications
2.2. Exception management
Our goal is that the exception’s screen shouldn’t be displayed to the final customer. So,
we make a personal page (Figure 18) which replaces this screen.
We have 3 options in this part:
Display the exception details (Figure 20)
Send the exception details by email (Figure 21)
Save exception details in the database of application (Figure 23)
Figure 18: Exception screen when the user is the final customer
![Page 42: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/42.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 42
By the exception.properties file, the developer can activate one or more options
(Figure 19 ) or he can’t activate any option. This file is in the JAVA/J2EE or Symfony2
applications
Figure 19 indicates the name of the main application. We use it when the details
of exception are sent to the responsible. By this way, the responsible facilitates to know the
application of this exception.
Figure 19: Example of exception.properties file for exception options for JAVA/J2EE applications
![Page 43: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/43.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 43
Display the exception details
Figure 20: Exception screen when the user is the developer
This screen (Figure 20) is displayed to the developer. It contains the personal message
and the details of the exception. The details of the exception are put up in this personal page
when the developer does the value of the property exception.showCustomErrorPage true
(Figure 19 ). He uses this property when he corrects a bug.
Send the exception details to the application developer
For activating the emails sending, the developer set the value of exception.sendMail true
(Figure 19 ). In the exception.properties file, we have the other options such as the
connection parameters (Figure 19 ), the sender mail and the recipient(s) mail(s) (Figure
19 ). We can put at least one of recipients’ mails separated by comma.
![Page 44: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/44.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 44
Figure 21: Email of exception details
For sending this email (Figure 21), we want a standard format of email. So, we use the
language Velocity. The extension file of this language is .vm. Figure 22 has the standard
format of the email. In the red square, there are the variables that are replaced by the details of
exception.
Figure 22: The .vm file
![Page 45: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/45.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 45
Save the exception details in the database of JAVA/J2EE or Symfony2
applications
For activating the sending of emails, the developer puts the value of
exception.saveInDatabase true (Figure 19 ). The details of exceptions are saved in the table
named exception_log. This table is found in the main database (Figure 23)
Its attributes are:
o dateException: the date when the exception is made
o message: the exception type
o stackTrace: the exceptions details. The methods, the classes and the lines when
the system finds the error.
Figure 23: Exceptions details in the database
2.3. Error management
The developer can see the list of errors message details which are in the database of the
application (Figure 24)
If he wants to search a word, he writes the keyword and he chooses the criteria (code,
category, language or message) (Figure 25)
![Page 46: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/46.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 46
He has two results:
o No result: It means that the keyword is not found
o List of errors message details: This list has one or more errors messages details
Figure 24: List of errors message details
Figure 25: Search part
Conclusion
In this chapter, we have presented the tools used to realize our system. We have
described the interfaces and the system functionalities.
![Page 47: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/47.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 47
General conclusion
Our work aims to develop an IT solution in order to facilitate the management of errors
and exceptions for Java/J2EE and Symfony2 applications. It responds to very specific needs
of developers of the I-WAY company at management and logging errors and exceptions.
Our module "Management and logging of exceptions and errors" can simplify and
facilitate the developer work at the business layer applications. It gives them the flexibility of
access to data, research and correcting bugs.
This project allowed us to apply our theoretical knowledge all throughout our university
and mainly in the UML analysis and design phase. Practically, it was a positive experience
that has allowed us to know more information about the world of work which gave us a taste
of working life.
We are familiar with Java/J2EE platform and Symfony2 and their plugins MAVEN3,
Spring, Twig, … and the languages Java and PHP5. Also, we were asked to prepare activity
reports so that our work is controlled by pointing the sticking points to our supervisor.
As an outlook, we note that our application with the extensible character can have several
improvements such as adding a module for Microsoft technology (C#, ASP.Net, ...). We can
publish this module in the world for using and we want to be by default in the Symfony2
framework when the user downloads this framework or in the Spring framework.
![Page 48: Projet Fin d’Etude : I-Way Intranetfatmarekik.weebly.com/uploads/2/3/8/5/23854107/final_study_project... · proposed by Intelligence Way (I-WAY) company. This project consists of](https://reader031.vdocuments.us/reader031/viewer/2022022608/5b8d8f4509d3f228638c3208/html5/thumbnails/48.jpg)
[Study, conception and development of module of errors and exceptions
logging and management for J2EE and Symfony2 applications]
[2013]
[Fatma REKIK - ENIS] Page 48
STUDY, CONCEPTION AND DEVELOPMENT
OF MODULE OF ERRORS AND EXCEPTIONS
LOGGING AND MANAGEMENT FOR J2EE AND
SYMFONY2 APPLICATIONS
Fatma REKIK
او و 2 جاي ٌهدف عملنا على تطوٌر حلول تقنٌة المعلومات من أجل تٌسٌر إدارة األخطاء واالستثناءات للتطبٌقاتالخالصة
ذلك ٌتٌح لهم المرونة فً الوصول إلى البٌانات . طبٌقات الداخلٌة للتطبقةالوٌمكن تبسٌط وتسهٌل عمل المطورٌن فً . 2سانفونً
البرمجة جافا و بً هاش ، لغات 2 او و سانفون2ً برامج جاياألدوات مثلهنالك العجٌد من لذلك، . األخطاءتصحٌحو والبحوث
، الخام فً سً، نموذج باي
Résumé : Notre travail vise à développer une solution informatique pour faciliter la gestion des
erreurs et des exceptions pour les applications Java/J2EE et Symfny2. Il permet de simplifier et de
faciliter le travail des développeurs sur la couche métier des applications. Il leur donne la souplesse
d'accès aux données, la recherche et la correction des bugs. De nombreux outils sont utilisés tels que
les plate-formes Maven, Symfony2, les languages JAVA et PHP, le modèle MVC, etc.
Abstract: Our work aims to develop an IT solution in order to facilitate the management of errors
and exceptions for Java/J2EE and Symfony2 applications. It can simplify and facilitate the work of
developers at the business layer applications. It gives them the flexibility of access to data, research
and correcting bugs. Many tools are used as the MAVEN and Symfony2 frameworks, JAVA and PHP
languages, MVC model, etc.
، فالوسوتً، بً هاش بً، جافا2او، مفان، سنفون2ًجاي/، تسجٌل، ام فً سً، جافا األخطاء، استثناءالمفاتيح
Mots clés: erreurs, exception, logging, MVC, JAVA/J2EE, MAVEN, Symfony2,
Velocity, PHP, JAVA
Key-words: errors, exception, logging, MVC, JAVA/J2EE, MAVEN, Symfony2,
Velocity, PHP, JAVA