F428435966 odtug   web-logic for developers
Upcoming SlideShare
Loading in...5
×
 

F428435966 odtug web-logic for developers

on

  • 1,542 views

http://pindao.huoban.taobao.com/tms/channel/electric.htm?pid=mm_24766140_0_0&eventid=101333

http://pindao.huoban.taobao.com/tms/channel/electric.htm?pid=mm_24766140_0_0&eventid=101333

Statistics

Views

Total Views
1,542
Views on SlideShare
1,542
Embed Views
0

Actions

Likes
0
Downloads
96
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

F428435966 odtug   web-logic for developers F428435966 odtug web-logic for developers Presentation Transcript

  • WebLogic Server 11g for ADF/Forms Developers Mark Prichard Java Platform Group, Oracle Fusion Middleware mark.prichard@oracle.com
  • The following is intended to outline our generalproduct direction. It is intended for informationpurposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • Oracle WebLogic Suite Strategic Runtime Across Oracle Product Lines Java EE/ISV SOA WebCenter Content Identity Business Apps Suite Suite Management Management Intelligence Suite Suite Suite WebLogic Suite WebLogic ServerEnterprise Manager Admin and Operations Development Tools Java EE: Reliability, Availability, Scalability & Performance JDeveloper/Eclipse Coherence High Performance, Reliable, Scale Out for Java, C++ and .NET JRockit Real Time High Performance JVM with Extreme Low Latency Proven to Best forOutperform Oracle Portfolio Lowest Cost of Operations
  • Integrated WebLogic Server•  http://localhost:7101/console/•  Log on with weblogic/weblogic1•  C:Documents and Settings<user>Application DataJDeveloper... DefaultDomainbin•  (debug) -agentlib:jdwp=transport=dt_socket,server=y,address=1446
  • Domains and Servers•  What is a domain? –  a logically related group of WebLogic Server instances that you manage from a single set of configuration artifacts.•  What’s in a domain? –  Servers –  Clusters of servers•  What is a WebLogic Server instance? –  A configured instance to host applications and resources •  WebApps, Enterprise Apps, Web Services, … •  JMS, JDBC, Diagnostics, …•  What types of servers are there? –  Administration Server –  Managed Server
  • Creating/Copying a WebLogic Domain•  Configuration wizard: include at least Oracle JRF•  Many ways to copy a domain: domain template builder, pack/unpack, WebLogic Scripting Tool …
  • The Administration Server•  What is it? –  Central configuration controller for the entire domain•  What else does it do? –  Hosts the Administration Console –  Enables you to start and stop servers from a central location –  Enables you to migrate servers and services within the domain –  Enables you to deploy applications within the domain•  Guidelines: –  There must be exactly one* Administration Server in domain –  An Administration Server controls only one domain. –  For production use, we recommend not hosting application logic or resources on the Administration Server
  • Managed Servers•  What is it? – A running instance that hosts applications and resources needed by those applications - The real work horses in a WebLogic domain – Each Managed Server is independent of all other Managed Servers in the domain (unless they are in a cluster, defined later) – You can have as many Managed Servers in a domain as you need – Individual Managed Servers are typically added for capacity and application isolation
  • Managed Server Startup•  The Administration Server stores the master copy of the domain configuration, including the configuration for all managed servers in the domain•  Each Managed Server stores a local copy of its configuration.•  When a Managed Server starts, it connects to the Administration Server to synchronize the configuration•  When configuration is changed, the Administration Server sends changed configuration to Managed Servers•  How do I start a Managed Server? –  With an Admin Server –  In “Independence Mode”
  • Clusters and Machines•  A cluster is a group of Managed Servers running simultaneously and working together to provide increased scalability and reliability•  A cluster appears as a single instance to most clients.•  Clusters enable some advanced features, such as Whole Server Migration, Service Migration, and clustered JMS destinations.•  A machine definition is used to associate a computer with the Managed Servers it hosts.•  Used by Node Manager in restarting a failed Managed Server•  Used by a clustered Managed Server in selecting the best location for storing replicated session data
  • Load Balancing in a Cluster•  For JSPs and Servlets: load balancing is external –  Web server proxy plug-in (round robin) –  HTTP Proxy servlet (i.e., using WLS as a load balancer) –  3rd party hw or sw load balancer•  EJBs and RMI Objects: load balancing is done at connection –  Objects are cluster-aware –  Load balancing algorithm is stored in the clustered object’s stub –  Objects are available on all cluster members; remote objects connect/use according the LB algorithm in the stub –  Load balancing algorithms: Round robin, weighted, random, server affinity
  • Failover in a Cluster•  Servlets and JSPs: – HTTP session state is replicated to a secondary server in the cluster or to a database•  EJBs and RMI Objects: – Replicas available throughout the cluster – Exceptions caught and retried on another instance – For Stateful Session Beans, state is replicated on a secondary server
  • WebLogic Node Manager•  Utility/process running on a physical server that enables you to start, stop, suspend, and restart WebLogic Server instances remotely•  Must run on each physical server that hosts WebLogic Server instances that you want to control with Node Manager•  Not associated with a domain. Can start any server instance that resides on the same physical server.•  Optional, but required to start/stop servers using the Administration Console•  Required for Whole Server Migration and for some configurations of Automatic Service Migration•  Demo: How do I configure Node Manager?
  • WebLogic Scripting Tool (WLST)•  Scripting tool for administering a domain (create, configure, manage, monitor, deploy applications)•  Based on Jython – pure Java implementation of Python•  Great for automating repetitive tasks•  Heavily used by customers and within BEA•  Example: How does JDev shut down the Integrated WebLogic Server instance?
  • WLST: Connection Modes•  Offline: analogous to the Configuration Wizard –  Uses the Offline Configuration Framework •  Also used by the Configuration Wizard •  Consistent results when using either tool –  read and write access to the configuration data that is persisted in the domain’s config directory or in a domain template JAR –  Intended to create a domain or modify a non-running domain –  Used during WLS install to create samples domains•  Online: analogous to the Administration Console –  JMX client –  Interacts with a server’s MBeans –  Intended as a runtime management tool:
  • WSLT with OEPE 11.1.1.6
  • WLST – with SSL + Custom Trustjava -Dweblogic.security.TrustKeyStore=CustomTrust - Dweblogic.security.CustomTrustKeyStoreFileName=/home/ oracle/security/labTrustKeystore.jks - Dweblogic.security.CustomTrustKeystoreType=JKS - Dweblogic.security.CustomTrustKeyStorePassPhrase=labpassw ord weblogic.WLSTwls:/offline> nmConnect (oracle,oracle1,node1.localdomain, 5556,labDomain,/home/oracle/wls1032/user_projects/ domains/labDomain,ssl)wls:/nm/labDomain> storeUserConfig (nm_user.config,nm_user.key,nm=true)wls:/offline> nmConnect(userConfigFile=‘<path>/ nm_user.config,userKeyFile=‘<path>/ nm_user.key,host=node1.localdomain,port=5556,domainNam e=labDomain,domainDir=‘<path>/labDomain,mType=ssl)
  • Java Keystores for Dev/Test[oracle@node1 security]$ java utils.CertGen -certfile labcert1 -keyfile labkey1 -keyfilepass labkeypass -cn "node1.localdomain" -o "MyOrganization" -ou "FOR TESTING ONLY" -keyusage digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment,keyAgre ement[oracle@node1 security]$ cp /home/oracle/wls1032/wlserver_10.3/server/lib/ CertGenCA.der .[oracle@node1 security]$ java utils.der2pem CertGenCA.der[oracle@node1 security]$ cat labcert1.pem CertGenCA.pem > cert1.pem[oracle@node1 security]$ mv cert1.pem labcert1.pem[oracle@node1 security]$ keytool -printcert -file labcert1.pem[oracle@node1 security]$ java utils.ImportPrivateKey -keystore labIdentityKeystore.jks -storepass labpassword -alias labalias1 -keypass labaliaspass -certfile labcert1.pem -keyfile labkey1.pem -keyfilepass labkeypass[oracle@node1 security]$ java utils.ImportPrivateKey -keystore labIdentityKeystore.jks -storepass labpassword -alias labalias1 -keypass labaliaspass -certfile labcert1.pem -keyfile labkey1.pem -keyfilepass labkeypassTrust this certificate? [no]: yes
  • Shared Libraries and Class Loaders•  Shared Libraries used extensively by Oracle Applications –  JRF, ADF, APPLCORE, etc –  Applications explicitly declare a dependency on shared libraries•  Understanding Shared Libraries is critical to avoiding Class Loader related issues
  • Application shared libraries App-1.ear App-lib.ear App-2.ear my-web-1.war my-web-3.war my-web-2.war my-ejb-1.jar my-ejb-2.jarDeployment viewRuntime view App-1.ear App-2.ear my-web-1.war my-web-2.war my-ejb-1.jar my-ejb-2.jar my-web-3.war my-web-3.war
  • Webapp shared libraries webapp-1.warWEB-INF/web.xml webapp-1.warWEB-INF/lib/x.jar foo.jsp bar.jsp WEB-INF/web.xml* WEB-INF/lib/x.jar WEB-INF/lib/y.jar foo.jsp bar.jsp a.jspWEB-INF/web.xml b.html Deployment viewWEB-INF/lib/y.jar Runtime view a.jsp b.html webapp-lib.war
  • Jar libraries App-1.ear my-web-1.war library.jar my-web-2.war my-ejb-1.jar•  Jar files and Jar libraries can be referenced from applications (EAR, WAR, JAR) via MANIFEST classpath or descriptors.
  • Preview – Classloader Analysis Tool•  Used internally for several releases•  Will be shipped and supported with PS3•  Provided as web-app (wls-cat.war)•  On-demand deployment (dev mode only)•  URLs allow customization•  Functionality: –  View classloader hierarchies and entire classpath for each classloader –  Analyze classpath conflicts (filtering classloader hints) –  Search for a class/resource on a classloader –  View class definitions, interfaces
  • Preview – Classloader Analysis Tool
  • WebLogic Diagnostic Framework PullLog File Event • WLST API Collector Accessor • JMX API • WLDF Dashboard ArchiverMBean Property Harvester Push • SNMP Trap Watcher • JMS Message Notifier Code • JMX Notification Instrumentor • SMTP Email • Diagnostic Image JRockit Flight Recorder JRockit Buffer Mission Control Capture Process Expose Retrieve
  • WLDF/JFR Integration Architecture WLST, Console, EJB WebApp JDBC JTA WS Etc…WLDF Watch/Notification WLDF Instrumentation Configuration (Instrumented at Build Time) WLDF Instrumentation EngineWLST Image Manager WLDF Monitors and Action Groups WLDF Flight Recorder Instrumentation Extension Image Source WLDF Flight Recorder Actions Extension Actions JRFR Consumer API JRFR Producer API JRockit Flight Recorder Diagnostic Image File Extension Data With Flight Recorder Data Diagnostic Image File Without Flight Recorder DataExtension supplied JRockit Supplied WLDF File/Artifact Available if JRockit is Used
  • WLDF User-defined Pointcuts<wldf-instrumentation-monitor> <name>Trace_Servlet_Around_Service</name> <action>TraceElapsedTimeAction</action> <location-type>around</location-type> <pointcut> execution(* +javax.servlet.Servlet service(+javax.servlet.ServletRequest, +javax.servlet.ServletResponse))‫‏‬ OR execution(* +javax.servlet.http.HttpServlet doPost(+javax.servlet.ServletRequest, +javax.servlet.ServletResponse))‫‏‬ OR execution(* +javax.servlet.http.HttpServlet doGet(+javax.servlet.ServletRequest, +javax.servlet.ServletResponse)) </pointcut></wldf-instrumentation-monitor>
  • WLS 10.3.3, JFR R28 and JRMC 4.0.1 “Quick Start Guide”•  Turn on JFR default recording –  -XX:FlightRecorderOptions=defaultrecording=true –  Flight recorder command line documentation•  Configure WLS to use Platform MBean Server –  Admin console: domain->configuration->general tab (Advanced) –  Check Platform MBean Server Enabled (default in 10.3.3) –  Check Platform MBean Server Used (off by default) –  NB: Platform MBean Server security –  -
  • Working with JRockit Flight Recorder•  Start JRMC, connect to WLS•  Configure WLS Diagnostic Volume (admin console: server->configuration->general, “High”)•  Right mouse, select “Dump Default Recording”
  • JRMC + Flight Recorder
  • WebLogic Server MBeansvia Platform MBean Server + JRMC
  • Preview – WebLogic Maven Plugin•  WebLogic Maven Plugin –  PS3: supports weblogic.Deployer functionality •  weblogic:deploy •  weblogic:undeploy •  weblogic:redeploy •  weblogic:update-app •  weblogic:start-app •  weblogic:stop-app •  weblogic:list-apps –  Same parameters as weblogic.Deployer –  Other WLS Maven functionality planned for post-PS3
  • Preview – WebLogic Maven Plugin•  Build plugin jar file with wljarbuilder.jar java -jar wljarbuilder.jar -profile weblogic-maven-plugin•  Install to local Maven repository mvn install:install-file -Dfile=<path>/weblogic-maven-plugin.jar - DgroupId=com.oracle.weblogic -DartifactId=weblogic-maven-plugin - Dpackaging=maven-plugin -Dversion=10.3.4 -DgeneratePom=true•  Add to Maven settings.xml <pluginGroups> <pluginGroup>com.oracle.weblogic</pluginGroup> </pluginGroups>•  Maven co-ordinates <groupid>com.oracle.weblogic</groupid> <artifactid>weblogic-maven-plugin</artifactid> <version>10.3.4</version>
  • Maven example pom.xml (excerpt)<plugin><groupId>com.oracle.weblogic</groupId> <artifactId>weblogic-maven-plugin</artifactId> <version>10.3.4</version> <configuration> <adminurl>${wls.adminurl}</adminurl> <user>${wls.user}</user> <password>${wls.password}</password> <upload>false</upload> <action>deploy</action> <remote>false</remote> <verbose>true</verbose> <source>${project.build.directory}/${project.build.finalName}. ${project.packaging}</source> <name>${project.build.finalName}</name> </configuration></plugin>
  • Using Eclipse/OEPE with m2eclipse•  Third-party m2eclipse plugin provides Maven support for OEPE/Eclipse•  POM editor, dependency graphs, repo browser, mvn tasks
  • Example: Eclipse/OEPE with the m2eclipse plugin
  • 37