39
INTRODUCTION TO JAVA EE 7 Module 1 Java™ Technology Platforms > The Java EE platform is an architecture for implementing enterprise‐class applications using Java and Internet technology. > A primary goal of Java EE technology is to simplify the development of enterprise‐class applications through a vendor‐neutral, component‐based application model.

Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

  • Upload
    vunga

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

INTRODUCTION TO JAVA EE 7

Module 1

Java™ Technology Platforms> The Java EE platform is an architecture for implementing enterprise‐class applications using Java and Internet technology. 

> A primary goal of Java EE technology is to simplify the development of enterprise‐class applications through a vendor‐neutral, component‐based application model.

Page 2: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

A bit of History> Java EE is based on standards. 

> It is an umbrella specification that bundles together anumber of other JSRs.

Java EE Past, Present, & Future

Page 3: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE 7 Goals> Support for latest Web standards

> Ease of development, simplification

> Managed bean alignment

Java EE 7 Goals> Support for latest Web standards

– HTML 5

–WebSocket

– JSON

– JAX‐RS

– Servlet NIO, async

> Ease of development, simplification

> Managed bean alignment

Page 4: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE 7 Goals> Support for latest Web standards

> Ease of development, simplification

– JMS 2.0

– Expanded use of injection

– Bean Validation integration

– Default resources

– Pruning 

• JAX‐RPC; JAXR

• EJB 2.X BMP, CMP Entity Beans

• Deployment API (JSR 88)

> Managed bean alignment

Java EE 7 Goals> Support for latest Web standards

> Ease of development, simplification

> Managed bean alignment

– CDI enabled by default

– Generalized use of CDI injection and interceptors across Java EE managed classes

– Transactional interceptors

–Method validation

Page 5: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE and the Java Community Process> The Java EE specification defines the types of components and the associated APIs that are available to Java EE application component developers. 

> The Java EE specification also defines the infrastructure requirements for a robust, scalable, and reliable runtime environment for distributed, enterprise applications.

Java EE 7 –JSRs

Page 6: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE 7 Specifications> Java EE 7 is an umbrella specification defined by JSR 342 that contains 33 other specifications.

> An application server that aims to be Java EE 7 compliant has to implement all these specifications.

http://www.oracle.com/technetwork/java/javaee/tech/index‐jsp‐142185.html

Java EE 7 Specifications

Page 7: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE 7 Specifications

Page 8: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Management, Security, &Other Specifications

Java EE‐related Specs in Java SE

Page 9: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE Technology Suite

> Application components – Application developers use 

application components to create the application business 

logic and control elements.

> Integration – Integration elements allow a Java EE application 

to interact with and incorporate the functionality from other 

applications and systems, such as legacy systems or databases.

> Container management – Container management elements 

provide runtime support for Java EE application components.

Architecture> Java EE is a set of specifications implemented by different containers. 

> Containers are Java EE runtime environments that provide certain services to the components they host such as life‐cycle management, dependency injection, and so on.

Page 10: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Component, API, and Service Layer> The Java EE APIs define the contract between the application component developer and the platform provider using the interface mechanism that is defined by the Java programming language.

Advantages of using Server‐Provided Services

Page 11: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE Platform APIs and Services> Java EE service categories:

– Deployment‐based services

– API‐based services

– Inherent services

– Vendor‐specific functionality

Java EE Service Infrastructure

Page 12: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE Application Architecture> Web‐centric architecture

> Combined web and EJB™ component‐based architecture,sometimes called EJB component‐centric architecture

> Business‐to‐business (B2B) application architecture

> Web service application architecture

Java EE Web‐Centric Architecture

> The introduction of EJB Lite in Java EE 6 allows the use of some EJB technology in web‐centric architectures.

Page 13: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE EJB Component‐Centric Architecture

> This configuration uses both the web container and EJB containers of the Java EE server. 

> In this model, the business logic and data access components are located in the EJB container. 

> The web‐tier components process the incoming request and generate the view based on the results of the business process.

Java EE Profiles> Java EE 6 standardized profiles for application developers that do not need the full Java EE platform but require application portability. 

> Developers can choose between:

– The Java EE 6 Web Profile ‐ Similar to Tomcat, for whendevelopers are working primarily on web applications.

– The Java EE 6 Full Platform ‐ Complete Java EE 6application servers

> Technically “Full Platform” is not a profile. The only profileincluded in the Java EE 6 specification is the web profile. 

> Additional profiles may be added in future releases.

Page 14: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE Profiles

> Profiles are a major new feature in the Java EE 6 environment. 

> Their main goal is to reduce the size of the platform to suit the developer’s needs more efficiently. 

> No matter the size or complexity of the application you develop today, you will deploy it in an application server that offers you APIs and services for 33 specifications. 

> A major criticism leveled against Java EE was that it was too large. 

> Profiles are designed precisely to address this issue.

Java EE Profiles

> Java EE 6 defines a single profile called the Web Profile. Its aim is to allow developers to create web applications with the appropriate set of technologies. 

> Web Profile 1.0 is specified in a separate JSR and is the first profile of the Java EE 6 platform. 

> Others might be created in the future (you could think of aminimal profile or a portal profile). 

> The Web Profile will evolve at its own pace, and we might end up with a Web Profile 1.1 or 1.2 before Java EE 7 is released.

Page 15: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE Profiles

Web Profile 1.0 Specifications

Page 16: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

B2B Application Architecture

> The B2B application architecture is an extension of the Java EE technology EJB component‐based architecture. 

> It involves two EJB servers, one in each business location. > Each Java EE server hosts a web container and an EJB 

container.

Web Service Application Architecture

Page 17: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE Patterns> Patterns provide a standard solution for well understoodprogramming problems.

> The Java EE pattern catalog:

– Helps a developer create scalable, robust, high‐performance, Java EE technology applications

– Presupposes the use of the Java programming languageand the Java EE technology platform

– Are, in many places, closely related to the Gang of Four(GoF) patterns

Java EE Pattern Tiers

Page 18: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE BluePrints> Developed by the Java software group

> Provide a set of guidelines and a sample application

> Used as a reference when designing and developing a JavaEE application or Java EE application components

> Known as the Java BluePrints Solutions Catalog for Java EE

Java Application Servers

> An application server provides an environment in which applications can execute. To ensure application portability, application server environments conform to various specifications.

> The collection of specifications that a server conforms to is known as a profile. Java EE 7 includes the Web and Full profiles.

> Java EE servers provide deployment, management, and execution support for conforming application components. 

Page 19: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Java EE Implementations> There are many Java EE application server implementations. This course uses GlassFish Server 4 Open Source Edition.

– Oracle Fusion Middleware

• GlassFish

• WebLogic

– Other vendors

• IBM WebSphere

• Apache TomEE

• JBoss Application Server

Selecting an Application Server> Portable Java EE applications can be deployed to a wide range of servers with very little to no modification. The selection of an application server can be influenced by many factors other than code portability.

– Cost

– Support

– Documentation

– Integration

– Reliability

– Ease of administration

– Additional non‐standard features 

– Performance

– Backward compatibility

– Supported Java versions

– Supported profiles

Page 20: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

INTRODUCTION TO TOMCAT 8

Module 1

INTRODUCTION TO JAVA EE7

History of TomcatVersion Release Date Description

3.0 1999 Merger of donated Sun Java Web Server code and ASF, 

and implements Servlet 2.2 and JSP 1.1 specifications. 

3.3.2  March 9, 2004  Latest 3.x release. 

4.1.40  June 25, 2009  Latest 4.x release. 

5.5.32  February 1, 2011  Latest 5.x release. 

6.0.32  February 3, 2011  Latest 6.x release. 

7.0.0 Beta  June 29, 2010 First Apache Tomcat release to support Servlet 3.0, JSP 

2.2, and EL 2.2 specifications. 

7.0.11  March 11, 2011  Fourth stable version. 

7.0.42  July 5, 2013  Current stable version. 

8.0 July 25, 2014 Supports Servlet 3.1, JSP 2.3, Websocket

Page 21: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

History of TomcatVersion Release Date Description

8.5 July 13, 2016Supports HTTP/2, OpenSSL for JSSE, TLS virtual hosting and 

JASPIC 1.1

9.0 Alpha Supports  Servlet 4.0, JSP 2.4, EL 3.1

Why create Tomcat 8.5?> Tomcat 9 adds 

– HTTP/2 support

– OpenSSL encryption for JSSE

– TLS virtual hosting 

– JASPIC 

> These mostly depend on the significant refactoring / cleanup that took place in 9 

– The extent of the changes means back‐porting to 8.0 is not viable

Page 22: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Why create Tomcat 8.5?> Tomcat 9 stable release is tied to the release of Java EE 8

> Java EE 8 has been repeatedly delayed 

– Currently delayed until at least 2018

> Don't want users to have to wait another year+ to get access to these new features in production

> Hence, Tomcat 8.5 to make these features available sooner

What, exactly, is Apache Tomcat 8.5?> Started from Apache Tomcat 9.0.0.M4 release

– HTTP/2

– OpenSSL for JSSE

– TLS virtual hosting

– JASPIC

– Remove HTTP BIO and AJP BIO connectors

– Remove Comet support

– Remove deprecated code

> Reverted all the Servlet 4.0 API changes

Page 23: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

TOMCAT 8.5 INSTALLATION

Module 1

INTRODUCTION TO JAVA EE7

How to download the Tomcat software> It is always recommended to download the software from its official site

http://tomcat.apache.org/download-80.cgi

Page 24: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Prerequisites for the Tomcat 8.5 installation> Before we begin with the Apache Tomcat 8.5 installation, we have to configure the prerequisites and they are very important for the Tomcat 8.5 installation to start. 

> The prerequisites mentioned for Apache Tomcat 8.5: 

– Java SE 1.7 or later 

– Configuration of the OS environment variables

Page 25: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Installation of Java> Download the JDK from the Oracle site 

www.oracle.com/technetwork/java/javase/download

Installation of Java on Linux

Page 26: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Installation of Java on Linux

Installation of Java on Windows

Page 27: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Configuration of OS environment variables> After the installation of Java, it's now time to set the environment variables for Tomcat at the OS level. 

> In order to run Tomcat, we have to define the JAVA_HOME as an environment variable and set the path for Java so that it can be accessed from any partition of OS

> JAVA_HOME is the JDK install directory 

Configuration of OS environment variables

Page 28: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Setting the JAVA_HOME and PATH variable

Setting the JAVA_HOME and PATH variable

Page 29: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Setting the JAVA_HOME and PATH variable

Installing Tomcat from Zip (Linux)useradd -g tomcat

-s /sbin/nologin

-d /opt/tomcat

tomcat

> For security reasons, you should probably create a tomcat user with low privileges and run Tomcat as that user. 

> We suggest setting that user’s login shell to /sbin/nologin and locking the user’s password 

> Also, it’s probably a good idea to make the tomcatuser’s primary group the nobody group or another group with similarly low permissions.

Page 30: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Installing Tomcat from Zip (Linux)$ cd $HOME

$ unzip apache-tomcat-8.5.12.zip –d /opt/tomcat

Installing Tomcat> If you’ll be running Tomcat as user tomcat, you must install the files so that this user may read and write those files. 

> After you have unpacked the archives, you must set the file permissions on the Tomcat files so that the tomcat user has read/write permissions:

chown -R tomcat:tomcat

apache-tomcat-8.5.12

cd apache-tomcat-8.5.12/bin

chmod u+x *.sh

Page 31: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Installing Tomcat from RPMrpm -ivh tomcat-8.5.12-0.noarch.rpm

Preparing... ############################# [100%]

1:tomcat ############################# [100%]

Installing Tomcat from RPMrpm ‐ivh ‐‐nodeps tomcat‐8.5.12‐0.noarch.rpm

Preparing... ############################# [100%]

1:tomcat ############################# [100%]

Page 32: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Installing Tomcat from RPM# groupadd tomcat

# useradd -s /sbin/nologin

-d /opt/tomcat

-c 'Tomcat User'

-g tomcat

tomcat

Installing Tomcat on Windows> Tomcat is available as a Windows‐style graphical installer that is available directly from the Apache Software Foundation’s Tomcat downloads page.

> Although you can also install Tomcat from a zipped binary release, the Windows graphical installer does a lot of setup and operating system integration

Page 33: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Starting/Stopping/Restarting Tomcat> Once you have the installation completed, you will probably be eager to start Tomcat and see if it works.

> The correct way to start and stop Tomcat depends on how you installed it

– Linux RPM package:

• use the init script that came with that package to start and stop Tomcat.

– Binary release archive (.zip or .tar.gz)

• use the command‐line scripts that reside in the CATALINA_HOME/bin directory.

Tomcat invocation scripts

catalinaThe main Tomcat script. This runs the java command to 

invoke the Tomcat startup and shutdown classes

cpappendused internally (only on Windows) to append items to 

Tomcat classpath environment variables.

digest This makes a crypto digest of Tomcat passwords. Use it 

to generate encrypted passwords.

service Installs and uninstalls Tomcat as Windows service.

setclasspathOnly used internally and sets the Tomcat classpath and 

several other environment variables.

shutdown This runs catalina stop and shuts down Tomcat.

startup This runs catalina start and starts up Tomcat.

Page 34: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Startup options

‐configThis specifies an alternate server.xml configuration file to use. 

The default is file that resides in the $CATALINA_BASE/conf/server.xml.

‐help This prints out a summary of the command‐line options.

‐nonaming This disables the use of JNDI within Tomcat.

‐security This enables the use of the catalina.policy file.

debug This starts Tomcat in debugging mode.

embedded This allows Tomcat to be tested in an embedded mode

jpda startThis starts Tomcat as a Java Platform Debugger Architecture‐compliant 

debugger.

run This starts up Tomcat without redirecting the standard output and errors.

startThis starts up Tomcat, with standard output and errors going to the Tomcat 

logfiles.

stop This stops Tomcat.

version This outputs Tomcat’s version information.

Environment variablesCATALINA_BASE Base directory for a Tomcat installation tree, such 

as logging files, work directories, Tomcat’s conf 

directory, and the webapps directory. 

Installation directory

CATALINA_HOME Base directory for static (read‐only) portions of 

Tomcat, such as Tomcat’s lib directories and 

command‐line scripts.

Installation directory

CATALINA_OPTS This passes through Tomcat‐specific command‐

line options to the java command.

None

CATALINA_TMPDIR The directory for Tomcat temporary files CATALINA_HOME/temp

JAVA_HOME The location of the Java runtime or JDK that 

Tomcat will use.

None

JRE_HOME This is an alias to JAVA_HOME. None

JAVA_OPTS This is where you may set any Java command‐line 

options.

None

Page 35: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Environment variables

JPDA_TRANSPORT The transport protocol used for JPDA debugging. dt_socket

JPDA_ADDRESSThe address for the JPDA used with the catalina jpda start 

command.8000

JSSE_HOMEThis sets the location of the Java Secure Sockets Extension 

used with HTTPS.none

CATALINA_PID

This variable may optionally hold the path to the process 

ID file that Tomcat should use when starting up and 

shutting down.

none

Start/Stop Tomcat> Start up Tomcat with its startup.sh script

$ bin/startup.sh

> Then, check to see if it’s running:

# ps -fe |

grep catalina.startup.Bootstrap

> Invoke the shutdown.sh script to shut Tomcat down:

$ bin/shutdown.sh

Page 36: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

A Tomcat init script for Linux#!/bin/sh

# Tomcat init script for Linux.

JAVA_HOME=/usr/java/jdk1.7.0_45

CATALINA_HOME=/opt/apache-tomcat-8.5.12

export JAVA_HOME CATALINA_HOME

exec $CATALINA_HOME/bin/catalina.sh $*

A Tomcat init script for Linux> Save this script in a file named tomcat and change the file ownership and group to root, and then chmod it to 755:

# chown root.root tomcat

# chmod -R tomcat:tomcat /opt/tomcat

> Copy the script to the /etc/rc.d/init.d directory after modifying the JAVA_HOME and CATALINA_HOMEenvironment variables to fit your system.

Page 37: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Automatic Startup on Linux> Use the chkconfig command to make the tomcat service start in the run level(s) of your choice. 

> Here’s an example of how to make it start in run levels 2, 3, 4, and 5:

# chkconfig ‐‐level 2345 tomcat on

> Now, query your configuration to make sure that startup is actually set:

# chkconfig ‐‐list tomcat

tomcat 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Testing Your Tomcat Installation> Once you have Tomcat installed and started , you should confirm that it has successfully started up. 

> Open the URL http://localhost:8080 in a browser to verify

Page 38: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Starting up in Windowsc:\opt\tomcat-8.5.12\bin>startup.bat

Using CATALINA_BASE: "c:\opt\tomcat-8.5.12"

Using CATALINA_HOME: "c:\opt\tomcat-8.5.12"

Using CATALINA_TMPDIR: "c:\opt\tomcat-8.5.12\temp"

Using JRE_HOME: "c:\opt64\Java\jdk1.7.0_45"

Using CLASSPATH: "c:\opt\tomcat-8.5.12\bin\bootstrap.jar;c:\opt\tomcat-8.5.12\bin\tomcat-juli.jar"

c:\opt\tomcat-8.5.12\bin>

Adding tomcat to Windows Servicesbin>service.bat install tomcat8-server1

Installing the service 'tomcat8-server1' ...

Using CATALINA_HOME: "c:\opt\tomcat-8.5.12"

Using CATALINA_BASE: "c:\opt\tomcat-8.0.12"

Using JAVA_HOME: "c:\opt64\Java\jdk1.7.0_45"

Using JRE_HOME: "c:\opt64\Java\jdk1.7.0_45\jre"

Using JVM: "c:\opt64\Java\jdk1.7.0_45\jre\bin\server\jvm.dll"

The service 'tomcat8-server1' has been installed.

Page 39: Module1 INTRODUCTION TO JAVAEE 7€¦ ·  · 2017-03-19end upwith a Web Profile 1.1 or 1.2 before Java EE 7 is ... This course uses GlassFish Server 4 ... >Reverted all the Servlet

Starting/Stopping Tomcat Servicebin>net start tomcat8-server1

The Apache Tomcat tomcat8-server1 service is starting..

The Apache Tomcat tomcat8-server1 service was started successfully.

bin>net stop tomcat8-server1

The Apache Tomcat tomcat8-server1 service is stopping.

The Apache Tomcat tomcat8-server1 service was stopped successfully.

Removing tomcat to Windows Servicesbin>service.bat remove tomcat8-server1

The service 'tomcat8-server1' has been removed.