simon-1337/bachelor-thesis-projects
This is the project of my Bachelor Thesis. You can find a description on how to use it in the readme.txt. The thesis itself as well as the project can be downloaded under https://wi.wu.ac.at/rgf/diplomarbeiten/. You need to either scroll down to my thesis (should be among the latest projects) or filter the author for my name (Simon Besenbäck).
PREREQUISITES TO USE THE FRUITSHOP AND HELLOWORLD PROJECTS
Necessary Software:
- Apache Tomcat server -> https://tomcat.apache.org/
- Eclipse IDE -> https://www.eclipse.org/downloads/
- OpenJDK -> https://jdk.java.net/
- script-jsr223.tld -> https://sourceforge.net/projects/bsf4oorexx/files/Sandbox/rgf/taglibs/ga/
(already in the war-archive) - jakarta.ScriptTagsLibs.jar -> https://sourceforge.net/projects/bsf4oorexx/files/Sandbox/rgf/taglibs/ga/
- nashorn-core-15.4.jar -> https://search.maven.org/artifact/org.openjdk.nashorn/nashorn-core/15.4/jar
- asm-7.3.1.jar, asm-commons-7.3.1.jar,
asm-tree-7.3.1.jar and asm-util-7.3.1.jar -> https://repository.ow2.org/nexus/#welcome - SQLite -> https://www.sqlite.org/
- SQLite JDBC Driver -> https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc
- Bcrypt -> https://mvnrepository.com/artifact/org.mindrot/jbcrypt/0.4
- MailHog -> https://github.com/mailhog/MailHog
- Jakarta Mail & Jakarta Activation -> https://jar-download.com/artifacts/com.sun.mail/jakarta.mail/2.0.1/source-code
Installation & Setup Steps
Apache Tomcat & Eclipse IDE:
- Download the latest version of Apache Tomcat and Eclipse IDE from their respective websites.
- Extract the Tomcat files from the downloaded zip archive to a directory of your choice.
- Install and open the Eclipse IDE.
- Create a new server by clicking the "servers" tab in the Eclipse IDE and selecting the server type.
- Choose the directory of the Apache Tomcat installation and select the OpenJDK JRE.
- The Tomcat server will be visible as [Stopped, Republish] under the Servers tab.
- Double-click on the Tomcat server to see the server settings and note the default HTTP port (8080).
- Right-click on the server and select Start to test if the server is working.
- If there is an error 404, go back to the Eclipse IDE, double-click on the Tomcat server,
and select the "Use Tomcat installation" option in the Server Locations section. - Save the changes and restart the server by right-clicking on it and selecting Restart.
- The server can be accessed via the URL: http://localhost:8080/ in any browser.
Configuring Manager Application Access:
To access the JSPs, a username and password must be configured in the manager application of a Tomcat web server.
By default the access to the manager application is restricted for security purposes.
The developer can create a new username and password or assign a manager-xxx role to an existing one,
by editing the tomcat-users.xml file in the conf directory of the Tomcat installation.
IMPORTANT: As Eclipse is used the tomcat-users.xml file in the eclipse-workbench must be configured
and not the one in the Apache Tomcat installation.
Below is the necessary configuration to login to the manager application with the username and password “test”.
OpenJDK
Steps to install OpenJDK:
- Go to the website https://jdk.java.net/ and click on the "OpenJDK Early Access Builds" button.
- Select the latest JDK version found in the "Ready for use" section.
- Download the ZIP archive file with the description Windows/x64.
- Extract the ZIP file to C:\jdk-19.
Steps to set up the environment variables:
- Open the system properties by searching for "env" in the Windows taskbar
and clicking on "Edit system environment variables". - Go to the environment variables and create a new system variable called JAVA_HOME with the value C:\jdk-19.
- Search for the Path environment variable and edit it.
- Click on the new button and enter %JAVA_HOME%\bin. Move the new path to the top.
- If there is no Path environment variable, create one with the name Path and value %JAVA_HOME%\bin.
script-jsr223.tld and jakarta.ScriptTagsLibs.jar
Download the jakarta.ScriptTagLibs.jar as well as the script-jsr223.tld from
the URL https://sourceforge.net/projects/bsf4oorexx/files/Sandbox/rgf/taglibs/ga/.
This enables the usage of Nashorn.
The jakarta.ScriptTagsLibs.jar needs to be added to the lib directory inside the Apache Tomcat folder
The script-jst223.tld needs to be added to the WEB-INF Folder of the Project.
IMPORTANT: The steps regarding script-jsr223.tld are already done if the developed projects are used.
Nashorn
The jar file needs to be downloaded from the URL: https://search.maven.org/artifact/org.openjdk.nashorn/nashorn-core/15.4/jar.
Afterwards the jar file needs to be added to the lib directory of the Tomcat server.
ASM
Nashorn depends on the four ASM jar files:
- asm-7.3.1.jar
- asm-commons-7.3.1.jar
- asm-tree-7.3.1.jar
- asm-util-7.3.1.jar
They need to be dowloaded from the OW2 Maven repository (https://repository.ow2.org/nexus/#welcome)
and added to the lib directory in Apache Tomcat.
SQLite
- Download the command-line shell program for SQLite on Windows from
the Precompiled Binaries section of the SQLite Download Page. - Extract the contents of the downloaded zip file to a folder named "sqlite".
- The extracted contents should include the command-line shell program,
the sqldiff.exe program, and the sqlite3_analyzer.exe program.
Now SQLite can be used via the console. To start it the user needs to be inside the sqlite folder and type 'sqlite'.
ATTENTION: In the case that the path of the folder is different from 'C:\sqlite',
the URL in the context.xml needs to be changed to point to the correct location.
SQLite JDBC Driver
The .jar file of the SQLite JDBC Driver can be downloaded from https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc.
After the download, the file needs to be added to the lib directory of the Tomcat server.
Bcrypt
Download the jbcrypt library by Damien Miller from https://mvnrepository.com/artifact/org.mindrot/jbcrypt/0.4.
Then copy it into the lib directory of the Apache Tomcat server.
Jakarta Mail & Jakarta Activation
Both jar files can be downloaded together in a zip formatted folder under the following link:
https://jar-download.com/artifacts/com.sun.mail/jakarta.mail/2.0.1/source-code.
After the download is complete the jar files need to be extracted and added to the lib folder.
MailHog
- Download the latest release for the appropriate operating system.
- Start the program using the .exe file.
- The MailHog HTTP server starts on port 8025.
- Access the server in the browser by using the URL "localhost:8025".
Now the sent emails can be analyzed in the browser