Intro to Tomcat6

download Intro to Tomcat6

of 35

Transcript of Intro to Tomcat6

  • 8/3/2019 Intro to Tomcat6

    1/35

    1

    INTRODUCTION TO APACHE TOMCAT 6

    Filip Hanik

    Covalent Technical TeamMember Apache Software Foundation

    May 2007

  • 8/3/2019 Intro to Tomcat6

    2/35

    2

    Who am I?

    [email protected]

    Tomcat Committer / ASF memberCo-designed the Comet implementation

    Implemented NIO connector in 6Responsible for session replication andclustering

    Been involved with ASF since 2001

    Covalent Geek

    mailto:[email protected]:[email protected]
  • 8/3/2019 Intro to Tomcat6

    3/35

    3

    The Source for Apache, Tomcat,Geronimo & Axis

    Covalent is the Leading Provider of Supportfor Apache Software Foundation OpenSource Projects, Namely Tomcat, Geronimo,Axis, & Apache, the World's Leading WebServer*

    Covalent is One of the Few Sources of FullCommercial Support for Apache, Axis,Geronimo & Tomcat on a Global Basis

    Covalent Currently Supports More Than 50%of Fortune 500 and 20% of Global 2000Companies

    *62% global Web server marketshare ~Netcraft April 2006 Web Server Survey

  • 8/3/2019 Intro to Tomcat6

    4/35

    4

    Who is Tomcat?

    Top Level Project tomcat.apache.org24 committers on file

    Active/core group is much smaller

  • 8/3/2019 Intro to Tomcat6

    5/35

    5

    Agenda

    History

    Tomcat Versions

    Development/Release Lifecycle

    New Features

    How to upgrade

    Q & A

  • 8/3/2019 Intro to Tomcat6

    6/35

    6

    History

    Started out as a reference implementation by SunMicrosystems

    Donated to ASF Tomcat 3 (roughly 1999)

    Tomcat 4 New Specs & First Rewrite Codename Catalina

    Tomcat 5.0 New SpecsTomcat 5.5 2nd Rewrite Performance

    Tomcat 6.0 New Specs, New Cool Features

  • 8/3/2019 Intro to Tomcat6

    7/35

    7

    History

    Actively developed

    In average 1 release/month

    10+ active committers600.000 downloads/month (not countingmirrors)

  • 8/3/2019 Intro to Tomcat6

    8/35

    8

    Versioning

    Servlet/

    JSP Spec

    Tomcat

    version JDK Version

    2.5 2.1 6.0.x JDK 1.5+

    2.4 2.0 5.0.x, 5.5.x JDK 1.4+

    2.3 1.2 4.1.x JDK 1.3+

    2.2 1.1 3.3.x JDK 1.2+ (?)

  • 8/3/2019 Intro to Tomcat6

    9/35

    9

    Development Lifecycle

    Development mainly driven by

    JSR Specifications

    Servlet

    JSPExpression Language

    Competitor Features

    Committer Ideas

    User Ideas

  • 8/3/2019 Intro to Tomcat6

    10/35

    10

    Development Lifecycle

    Committers work on areas of personal

    interestNo corporate driving force

    Most Committers are sponsored by theiremployer to work on Tomcat

    Employer respects the time as ASF hat

    Commit-Then-Review

    Check in what youve done, if its wrong

    someone will complain

  • 8/3/2019 Intro to Tomcat6

    11/35

    11

    Development Lifecycle

    Larger changes are discussed on mailinglist until consensus has been reached

    Most commits are reviewed, few are everslipped in without review

    Rarely are timelines for features discussed

  • 8/3/2019 Intro to Tomcat6

    12/35

    12

    Release Process

    Average 1 release per month

    Across all versions

    Release managed by release manager

    Volunteer within the committercommunity

    Release scheduled whenenough has been done

    Important security issues are discovered

    and fixed

  • 8/3/2019 Intro to Tomcat6

    13/35

    13

    Release Process

    What dictates stable releaseAll TCK tests pass

    Around 500 test cases

    Candidate binaries have been tested bycommunity in various environments andfeedback has been received

    3x +1 votes during a stability vote

  • 8/3/2019 Intro to Tomcat6

    14/35

    14

    Tomcat 6 Whats New

    New Servlet Spechttp://java.sun.com/products/servlet/

    Maintenance release

    Mostly clarifications

    Requires minimum JDK 1.5

    Must support annotationsweb.xml is no longer required

    And other minor changes

    http://java.sun.com/products/servlet/http://java.sun.com/products/servlet/
  • 8/3/2019 Intro to Tomcat6

    15/35

    15

    Tomcat 6 Whats New

    Annotations support

    Alternatives to some XML entries in web.xml

    @Resource:Class or variable resource injection request

    @Resources:

    Similar as@Resource

    but holds the array or@Resourceannotations

    @RunAs:

    Used to replace entries in web.xml@DeclareRoles:Alternative to in web.xml

    Come from JSR 250 (Common Annotations forthe Java Platform)

  • 8/3/2019 Intro to Tomcat6

    16/35

    16

    Tomcat 6 Whats New

    Away with web.xmlFile is no longer required to be awebapp

    All you need is war file or directory in thewebapps dir

  • 8/3/2019 Intro to Tomcat6

    17/35

    17

    Tomcat 6 Whats New

    New JSP Spec

    http://java.sun.com/products/jsp/

    New unified expression language

    And it has its own specJspApplicationContext

    New TLD handling (deferredexpressions)

    Annotations

    Resource Injection

    http://java.sun.com/products/jsp/http://java.sun.com/products/jsp/
  • 8/3/2019 Intro to Tomcat6

    18/35

    18

    Tomcat 6 Whats New

    Shared (Injectable) Thread Pool Support

    server.xml

  • 8/3/2019 Intro to Tomcat6

    19/35

    19

    Tomcat 6 Whats New

    New Java NIO Connector

  • 8/3/2019 Intro to Tomcat6

    20/35

    20

    Tomcat 6 Whats New

    Allow multiple url-pattern in servlet-mapping

    OneFancyServlet

    /foo/*

    /bar/*

  • 8/3/2019 Intro to Tomcat6

    21/35

    21

    Tomcat 6 Whats New

    Smaller logging framework

    Tomcat JULIBased on java.util.logging

    Can be replaced with commons-loggingadapter (built through ant f extras.xml)

    Maven repo

    Currently using ASF staging repoOnce some quirks are fixed, all usefulTomcat jars will be deployed to ASFmain maven repo

  • 8/3/2019 Intro to Tomcat6

    22/35

    22

    Tomcat 6 Whats New

    New subversion layout

    Simple tobuild yourself

    Reduced distrosize

    Removal of

    obsolete items

  • 8/3/2019 Intro to Tomcat6

    23/35

    23

    Tomcat 6 Whats New

    How to build yourself

    1. JDK 1.5, ant and svn installed

    2. svn co

    http://svn.apache.org/repos/asf/tomcat/tc6.0.x/tr

    unk trunk

    3. cd trunk4. ant download

    5. ant

    Binaries in trunk/output/buildDownloads into /usr/share/java

    Change in build.properties.default

  • 8/3/2019 Intro to Tomcat6

    24/35

    24

    Tomcat 6 Whats New

    New distribution layout

    common/*, server/*, shared/* are gone

    Replaced by lib

    ClassLoader directories can still beconfigured throughconf/catalina.properties

    Windows Service Wrapper available in 32and 64 bit formats

    Distributions are smaller

  • 8/3/2019 Intro to Tomcat6

    25/35

    25

    Tomcat 6 Whats New

    Web Services support (JSR 109)

    Tomcat provides factories for JSR 109which may be used to resolve webservices references.Place the generated catalina-ws.jar as well as jaxrpc.jarand wsdl4j.jar (or anotherimplementation of JSR 109)in the Tomcat /lib/ folder.

  • 8/3/2019 Intro to Tomcat6

    26/35

    26

    Tomcat 6 Whats New

    Windows InstallerInstalls and setup the Tomcat as a Windows service

    Optionally download native tcnative-1.dll component

    located at heanet.ie

  • 8/3/2019 Intro to Tomcat6

    27/35

    27

    Tomcat 6 Quickies

    Comet aka Zero Latency HTTP

    Ability to do server push instead of thetraditional client poll

    Keeps connection openAbility to be handled asynchronously

    Single thread thousands ofconnections

    Servlet that implements

    CometProcessor interface

  • 8/3/2019 Intro to Tomcat6

    28/35

    28

    Tomcat 6 Quickies

    Different Connectors

    HTTP Connector protocol=o.a.coyote.http11.Http11Protocolo.a.coyote.http11.Http11AprProtocolo.a.coyote.http11.Http11NioProtocol

    HTTP/1.1 aliased to Http11 and Http11AprDepending on PATH or LD_LIBRARY_PATHsettings

    AJP Connectororg.apache.jk.server.JkCoyoteHandlerorg.apache.coyote.ajp.AjpAprProtocolAJP/1.3 aliased to the two above

    Depending on PATH or LD_LIBRARY_PATHsettings

  • 8/3/2019 Intro to Tomcat6

    29/35

    29

    Tomcat 6 - Quickies

    log4j support

    ant f extras.xml

    cp output/extras/tomcat-juli.jar to

    /bin (replace)cp output/extras/tomcat-juli-adapters.jar to/lib

    For log4j

    cp log4j.jar to /lib

    cp log4j.properties to /lib

  • 8/3/2019 Intro to Tomcat6

    30/35

    30

    Tomcat 6 - Quickies

    Additional Windows Service Support

    Java Service WrapperIndependent from ASF

    Additional features that are not available

    with Tomcats wrapper (like threaddumps)

    http://wrapper.tanukisoftware.org/Sample install/download

    http://people.apache.org/~fhanik/wrapper.html

    T t 6

    http://wrapper.tanukisoftware.org/http://wrapper.tanukisoftware.org/
  • 8/3/2019 Intro to Tomcat6

    31/35

    31

    Tomcat 6 In the Enterprise

    Fully supported by CovalentCovered under existing Tomcat supportplans

    Currently support ASF version

    Next major ERS will include Tomcat 6

    6.0.13 or higher is right around the corner

    T t 6

  • 8/3/2019 Intro to Tomcat6

    32/35

    32

    Tomcat 6 In the Enterprise

    Tomcat 6 is not a rewriteStability and Performance improvementsfrom 5.5

    6.0 is slowly becoming maintenance branch

    Only new features around Comet are goinginto 6.0.x

    6.x has not yet been mapped out

  • 8/3/2019 Intro to Tomcat6

    33/35

    33

    Upgrading to Tomcat 6

    Easy from 5.0 and 5.5

    Almost seamlessJust mind any extra additions you might haveadded into commons/lib, shared/lib etc

    Harder from 3.3 and 4.1Major spec changes

    Major layout changes

    Recommendation

    Start with fresh 6.0 server.xml, dont reuseyour old one

    Same for other Tomcat config files

  • 8/3/2019 Intro to Tomcat6

    34/35

    34

    Thank You

    [email protected]

    For support information contact Covalent

    [email protected],[email protected]

    www.covalent.com

    800/444-1935 or 925/974-8800

    Question and Answer time!!

    mailto:[email protected]:[email protected]:[email protected]://www.covalent.com/http://www.covalent.com/mailto:[email protected]:[email protected]:[email protected]
  • 8/3/2019 Intro to Tomcat6

    35/35

    35

    The Most Trusted Sourcefor Complete Enterprise Open Source Solutions