IBM WebSphere Application Server V8.5
© 2013 IBM Corporation 2
Overview
What is WebSphere Application Server Liberty Profile?
A new flexible dynamic profile of WAS which is focused FIRST on the development experience.
– Fast
– Lightweight
– Simplified Configuration
Fidelity with full-profile WAS
– But radically refactored to focus on the development experience
© 2013 IBM Corporation 4
What is WebSphere Application Server Liberty Profile?
Support for Liberty Profile in Rational Application Developer
– Enterprise development - advanced programming, cloud, collaboration, and quality tools – Available stand-alone or bundled in WAS - Tools Edition
and WAS Network Deployment - Tools Edition
Support for Liberty Profile in WebSphere Application Server Development Tools for Eclipse – Subset of RAD focused on core programming models
– Simple Eclipse feature update for Eclipse 3.6 (Helios) or 3.7 (Indigo) – Available on Eclipse Marketplace for Eclipse Juno, Kepler
– Available unsupported at no charge, or supported for a fee – WAS for Developers – Tools Edition for Eclipse
Development tools can install the runtime.
Additional platform support for z/OS - runtime only, i5/OS
and Mac OS runtime & tools (development only not supported for production)
Usage scenarios
© 2013 IBM Corporation 6
Installation options
WebSphere Application Server Developer Tools in RTC or Eclipse
Archive Install
Installation Manager
WAS Liberty installation using Eclipse Marketplace
© 2013 IBM Corporation 8
Create a lightweight WAS server in WebSphere Developer Tools
Create a lightweight WAS server
configuration in seconds
Simplified server configuration
Simplest case: one XML file
for all server configuration
Editable within the
workspace
Exportable, shareable,
versionable
ws-security.xml server.xml etc. resources.xmlX
No need for Admin Console, wsadmin,
or enhanced EARs
© 2013 IBM Corporation 10
Simplified server configuration
<server>
<featureManager>
<feature>jsp-2.2</feature>
<feature>jdbc-4.0</feature>
</featureManager>
<logging trace.specification="webcontainer=all=enabled:*=info=enabled" />
<application type="war" id="tradelite" name="tradelite" location="tradelite.war" />
<jdbcDriver id="DerbyEmbedded" libraryRef="DerbyLib"/> <library filesetRef="DerbyFileset" id="DerbyLib"/>
<fileset dir="${shared.resource.dir}/derby" id="DerbyFileset" includes="derby.jar"/>
<dataSource id="DefaultDatasource" jdbcDriverRef="DerbyEmbedded" jndiName="DefaultDatasource">
<properties createDatabase="create" databaseName="${shared.resource.dir}/data/product"/> </dataSource>
</server>
features control which capabilities (bundles) are installed in the server
'singleton' configurations specify properties for a runtime service like logging
'instance' configurations specify multiple resources like applications and datasource definitions
Any of this configuration could be put into a separate xml file and 'included' in this 'master' configuration file
Flexible configuration
Shareable configuration snippets <server>
...
<include location="http://cfgserver/global.xml" />
<include location="${shared.config.dir}/global.xml" /> <server>
server.xml
Configuration can be componentized at any level of granularity, from one file to many (update configuration for thousands of servers by one xml file change)(
Can use WDT to associate configuration snippets with a server configuration.
Visualization through WDT tools as a single logical view.
© 2013 IBM Corporation 12
Highly composable runtime based on “features”
runtime services config model Java EE support WAS Extensions
Full WAS profile Liberty profile
runtime (osgi) services http transport webcontainer app manager jsp jsf
runtime (osgi) services http transport webcontainer app manager app security servlet-3.0 jsf-2.0 appSecurity-1.0
Dynamic runtime
features
apps
resources
server.xml
Liberty runtime
application
application
application
dropins location
config updates feature updates app updates© 2013 IBM Corporation 14
Flexible Configuration
Configuration defaults are specified by contributing features
Configuration by exception – any property can be overridden in user-specified server config
Config can be changed dynamically, changes are “observed” and are injected back into the
contributing feature immediately
server runtime
bundle
(for example transaction support) t config metadata config defaults OSGi metadataclasses
mbeans
id=com.ibm.ws.transaction name=transaction attribute id=timeout default=100<
server
>
<
featureManager
>
<
feature
>
servlet-3.0
</
feature
>
<
feature
>
transaction-1.1
</
feature
>
</
featureManage
>
<
transaction
timeout
=
"30"
/>
<
server
>
Liberty profile for i
iAdmin command
– supports operating a Liberty profile server on the IBM® i platform – wlp/lib/native/os400/bin
iAdmin task [options] – task could be:
• POSTINSTALL – configures server to run in QWAS85 subsystem • PREUNINSTALL – removes objects created by POSTINSTALL • GRANTAUTH – grants QEJBSVR user necessary permissions – options
• Required only for GRANTAUTH task • --userprofilename QEJBSVR
• Optional for GRANTAUTH (ignored by other tasks)
• --outputdir wlp_user_dir – directory for server generated files • --rolename role_name – the only supported role is server • --userdir wlp_user_dir – shared resources directory
© 2013 IBM Corporation 16
Deployment options
An “Embedded Server” profile is a production instance of the configured Liberty server type. – Package the application, configuration and server you just tested into an archive file.
• server package server_name --archive=package_file_name.zip --include=all – Application centric – server pre-configured for a specific application.
Deployment of applications
Drag & drop
– dropins directory
• ${server.config.dir}/dropins
– Place the archive file with its identifying suffix (ear, war, wab, and so on) directly into the /dropin
Add to server configuration file
<application context-root="helloworld" type="war" id="helloworld" location="helloworld.war" name="helloworld"/>
Context root is determined in the following precedence: – context-root in the server.xml file
– application.xml, if an EAR application – ibm-web-ext.xml, if a web application
– name of the application in the server.xml file, if a web application – Manifest.MF, if a WAB application
© 2013 IBM Corporation
JVM properties
File jvm.options
– jvm-specific start options • for example -X arguments – One option per line
${wlp.install.dir}/etc/jvm.options – Settings apply for all servers
${server.config.dir}/jvm.options
Starting and stopping server from command line
server command in ${wlp.install.dir}/bin directory
server start <servername> – Start server in background
server run <servername> – Start server in foreground
– Write console output to the window – Ctrl+c or kill to stop the server
server debug <servername> – Start server in debug mode
server stop <servername> – Stops the server
server status <servername>
© 2013 IBM Corporation
Maven support
Maven plug-in for the Liberty profile <pluginRepository> <id>Liberty</id> <name>Liberty Repository</name> <url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url> <layout>default</layout> <snapshots> <enabled>false</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </pluginRepository>
Since 15.4.2014 liberty-maven-plugin available in central repository
Maven tasks (goals)
– liberty:start-server goal to start a Liberty profile server in the file system – liberty:create-server goal to create a Liberty profile server
– liberty:package-server goal to package a Liberty profile server – liberty:stop-server goal to stop a Liberty profile server
– liberty:deploy goal to deploy an application to a Liberty profile server
– liberty:undeploy goal to remove an application from a Liberty profile server – liberty:install-apps goal to copy one or more applications to a Liberty profile
Configuration variables
wlp.install.dir
– Profile’s installation directory
wlp.user.dir
– Root of the tree containing user configuration – ${wlp.install.dir}/usr
server.config.dir
– Server configuration directory contains the server.xml file and any other optional configuration files – ${wlp.user.dir}/servers/serverName
server.output.dir
– Resources generated by the server, such as logs
shared.app.dir
– Shared user applications directory – ${wlp.user.dir}/shared/apps
shared.config.dir
– Shared user configuration directory – ${wlp.user.dir}/shared/config
shared.resource.dir
© 2013 IBM Corporation
Instalace a konfigurace WAS
Instalace a konfigurace WAS
Liberty Profile
Příprava prostředí
Instalace Java SE 6 nebo 7
– Kontrola zda je Java nainstalovaná: • java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing) – Např.: C:\apps\jdk1.6.0_29\jre\
© 2013 IBM Corporation
Instalace Liberty Profile runtime (non-Eclipse)
Instalační soubory jsou k dispozici na URL:
– https://www.ibmdw.net/wasdev/downloads/liberty-profile-using-non-eclipse-environments/
Instalace WebSphere Application Server V8.5.5.2 Liberty Profile – archive packaging – Runtime (Liberty core)
• java -jar jméno_developer_runtime_jar_souboru
– Extended (podpora JMS, Web services, MongoDB, atd.)
• Rozbalit extended jar do stejného umístění jako runtime (core)
Vytvoření servru
– Z adresáře wlp/bin
• server create jméno-serveru
– Server je vytvořen v adresáři
• wlp/usr/servers/jméno-serveru – Start server
• Na pozadí:
• server start jméno-serveru
nebo interaktivně:
Konfigurace servru
Konfigurace servru – Adresář ${server.config.dir} • usr/servers/jméno-serveru – Konfigurační soubor • server.xml – Nastavení JAVA_HOME• V adresáři ${server.config.dir} soubor server.env s řádkem • JAVA_HOME=cesta_k_JDK
© 2013 IBM Corporation
Instalace krok za krokem
Start command prompt
PATH=%PATH%;C:\apps\jdk1.6.0_29\jre\bin cd C:\common\liberty\was
java -jar wlp-developers-runtime-8.5.5.2.jar
– dvakrát zadat x a enter – 1 (Agree) a enter
– Target directory for product files? • C:\common\liberty\cviceni
java -jar wlp-developers-extended-8.5.5.2.jar
– dvakrát zadat x a enter – 1 (Agree) a enter
– Target directory for product files? • C:\common\liberty\cviceni
Vytvoření a konfigurace serveru
Vytvoření
Z command promptu
cd C:\common\liberty\cviceni\wlp\bin server create kurdejov
Konfigurace
Otevřít v text editoru soubor
C:\common\liberty\cviceni\wlp\usr\servers\kurdejov\server.xml
Přidat features – jsp-2.2
– monitor-1.0
– localConnector-1.0
© 2013 IBM Corporation
Vytvoření a konfigurace serveru - pokračování
Nastavení JAVA_HOME
– Vytvořit soubor server.env v adresáři
C:\common\liberty\cviceni\wlp\usr\servers\kurdejov
Do souboru server.env vložit následující řádek – JAVA_HOME=C:\apps\jdk1.6.0_29\jre
Start serveru v interaktivním módu
– cd C:\common\liberty\cviceni\wlp\bin – server run kurdejov
Deployment ukázkové aplikace
Nakopírujte soubor liberty-monitor.war do adresáře
– C:\common\liberty\cviceni\wlp\usr\servers\kurdejov\dropins
Otevřete internet browser a zadejte URL
© 2013 IBM Corporation
Liberty v Eclipse
Instalace/spuštění Eclipse
– Rozbalit soubor eclipse-jee-kepler-SR2-win32.zip do adresáře
• C:\common\liberty\cviceni\eclipse-jee-kepler-SR2-win32 – Spustit • C:\common\liberty\cviceni\eclipse-jee-kepler-SR2-win32\eclipse\eclipse.exe – Zvolit workspace • C:\common\liberty\cviceni\workspace – Otevřít workbench
Instalace WDT do Eclipse (vyžaduje přístup na Internet)
Help - Eclispe Marketplace... – Find “Liberty”
– Nainstalovat
IBM WAS 8.5.5 Liberty Developer Tools for Eclipse – Restart Eclipse
Liberty v Eclipse
Konfigurace již vytvořeného WAS Liberty Profile serveru v Eclipse
Záložka Servers – New – Server – WAS 8.5 Liberty Profile
Path
© 2013 IBM Corporation
Závěr
Dokumentace – http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.wlp.nd.doc/ae /twlp_setup.html?cp=SSAW57_8.5.5%2F1-6-0 Zajímavé odkazy– WebSphere Liberty Profile demo: the remote control house
•
https://www.ibm.com/developerworks/community/blogs/video-portal/entry/new_websphere_liberty_profile_demo_the_remote_control_house? lang=en
– Liberty controlled car