IBM WebSphere Application Server V8.5 Liberty Profile
Overview 2
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 Initially focused on development and test of web, mobile and OSGi apps. 3
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) Choice of either Oracle or IBM s Java (where available) 4
Usage scenarios 5
Installation options WebSphere Application Server Developer Tools in RTC or Eclipse Archive Install Installation Manager Maven Repository 6
WAS Liberty installation using Eclipse Marketplace Help > Eclipse Marketplace
Create a lightweight WAS server in WebSphere Developer Tools Create a lightweight WAS server configuration in seconds 8
Simplified server configuration Simplest case: one XML file for all server configuration Editable within the workspace Exportable, shareable, versionable No need for Admin Console, wsadmin, or enhanced EARs 9 X resources.xml server.xml etc. ws-security.xml
Simplified server configuration <server> <featuremanager> features control which capabilities (bundles) are installed in the server <feature>jsp-2.2</feature> <feature>jdbc-4.0</feature> 'singleton' configurations specify properties for a runtime service like logging </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> 10 '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. Team development: keep the application and configuration components together. 11
Highly composable runtime based on features WAS Extensions Java EE support jsf-2.0 appsecurity-1.0 servlet-3.0 runtime services config model jsf jsp app security webcontainer webcontainer http transport app manager http transport runtime (osgi) services Full WAS profile 12 app manager runtime (osgi) services Liberty profile
Dynamic runtime application features apps resources application application dropins location server.xml config updates feature updates app updates Liberty runtime 13
Flexible Configuration mbeans 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 t <server> <featuremanager> <feature>servlet-3.0</feature> <feature>transaction-1.1</feature> </featuremanage> <transaction timeout="30" /> <server> OSGi metadata config defaults classes config metadata server runtime bundle (for example transaction support) id=com.ibm.ws.transaction name=transaction attribute id=timeout default=100 server.xml 14
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
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. 16
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 Directory name or the file name relative to the "dropins" directory of the Liberty profile
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 Settings are specific to the server
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> Displays the current state of the server
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 server
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 Shared user resources directory ${wlp.user.dir}/shared/resources
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\
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ě: server run jméno-serveru
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
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 Uložit změny a zavřít text editor
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 http://localhost:9080/liberty-monitor/jvmstats.jsp
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-SR2win32\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 C:\common\liberty\cviceni\wlp
Konfigurace Liberty v Eclipse
Závěr Dokumentace http://www01.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/videoportal/entry/new_websphere_liberty_profile_demo_the_remote_control_house? lang=en Liberty controlled car https://developer.ibm.com/wasdev/2013/04/25/liberty_controlled_car/