• No results found

J2EE-Application Server

N/A
N/A
Protected

Academic year: 2021

Share "J2EE-Application Server"

Copied!
40
0
0

Loading.... (view fulltext now)

Full text

(1)

J2EE-Application

Server

(inkl windows-8)

Installation-Guide

F:\_Daten\Hochschule Zurich\Web-Technologie\ApplicationServerSetUp.docx

(2)

Table of Contents

Java Setup ... 4

Download JDK (Java Development Kit) ... 4

Install JDK ... 4

Glassfish Server Setup ... 5

Download Glassfish ... 5

Install Glassfish ... 5

Eclipse for JEE Developers Setup ... 5

Download Eclipse ... 5

Setup Eclipse ... 5

Install JDK in Eclipse ... 6

Add Glassfish Tools for Eclipse ... 7

Setup Glassfish with Eclipse ... 7

Start Glassfish Admin Console ... 10

Create first Servlet, deploy and run it... 11

Automated publishing when source has been saved ... 13

Visual C++ 2013 runtime ... 14

MySql ... 15

Download and Install MySql ... 16

Create local User in MySQL Workbench ... 24

Give a Remote Computer access to MySQL ... 27

Download mySql JDBC driver ... 28

Download and Install MySql Eclipse Plugin ... 29

Toad extension... 29

DBeaver ... 31

Basic MySql commands ... 37

DB Connection über JNDI auf dem Application Server einrichten ... 38

Insalling XAMPP instead of MySql ... 40

CS IDesktop Setup ... 45

AppDevs Rechte anfordern ... 45

Kepler Rechte Anfordern ... 46

Eclipse Kepler aufsetzen ... 48

Windows-8 ... 50

Installation of Windows-8 ... 50

(3)

Office installation ... 50

Other installations ... 50

Common Help ... 51

Finden der aktuelle IP eines Computers ... 51

(4)

Java Setup

Download JDK (Java Development Kit)

Download the latest 32-bit JDK from http://www.oracle.com/technetwork/java/javase/downloads/.

(January 2015: version 8u31)

Accept their License Agreement after carefully reading it by selecting the left radio-button. Choose the Windows x86 version from the List and download it.

JDK has to be 32-bit (x86) even on a 64-bit operating system.

Install JDK

Run the previously downloaded file and follow the instructions. The JDK includes the JRE so you have to specify both installation paths. Both of them shouldn’t be changed so they’re installed to

(5)

Glassfish Server Setup

Download Glassfish

Download the latest Full Platform Server from https://glassfish.java.net/download.html.

(January 2015: version 4.1)

Install Glassfish

Extract the compressed zip-file to C:\glassfish.

Further Steps to Setup the Glassfish Server will be taken after eclipse is installed (next chapter).

Eclipse for JEE Developers Setup

Download Eclipse

Download the latest 32-bit version of Eclipse for JEE from https://www.eclipse.org/downloads/.

(6)

Install JDK in Eclipse

In Eclipse, navigate toWindows > Preferencesand go to the menuJava > Installed JREs.

On the right, click onAdd... and navigate to the JDK installation directory. (jdk has to be there not just the JRE!!!)

(7)

Add Glassfish Tools for Eclipse

Navigate to Help > Eclipse Marketplace. Search for “glassfish” and install the corresponding package. After that, restart Eclipse.

Setup Glassfish with Eclipse

First of all, change your view in the top right corner to Java EE. Then click on the Servers-tab which should be at the bottom area. Afterwards click on the blue underlined text to setup a new one.

(8)

Select Glassfish 4.0 and click on Next >.

The JDK should be set to Eclipse Default and the Glassfish Server Directory should point to the installation. Then click on next.

(9)

The Domain Directory should point to C:\glassfish\glassfish\domains\domain1

Administrator Id should be set to admin and the Password should be left blank. Click on

(10)

Start Glassfish Admin Console

Right click the server and start it. Then you have to allow the access of the Server when you are prompted. After that right click on Glassfish Select Glassfish à View Admin Console and then (after a while) you will see picture above.

(11)

Create first Servlet, deploy and run it

(12)

Create Servlet:

(13)

Automated publishing when source has been saved

First Servlet

Add the following code into the Project:

/**

* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)

*/

protected void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html");

response.getWriter().print("Hallo Student from HWZ (doGet)");

}

/**

* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)

*/

protected void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html");

response.getWriter().print("Hallo Student from HWZ (doPost)");

}

Double click

(14)

Visual C++ 2013 Runtime

http://www.microsoft.com/de-ch/download/details.aspx?id=40784

In order to use the MySQL Workbench which will be installed in the next step, the Microsoft Visual C++ 2013 Runtime is required.

(15)

MySql

http://www.youtube.com/watch?v=Rnq8DS05PwQ http://www.youtube.com/watch?v=4oChG9--iMM

(16)

Download and Install MySql

http://dev.mysql.com/downloads/mysql/

(17)

mysql-installer-community-5.6.22.0.msi Start installation

(18)

Fix if “Developer Default” doesn’t work:

Choose “Custom” and select the components manually. The specific components are in the second picture below.

(19)
(20)
(21)
(22)
(23)
(24)

Create local User in MySQL Workbench

Start MySQL Workbench Goto User and Privileges

(25)
(26)

Test MySQL

Start-Menu à MySQL à MySQL Server 5.5 àMySql Command Line Client

Password: admin

(27)

Give a Remote Computer access to MySQL

Um einem anderen Computer die Berechtigung zu geben auf eine MySql DB zuzugreifen, starten Sie My SQL Workbench:

1. Add Account

2. Add IP Adresse des Remote-Host, welcher auf die DB zugreifen möchte.

(28)

Download mySql JDBC driver

https://downloads.mariadb.com/files/mysql-connector-java-5.1

download it extract it.

Then move the connector (mysql-connector-java-*.*.*-bin.jar) to: C:\glassfish4\glassfish\lib

(29)

Download and Install MySql Eclipse Plugin

Toad extension

(30)
(31)

DBeaver

(32)
(33)
(34)

Select the MySQL JDBC Driver with the matching System Version (January 2015: 5.1) and select the «Jar List»-Tab.

(35)

Remove the current Jar in the list and click on «Add JAR/Zip…». Then navigate to the installation directory of the glassfish-server and select the driver in the directory «…/glassfish/lib».

(36)
(37)

Basic MySql commands

Start MySql Command Line Client to find out which DB are already defined

show databases; use test;

show tabels;

create table Classmates (

id int PRIMARY KEY NOT NULL, fname varchar(25),

lname varch,ar(25) );

CREATE UNIQUE INDEX PRIMARY ON classmates(id);

INSERT INTO classmates (id, lname, fname) VALUES (1,'David','Etter');

(38)

DB Connection über JNDI auf dem Application Server einrichten

Glassfish Admin-Console starten und unter Resourcen à JDBC à JDBC ConnectionPools einen neuen Pool anlegen. Hier wird unter einem Namen eine DB Connection String abgespeichert! Nicht als ein einziger String, sondern als einzelne Felder!)

Nach next müssen folgende Properties gesetzt werden: (Anhand der DB Perspective)

User à admin Password à admin Database à onlineshop

Url à jdbc:mysql://localhost:3306/onlineshop URL à jdbc:mysql://localhost:3306/onlineshop Abspeichern und mit Ping austesten

(39)

Neue JNDI Resource definieren, welche auf diese DB-Connection verweist: JDBC Resources à New….

(40)

Common Help

Finden der aktuelle IP eines Computers

cmd à ipconfig (Beispiel unten: Computer ist über Ethernet und WiFi connected, desshalb 2 IP-Adressen)

Helpfull Links

http://www.youtube.com/watch?v=9Kf5m7bMu74 Part 1 (Installation)

http://www.youtube.com/watch?v=ppGqtOeHm-g Part 2 (Servlet calling EJB, JSP, timer-EJB) http://www.youtube.com/watch?v=CuLYhkqt0V0 Part 3 (JPA)

http://www.http://www.youtube.com/watch?v=1epUpQlKwME Part 4 (Facelets / JSF 2) http://www.youtube.com/watch?v=on557289GzA Part 5

youtube.com/watch?v=aBjlR9HoR50 Langes vollständiges Beispiel von JSP, Servlet, DB Connection, JPA, EJB, Web-Services

References

Related documents

Similar magnitude, different outcomes A comparison of the effects of the Nisqually earthquake and those of the 1994 event in Northridge, California (M6.7) illustrates the

It also is evident that the overemphasis on the pyramid has limited formulation of the type of intervention framework that policy and practice analyses indicate is needed to

The panelists actual purchase behavior of fair trade coffee brands (based on a combination of self- reported diaries and bar code based recordings) were compared with their

(USDA) تﺎﻋﻼﻃا و ﺪﺷ هدﺎﻔﺘﺳا ﻲﻣﻮﻤﻋ. نﻮﻣزآ ﺰﻴﻧ يرﺎﻣآ ﻞﻴﻠﺤﺗ و ﻪﻳﺰﺠﺗ رد نﻮﻴـﺳﺮﮔر و ﻞﻘﺘـﺴﻣ ﻲـﺗ ،ﺎـﻛ روﺬـﺠﻣ يﺎـﻫ هدﺎﻔﺘﺳا درﻮﻣ ﻚﻴﺘﺴﺠﻟ ﺪﻨﺘﻓﺮﮔ راﺮﻗ. تﺎﻋﻼﻃا ﻲﺳرﺮﺑ ﻲﻋﺎﻤﺘﺟا - ا

Early and sustained effects of cardiac resynchronization therapy on N-terminal pro-B-type natriuretic peptide in patients with moderate to severe heart failure and cardiac

Rohit Gupta and Amit Grover, “BER Performance Analysis of MIMO system using Equalization Techniques” [7] show that Maximum Likelihood and Sphere Decoding algorithm

The header contains the information that uniquely identifies the journal: business unit, journal ID, and journal date.. In addition, PeopleSoft General Ledger delivers various

An initial work programme on the Goudron field will consist of existing well workovers and selected infill wells in order to bring production up to 450-500 bopd.. This