taking weblogic thread dumps

33
Taking weblogic thread dumps Thread Dump will be printed to the servers standard out (by default, the shell in w is running) On Windows machine: cltr + break On Unix Machine: get pid using ps -ef grep java kill -3 (process id) When weblogic is running as windows service For Out file add in JAVA_O!"O#$% -&'eblogic $tdout Using beasvc : beasvc *du p * svcna e%,bea Ad in_server, Using Weblogic Admin utility %.bea.user_projects.do ains.r&o ain/java 'eblogic Ad in -url t3%00local1ost%2 -userna e 'eblogic -pass'ord 'eblogic !567A&_&89 Collecting thread dumps rom the console: $erver / 9onitoring / !1reads / &u p !1read $tacks Using W!"T: java 'eblogic :;$! connect(<'eblogic<=<'eblogic<=<t3%..local1ost%2 4<) t1read&u p() "cript to take thread dump prstat and pstack#

Upload: kumarrajgorrepati

Post on 01-Nov-2015

30 views

Category:

Documents


0 download

TRANSCRIPT

Taking weblogic thread dumps Thread Dump will be printed to the servers standard out (by default, the shell in which the server is running)On Windows machine:cltr + breakOn Unix Machine:get pid using ps -ef grep javakill -3 (process id) When weblogic is running as windows serviceFor Out file add in JAVA_OPTIONS:-Dweblogic.Stdout=Using beasvc :beasvc dump svcname:bea Admin_serverUsing Weblogic Admin utilityC:\bea\user_projects\domains\rDomain>java weblogic.Admin -url t3://localhost:7001 -username weblogic -password weblogic THREAD_DUMPCollecting thread dumps from the console:Server > Monitoring > Threads > Dump Thread StacksUsing WLST:java weblogic.WLSTconnect("weblogic","weblogic","t3:\\localhost:7001")threadDump()

Script to take thread dump prstat and pstack. ## Takes an argument (PID of the WLS process) and loops three times.# This will append the prstat information to a file called dump_high_cpu.txt.# The thread dump information will either be in file where stdout was redirected or printed on the screen.#if test $# -eq 0then echo "usage: $0 ";else for loopnum in 1 2 3 do echo `date` CURDATIME=`date '+%y%m%d_%H%M%S'` echo $CURDATIME prstat -L -p $1 1 1 >> ~/export/home/username/`hostname`_${CURDATIME}_$1.out pstack $1 >> ~/export/home/username/`hostname`_${CURDATIME}_$1.out kill -3 $1 echo "prstat, pstack, and thread dump done. #" $loopnum sleep 1 echo "Done sleeping." donefi

Thread states are R - Runnable, S - Suspended, CW- Conditional Wait, MW - Monitor wait. Tools to analyze thread dumps (downloads) 1. Samurai2. Thread dump analyzer. We need to look into quite a few parameters from the collected dump information. From prstat output we can get the LWP numbes and the corresponding cpu utilization of all of them.We can convert the LWP number from prstat to nid (hexadecimal value by using nawk or something similar)From the thread dump we can see the nid and look into the stack trace.In pstack output we can see the native stack of the lwp (from prstat output) or search for the tid from the thread dump. From the corresponding stack, look for the program counter number and map it to pmap output.

NodemanagerNodemanager is used to remotely start, stop and restart weblogic managed servers remotely. Nodemanager configuration files will be location in common/nodemanagerNodemanager configuration file /data/nodemanager/startup.properties Nodemanager configuration:nodemanager.propertiesis created in the directory where you start Node Manager the first time you start Node Manager after installation of WebLogic Server. Each time you start Node Manager, it looks fornodemanager.propertiesin the current directory, and creates the file if it does not exist in that directory. Start the nodemanager using startNodeManager.cmd (sh) in your server/bin directory.Configure machines and fill in the server start tab in the Admin console with necessary information. Now you can remotely start and stop servers using Admin console/WLST When we start manager it give all the configuration information on the screen as below: Configuration settings:NodeManagerHome=D:\bea\WLSERV~1.3\common\NODEMA~1ListenAddress=ListenPort=5556ListenBacklog=50SecureListener=trueAuthenticationEnabled=trueNativeVersionEnabled=trueCrashRecoveryEnabled=falseJavaHome=d:\bea\JROCKI~2\jreStartScriptEnabled=falseStopScriptEnabled=falseStartScriptName=startWebLogic.cmdStopScriptName=LogFile=D:\bea\WLSERV~1.3\common\NODEMA~1\nodemanager.logLogLevel=INFOLogLimit=0LogCount=1LogAppend=trueLogToStderr=trueLogFormatter=weblogic.nodemanager.server.LogFormatterDomainsFile=D:\bea\WLSERV~1.3\common\NODEMA~1\nodemanager.domainsDomainsFileEnabled=trueStateCheckInterval=500Domain name mappings:wl_server -> D:\bea\wlserver_10.3\samples\domains\wl_serverlab -> d:\bea\user_projects\domains\labmedrec -> D:\bea\wlserver_10.3\samples\domains\medrecUnder data/nodemanager (Example, C:\bea\user_projects\domains\new_domain\servers\new_ManagedServer_1\data\nodemanager) we can see startup.properties file for nodemanager. The boot.properties file is also copied here. The nm_password.properties is located under Domain_Home\config\nodemanagerUnder the monitoring tab of each machine, we can check if node manager is reachable of not. Else we can enroll nodemanager and this copies all security information to each managed server. Also file called new_ManagedServer_1.state,.lck, .pid etc., are created under the data/nodemanager of each managed server.Summary:nodemanager.propertiesThis is the configuration file used by the Java-based version of Node Manager.This file is located inWL_HOME/common/nodemanager.nodemanager.hostsThis file contains a list of all the trusted hosts that can issue commands to Node Manager.This file is located inWL_HOME/common/nodemanager.nodemanager.domainsThis file contains mappings between the names of domains managed by Node Manager and their corresponding directories.This file is located inWL_HOME/common/nodemanager.nm_data.propertiesThis file stores the encryption data the Node Manager uses a symmetric encryption key. The data is stored in encrypted form.This file is located inWL_HOME/common/nodemanager.nm_password.propertiesThis file stores a username/password pair specific to the Node Manager server that is managing this domain. This is known as the Node Manager secret. The username and password are appended to a salt value (obtained from the SerializedSystemIni.dat of the domain) and SHA-hashed.This file is located inDOMAIN_HOME/config/nodemanager.boot.propertiesNode Manager uses this file to specify a boot identity when starting a server. This file is located indomain-name/servers/server_name/data/nodemanager.startup.propertiesEach Managed Server instance has its ownstartup.propertiesfile with properties that control how Node Manager starts up and controls the server. Node Manager automatically creates this file by using properties passed to Node Manager when the Administrative Server was last used to start the server. This allows a Node Manager client or startup scripts to restart a Managed Server using the same properties last used by the Administrative Server.These properties correspond to the server startup attributes contained in ServerStartMBean and the health monitoring attributes in ServerStartMBean.This file is located in domain-name/servers/server_name/data/nodemanager.server_name.addrserver_name.addr stores the IP address added when a server starts or is migrated. This file is generated after the server IP address is successfully brought online during migration. server_name.addr is deleted when the IP address is brought offline. The server IP address is used to validate remove requests to prevent addresses being erroneously removed while shutting down the server.This file is located indomain-name/servers/server_name/data/nodemanager.server_name.lckserver_name.lckis generated by each server and contains an internally used lock ID.This file is located in domain-name/servers/server_name/data/nodemanagerserver_name.pidserver_name.pidis generated by each server and contains the process ID of the server. Node Manager checks the process ID generated by the server during crash recovery.This file is located in domain-name/servers/server_name/data/nodemanagerserver_name.stateserver_name.stateis generated by the server and contains the server's current state. Node Manager monitors the contents of this file to determine the current state of the server.Note:Do not delete or alter this file. Without this file Node Manager cannot determine the current state of the server.This file is located in domain-name/servers/server_name/data/nodemanager.

Thenm_password.propertiesfile contains the Node Manager username and password. These are used to authenticate connection between a client (for example, the Administration Server) and Node Manager. This username and password are only used to authenticate connections between Node Manager and clients.Thenodemanager.domainsfile specifies the domains that a Node Manager instance controls. When we add new machine to a node manager we need to use the following command to register the node manager.nmEnroll('C:/bea/user_projects/domains/prod_domain','C:/bea/wlserver_10.0/common/nodemanager')RunningnmEnroll()ensures that the correct Node Manager user and password token are supplied to each Managed Server. Once these are available for each Managed Server, you can usenmConnect()in a production environment.If Nmenroll failes for some reason, we need to copy SerializedsystemIni.dat and nm_password.properties from Admin server to the new remote server. Additionally we can add the domain name in nodemanager.domains file.

Starup and Shutdown :There are different ways to start and stop weblogic server.1. Through scripts2. Through Admin console or WLST / weblogic.Admin using nodemanager. Through scripts:startWebLogic.cmd is the script used to start the JVM with the necessary options. Its location in the DOMAIN_HOME\bin directory. This script without options will start the admin server.startManagedWebLogic.cmd/sh is used to start managed server. Example: startManagedWebLogic.cmd/sh managedserver1 http://localhost:7001Similarly stopManagedWebLogic.cmd/sh and stopWebLogic.cmd/sh are used to stop weblogic servers. The scripts use WLST python scrpt. Session Persistence:There are five different implementations of session persistence: Memory (single-server, non-replicated) File system persistence JDBC persistence Cookie-based session persistence In-memory replication (across a cluster)These attributes are part of the session-param element, which is a child element of the session-descriptor element in the weblogic.xml deployment descriptor file. We can get more detail about weblogic deployment descriptor in Oracle's documentation.Enabling Session Persistence:Set thepersistent-store-typeparameter in the session-descriptor element in the weblogic.xml deployment descriptor file to memory.Enabling File system persistence:In the deployment descriptor fileweblogic.xml, set thepersistent-store-typeparameter in the session-descriptor element in the weblogic.xml deployment descriptor file tofile.Create the necessary file store. Enabling JDBC persistenceSet thepersistent-store-typeparameter in the session-descriptor element in the weblogic.xml deployment descriptor file tojdbc Set a JDBC connection pool to be used for persistence storage with thepersistent-store-poolparameter in the session-descriptor element in the weblogic.xml deployment descriptor file Create JDBC datasource and tables in database.Enabling Cookie-based session persistence.Set thepersistent-store-typeparameter in the session-descriptor element in the weblogic.xml deployment descriptor file tocookie.Jdbc : We can use Administration Console or the WebLogic Scripting Tool (WLST) to create and deploy (target) JDBC modules. They can be manged using JMX Using weblogic console : http://sureshsvn.com/creatingjdbcconnectionpool.html DB Ping command:java -classpath /bea103/wl_server103/server/lib/weblogic.jar utils.dbping ORACLE_THIN JDBC Drivers :The JDBC API defines the Java interfaces and classes that programmers use to connect to databases and send queries. A JDBCdriver implements these interfaces and classes for a particular DBMS vendor. The Oracle JDBC Thin driver is a JDBC Type 4 driver(written entirely in Java). JDBC OCI client-side driver (OCI driver):Oracle's JDBC OCI driver provides a JDBC Type 2 driver (native-API, partly Java) implementation of the JDBC interfaces using OCI (Oracle Call Interface) to interact with an Oracle database JDBC server-side Internal driver (KPRB driver):This JDBC Type 2 driver can be used by Java code that runs inside the oracle database server JVM, such as Java stored procedures DBC Thin server-side driver:This JDBC Type 4 driver allows Java program running inside an Oracle database server JVM to access remote databases.BC VersionJDK version**JDBC File Name

11.2.01.6.x1.5.xojdbc6.jarojdbc5.jar

11.1.01.6.x1.5.xojdbc6.jarojdbc5.jar

10.2.01.2.x1.3.x1.4.x1.5.xclasses12.jarclasses12.jarojdbc14.jarojdbc14.jar

10.1.01.2.x1.3.x1.4.xclasses12.jarclasses12.jarojdbc14.jar

9.2.01.1.x1.2.x1.3.x1.4.xclasses111.zip*classes12.zip*classes12.zip*ojdbc14.jar

DriversOracle database

11.2.011.2.011.1.010.2.010.1.09.2.0

11.1.011.2.011.1.010.2.010.1.09.2.0

10.2.011.2.011.1.010.2.010.1.09.2.0

10.111.2.011.1.010.2.010.1.09.2.0

9.2.011.2.011.1.010.2.010.1.09.2.0

In terms of datasources, an XA datasource is a data source that can participate in an XA global transaction. A non-XA datasource generally can't participate in a global transaction (sort of - some people implement what's called a "last participant" optimization that can let you do this for exactly one non-XA item). Most of the dirvers are non XA. The Transaction Manager coordinates all of this through a protocol called Two Phase Commit (2PC). This protocol also has to be supported by the individual resources. Thin driverOracle's JDBC Thin driver uses Java sockets to connect directly to Oracle. It provides its ownTCP/IPversion of Oracle'sSQL*Netprotocol. Because it is 100% Java, this driver is platform independent and can also run from a Web Browser (applets).Logging Last Resource is recommended over Emulate Two-Phase Commit Domain Creation : We can create weblogic server domain using domain configuration wizard, weblogic.Server command, weblogic.Admin command and WLST.Using weblogic.Server command:java -Dweblogic.Domain=SimpleDomain -Dweblogic.Name=SimpleServer-Dweblogic.management.username=weblogic -Dweblogic.management.password=weblogic -Dweblogic.ListenPort=7001weblogic.Server Using Configuration Wizard:Refer http://sureshsvn.com/creating_weblogic_domain_windows.html Using weblogic.Admin: ( http://download.oracle.com/docs/cd/E13222_01/wls/docs81/admin_ref/cli_tasks.html) Create skeletal domain with thejava weblogic.Servercommand and Using CREATE -mbean argument to create different mbeans.Using WLST: ( http://download.oracle.com/docs/cd/E11035_01/wls100/config_scripting/domains.html ) WLST enables you to create a new domain or update an existing domain without connecting to a running WebLogic Server (that is, using WLST offline)supporting the same functionality as the Configuration Wizard. createDomain(domainTemplate, domainDir, user, password) ls:/offline> createDomain('c:/bea/wlserver_10.0/common/templates/domains/wls_medrec.jar','c:/bea/user_projects/domains/medrec', 'weblogic', 'weblogic')

Domain teamplates can be build using config_builder in common /bin directoryWeblogic.Admin:Usage: java [] weblogic.Admin [ [-url | -adminurl] [://]:]-username [-password ] To list all the available commands: java weblogic.Admin help ALL

Managing the Server Life Cycle UNLOCKRESUME []FORCESHUTDOWN []SHUTDOWN [-ignoreExistingSessions] [-timeout ] []OR(Deprecated) SHUTDOWN [ [""]] []LOCK [""]START (Deprecated) STARTINSTANDBY DISCOVERMANAGEDSERVER [-serverName [-listenPort ] [-listenAddress ] [-listenPortSecure]]Retrieving Information about WebLogic ServerGETSTATE []HELP []CONNECT []LICENSESLIST []PING [] []THREAD_DUMPVERSIONSERVERLOG [ []]Working with JDBC Connection Pools SUSPEND_POOL -poolName (Deprecated) DISABLE_POOL [true | false]RESET_POOL CREATE_POOL (Deprecated) DESTROY_POOL [true | false]SHUTDOWN_POOL -poolName RESUME_POOL -poolName TEST_POOL EXISTS_POOL (Deprecated) ENABLE_POOL DELETE_POOL -poolName Managing WebLogic Server MBeans GET [-pretty] {-type |-mbean } [-property ]...CREATE {-name -type } | {-mbean }INVOKE {-type |-mbean } -method [...]BATCHUPDATE -batchFile [-continueOnError] [-batchCmdVerbose]DELETE {-type | -mbean }QUERY [-pretty] -pattern SET {-type |-mbean } [-property []]...We can create servers, clusters etc., using this option. To get list of MBeans:java weblogic.Admin -username weblogic -password weblogic -url adminurl query -pretty -pattern *:* Working with Clusters VALIDATECLUSTERCONFIG -configPath MIGRATEALL -server -destination [-sourcedown] [-destinationdown]CLUSTERSTATE -clusterName STOPCLUSTER -clusterName MIGRATESERVER -migratableserver -destinationmachine MIGRATE [-jta] -migratabletarget { | } -destination [-sourcedown] [-destinationdown]STARTCLUSTER -clusterName Managing the Admin ConfigurationSTOREUSERCONFIG -username -password [-userconfigfile ] [-userkeyfile ]Weblogic.Deployer:Weblogic.Deployer is a Java-based deployment tool that provides a command-line interface to the WebLogic Server deployment API Usage: java weblogic.Deployer [options] [action] [Deployment units(s)]java weblogic.Deployer -help to display all the available options Deploy application on admin server:java weblogic.Deployer -adminurl url -username username -password password -name myapp -deploy c:/myapps/myapp.earDeploy individual modules in application to different targets:java weblogic.Deployer -adminurl url -username username -password password -name myapp -targets mywar@webserver,myjar@ejbserver -deployc:/myapps/myapp.earUndeploy application from specified targets:java weblogic.Deployer -adminurl url -username username -password password -name myapp -undeploy -targets server1,server2..Redeploy application on current targets:java weblogic.Deployer -adminurl url -username username -password password -name myapp -redeployRedeploy individual module in an application:java weblogic.Deployer -adminurl url -username username -password password -name myapp -redeploy -targets moduleA@serverA,moduleA@serverBPartially redeploy, for example, to update a JSP in a exploded webapp:java weblogic.Deployer -adminurl url -username username -password password -name myapp -redeploy mywar/index.jspThe path of JSP to be updated is relative to the root of the application. If a directory is specified the entire subtree is updated.Multiple servers sharing the same physical deployment:java weblogic.Deployer -adminurl url -username username -password password -name myapp -targets server1,server2 -nostage -deploy c:/myapps/myapp.earThe -nostage option indicates that the application is available on all target servers at the same path and hence server should not copy files to the managed servers.Deploy the first application version on admin server:java weblogic.Deployer -adminurl url -username username -password password -name myapp -deploy c:/myapps/myapp_v1.earPerform Production Redeployment of a new application version on admin server:

java weblogic.Deployer -adminurl url -username username -password password -name myapp -redeploy -source c:/myapps/myapp_v2.earDeploy application to administration mode on admin server:java weblogic.Deployer -adminurl url -username username -password password -name myapp -deploy c:/myapps/myapp.ear -adminmodeTransition application from administration mode to running on admin server:java weblogic.Deployer -adminurl url -username username -password password -name myapp -startTransition application from running to administration mode on admin server:java weblogic.Deployer -adminurl url -username username -password password -name myapp -stop -adminmodeDeploy a library on admin server:java weblogic.Deployer -adminurl url -username username -password password -name mylib -library -libspecver 1.0 -libimplver 2.0 -deploy c:/myapps/mylib.jarDeploy an application on admin server with a deployment plan:

java weblogic.Deployer -adminurl url -username username -password password -plan c:/myapps/myapp/plan/plan.xml -deploy c:/myapps/myapp/app/myapp.jarUpdate an application configuration:java weblogic.Deployer -adminurl url -username username -password password -plan c:/myapps/myapp/plan/newplan.xml -name myapp -updateDeploy a queue to a specific JMS serverjava weblogic.Deployer -adminurl url -username username -password password -submoduletargets myqueue@myjmsmodule@JMSServer-deploy c:/myapps/myapp/app/myapp.ear weblogic.Server :SyntaxThe syntax for invokingweblogic.Serveris as follows:java [options] weblogic.Server [-help] Thejava weblogic.Server -helpcommand returns a list of frequently used options.

JMS:The main components of JMS in weblogic are JMS servers, Store and Forward agents, JMS Modules and Bridges JMS Servers:Management containers for JMS queue and topic destinations in JMS Modules that are targetted to them. They provide persistence. They can be targetted to weblogic servers. Store and Forward Agents:To send messages to remote subsystems. They have a capability to store the messages and send them to the remote system when the remote system is not available JMS Modules:They host and store information about several jms resouces such as connection factory,queue,topic,DD,foriegn server etc., Persistent Store:A persistent store is a physical repository for storing subsystem data, such as persistent JMS messages. It can be either a JDBC-accessible database or a disk-based file. We can target Persisent stores to both Admin and managed servers. JMS ResourceValid Targets

QueueJMS server

TopicJMS server

Connection factoryJMS server(s) | server instance(s) | cluster

Uniform distributed queueJMS server(s) | server instance(s) | cluster

Uniform distributed topicJMS server(s) | server instance(s) | cluster

Foreign serverJMS server(s) | server instance(s) | cluster

SAF imported destinationsSAF Agent(s) | server instance(s) | cluster

configuration files :config.xmlDefaultAuthenticatorInit.ldift,DefaultRoleMapperInit.ldift, andSerializedSystemIni.dat, which store basic security-related data.boot.propertiesfile, which contains the username and password in an encrypted format. This file enables you to bypass the prompt for username and password when you start the server. Weblogic Clustering:

A cluster defines groups of WebLogic Server servers that work together to increase scalability and reliability.Communications that happens in cluster:Peer to Peer using sockets: For accessing nonclustered objects deployed to another clusterened instance on a different machine.Replicating http session states and stateful session EJB states between primary and secondary server instance, accessing remote objects etc.Peer to Peer using Unicast or Multicast: Used for cluster wide JDNI updates and heartbeats. Performance Tuning: Java ParametersFor higher performance throughput, set the minimum java heap size equal to the maximum heap size. For example:"%JAVA_HOME%\bin\java" -server Xms512m Xmx512m -classpath %CLASSPATH% -Configuring On-Demand DeploymentTo change the InternalAppsDeployOnDemandEnabled attribute using the Administration Console, perform the following steps:Start an edit session with the Lock and Edit button.Select the domain to bring up the Configuration -> General tab.Change the setting of the Enable on-demand deployment of internal applications check box.Click Save and then click Activate Changes to activate the changes that will take effect at the next restart of WLS.Configuring On-Demand Deployment Using WLSTTo change the InternalAppsDeployOnDemandEnabled attribute using the WLST, perform the following steps:connect()edit()startEdit()cmo.setInternalAppsDeployOnDemandEnabled(false)activate()Tuning MuxersWith native muxers, you may be able to improve throughput for some cpu-bound applications (for example, SpecJAppServer) by using the following:-Dweblogic.socket.SocketMuxer.DELAY_POLL_WAKEUP=xxLimiting Requests in the Thread PoolThrottle the thread pool by setting theShared Capacity For Work Managersfield in the Administration Console Limiting HTTP SessionsAn administrator can limit the number of active HTTP sessions based on detection of a low memory condition. This is useful in avoiding out of memory exceptions.

12

Tune connection backlog bufferingModify theAccept Backlogvalue as necessary to tune the number of TCP connections the server instance can buffer in the wait queue. If many connections are dropped or refused at the client, and no other error messages are on the server, theAccept Backlogvalue might be set too low. If you are getting connection refused messages when you try to access WebLogic Server, raise theAccept Backlogvalue from the default by 25 percent. Continue increasing the value by 25 percent until the messages cease to appear.Setting Your Compiler OptionsYou may improve performance by tuning your servers compiler options. Tuning JDBC:Tune the Number of Database ConnectionsA straightforward and easy way to boost performance of JDBC in WebLogic Server applications is to set the value ofInitial Capacityequal to the value forMaximum Capacitywhen configuring connection pools in your data sourceUse Test Connections on Reserve with CareTest Frequency is the tunable parameter that allows us to define the number of seconds between each time weblogic server tests unused connections. Cache Prepared and Callable StatementsUse Statement Cache to cache statements. We can enable this under connection pool parameters of JDBC PinnedToThreadPinnedToThread is an option that can improve performance by enabling execute threads to keep a pooled database connection even after the application closes the logical connectionTheweblogic-cmp-jar.xmlfileis WebLogic-specific XML Schema-based (XSD) deployment descriptor file. Use these definitions to create the WebLogic-specificweblogic-cmp-jar.xmlfile that is part of your EJB deployment. Use this deployment descriptor file to specify container-managed-persistence (CMP) behavior. Set cluster-invalidation-disabled to disable cluster invalidation. Increase the number of CPUs only if CPU untilizaion is reaching high levels. Otherwise consider increasing network and disk bandwidth etc., Tuning Chunk Size:Weblogic JVM divides network data into 4 chunks by default. For network intensive applications tuning chunk size can sometimes double thoroughput. The chunk size is set via command link in server and client. -Dweblogic.chunksize=nDefault is 4 Kb. Weblogic caches chunks in an internal chunkpool for reuse. -Dweblogic.utils.io.chunkpoolsize=n.Default is 512 Using file stores gives more performance over JDBC persistance stores. Avoiding JVM Delays Caused by Random Number GenerationDo head -n 1 /dev/random. It it takes more time then change the valute to" securerandom.source=file:/dev/urandom" in $JAVA_HOME/jre/lib/security/java.security

Proxy plugin for Apache:Copy themod_wl_20.sofile from theBEA_HOME\server\plugin\win\32directory to theAPACHE_HOME\modulesdirectory Include the weblogic Module and customize according to your needs. IfModule mod_weblogic.c> WebLogicCluster node1:node1_port,node2:node2_port DebugConfigInfo ON MatchExpression *.jsp MatchExpression *.xyz

Official Documentation:Plugin options: http://download.oracle.com/docs/cd/E13222_01/wls/docs81/plugins/plugin_params.html#1158010 SSL Configuration on WebLogic Server 9.2 on solarisGenerate private Key : (Identity Key)keytool -genkey -keyalg RSA -alias privkey -keystore yourdomain-private.jksGenerate CSR certificate :keytool -certreq -v -alias privkey -keystore yourdomain-private.jksSend CSR certificate to the SSL Vendor. The Server certificate, Root CA, Intermediate certificate and CA Chain certificate will be sent to you. Combine three certificates into one certificate in the same order as below :Public.cert (Server Certificate we received in the name of number.crt)Intermediate.cert(Intermediate Certificate)Root.cert ( Root CA Certificate)Save these three certificates into one file yourdomain.crtImport yourdomain.crt file into yourdomain-private.jkskeytool -import -alias privkey -file yourdomain.crt -keystore yourdomain-private.jks -trustcacertskeytool -list -v -keystore yourdomain-private.jks (To check the certificate is imported properly or not)Import Trust identity (Trusted Root certificate)keytool -import -alias yourdomain -file RootCA.crt -keystore yourdomaintrust.jks -trustcacertskeytool -list -v -keystore yourdomaintrust.jks( To check the certificate is imported properly or not)Login to WebLogic console Goto Environment and select Servers - (Example Server1).Click on KeyStores Tab.Debugging:Under the debug tab of servers in Admin console all the debug parameters are available. We can select which ever one we need.

Dweblogic.Debug is the debug parameter that can be added while weblogic server starts using startup scripts, WLST tools, Through WLST:

user='user1'password='password'url='t3://localhost:7001'connect(user, password, url)edit()cd('Servers/myserver/ServerDebug/myserver')startEdit()set('DebugJDBCJTA','true')save()activate()Through command line / startup Scripts:Set the appropriate properties on the command line. For example,-Dweblogic.debug.DebugJDBCJTA=true -Dweblogic.log.StdoutSeverity="Debug"Through editing config.xml

myserver

weblogic.transactiontrue

true

Weblogic Deployment Plan Its used to export the deployment configuration parameters into an xml and use the same xml file to deploy the code in multiple environments making few changes to the parameters without needing to edit them in the EAR file descriptors or Admin console. weblogic.PlanGenerator is the utility that can be used to create a deployment plan.Syntax:java weblogic.PlanGenerator [options] [path to application]options include :-plan : Name of the plan-dependencies : export all dependency properties that resolve external resource references (defaultl) -declarations: export all properties that delcare a resource to other applications and modules. -configurables : export all editable configurables except dependencies and declarations-dynamics: export all configurables that be changed on the fly, without needing to redeploy the application. -all : export all changable parametersWhile deploying the application using the weblogic.Deployer utility we need to use -plan /pathto_xml_plan to deploy using plan. WLSTIts a Jython based scripting tool that allows us to monitor and manage weblogic servers. Almost all administration tasks are possible using wlst. It works is online as well as offline modes (Interactive script and embedded) Its very interesting and convenientInitiate wlst:

D:\Oracle\Middleware\wlserver_10.3\server\bin>java weblogic.WLST

Connect to weblogic server.

connect('USERNAME', 'PASSWORD', 'SERVER_ADDRESS:SERVER_PORT')

wls:/offline> connect('weblogic', 'Moto6666', 'localhost:7001')We can use the basic commands like ls and pwd once we connect to domain.wls:/lab/serverConfig> pwd ()serverConfig:/'

wls:/lab/serverConfig> ls ()dr-- AdminConsoledr-- AppDeploymentsdr-- BridgeDestinations

To start Editing use the commands below: At any point if we see errors we can usedumpStack() to see the trace. Use activate () to activate the changes and exit out of edit mode. wls:/lab/serverConfig> edit()Location changed to edit tree. This is a writable tree withDomainMBean as the root. To make changes you will need to startan edit session via startEdit().To check that state of a running server (Admin server in this example) and take thread dump:

wls:/lab/serverConfig> cd('Servers/AdminServer')wls:/lab/serverConfig/Servers/AdminServer> state ("AdminServer")Current state of 'AdminServer' : RUNNINGwls:/lab/serverConfig/Servers/AdminServer> pwd ()'serverConfig:/Servers/AdminServer'

threadDump("./dumps/threadDumpAdminServer.txt") To disconnect from Server:disconnect (To create a new managed server:wls:/lab/edit !> cd('/')wls:/lab/edit !> cmo.createServer('Lab1')[MBeanServerInvocationHandler]com.bea:Name=Lab1,Type=Serverwls:/lab/edit !> cd('/Servers/Lab1')wls:/lab/edit/Servers/Lab1 !> cmo.setListenAddress('127.0.0.1')wls:/lab/edit/Servers/Lab1 !> cmo.setListenPort(7777)wls:/lab/edit/Servers/Lab1 !> activate ()Activating all your changes, this may take a while ...The edit lock associated with this edit session is releasedonce the activation is completed.Activation completedstartNodeManager() to start nodemanager to control serversTo enroll a server with nodemanager:setDomainEnv.cmdjava weblogic.WLSTwls> connect(weblogic,'weblogic, t3://mymachine.mydomain:7001)wls> nmEnroll(C:\bea\user_projects\domains/, C:\bea\wlserver_/common/nodemanager)To run a python script: java weblogic.WLST forceGC.py Migrating services: wls:/mydomain/edit !> migrate('server1','server2', 'true', 'false', 'all')

Migrating JMS and JTA services from 'server1' to destination 'server2' ...wls:/mydomain/edit !>wls:/mydomain/edit !> migrate('server1','machine1', 'true', 'false', 'server')Migrating singleton server services from 'server1' to machine 'machine1' ...wls:/mydomain/edit !>Starting a server with options:wls:/offline> startServer('demoServer','demoDomain', 't3://localhost:8001','myweblogic','wlstdomain','c://mydomains/wlst', 'false', 60000,jvmArgs='-XX:MaxPermSize=75m, -Xmx512m, -XX:+UseParallelGC')

Suspending a server:wls:/mydomain/serverConfig> suspend('managed1')Server 'managed1' suspended successfully.wls:/mydomain/serverConfig>Start a cluster:ydomain/serverConfig> start('mycluster', 'Cluster')Starting the following servers in Cluster, mycluster: MS1, MS2, MS3.........................................................................All servers in the cluster mycluster are started successfully.wls:/mydomain/serverConfig>Resume a server:wls:/mydomain/serverConfig> resume('managed1', block='true')Server 'managed1' resumed successfully.wls:/mydomain/serverConfig>Garbage collection using wlst:cd('/ServerRuntimes/'+MGD_SERVER+'/JVMRuntime/'+MGD_SERVER)cmo.runGC(Connect to nodemanager and start server: nmConnect(domainName=my_domain, username=weblogic, password=Password)nmStart('AdminServer') Deployment descriptors @ weblogic Deployment descriptors are xml documents that describe runtime behaviour for the deployment unit. The XML file contains information such as the context root of the web application and the mapping of the portable names of an application's resources to the application Server's resourcesWeb Application - WEB-INF/web.xml ( WEB-INF/weblogic.xml )The WEB-INF directory is a vital component of your web application. Web application wont run without it.It contains a heirarcy in which youll find the necessary configuration information for your web application, and all the class files for your servlets and classes that are called up by your JSPs.WEB-INF folder contains all the class files for your servlets and classes that are called up by your JSPs

Enterprise Application - META-INF/application.xml (META-INF/weblogic-application.xml) and META-INF/ejb-jar.xml ( META-INF/weblogic-ejb-jar.xml ) Generally comprises of EJBs. Bussiness Tier of an application and EJB basically handels the Bussiness logic of application (distributed objects) META-INF/application.xml containes Mappings and security roles etc.whereas META-INF/ejb-jar.xml containes ejb classes , session beans mapping etc.,The META-INF directory is related to .jar files, It contains the manifest file which has list of jars.A context-root setting in application.xml takes precedence over context-root setting in weblogic.xml (The context root of a web application determines which URLs weblogic will delegate toyour web application.)

Web Service - WEB-INF/web-services.xmlJ2EE specs do not define any deployment descriptors from web services. Weblogic introduced descriptors from webservices.Environment Scripts: /bin/setDomainEnv.cmd (sh) script. This sets up all the environment variables.Where DOMAIN_HOME is the complete installation path for the domain. D:\bea\user_projects\domains\labWL_HOME is the installation directory of weblogic. Eg., D:\bea /bin/setWLSEnv.cmd(sh) is another script that can be run to set class path for running weblogic tools like WLST etc. Its independent of domain configuration. The changes made to this script effects all the servers in the environment. commEnv.cmd/sh adds all the JARs located at WL_HOME/server/lib on the classpath In common/bin D:\bea\wlserver_10.3\common\bin commEnv.cmd (sh) is the main script that both the setDomainEnv.cmd (sh) / setWLSEnv.cmd(sh) scripts call. setDomainEnv.cmd/sh is specific for a domain ANTwlservertask is predefined in the version of Ant shipped with WebLogic Server. ejbjar is one more built in task for working with EJBsExample build file: