Tuesday 4 February 2014

Configuring and Starting Oracle Weblogic Admin Sever as Service

We can configure the Admin server and Managed Server's as a service follow the below steps:

Create a text file and save it as Admin.cmd file. We need to set the below variables in the file and some of them are optional.

DOMAIN_NAME: Your domain name

USERDOMAIN_HOME": Obsolute path of the domain in the system

SERVER_NAME: Name of the Admin Server

PRODUCTION_MODE: If the server is in production mode set the value to 'true'

WLS_USER: Weblogic server user name ( if the authentication is set)

WLS_PW: password

ADMIN_URL: Admin server url

JAVA_VENDOR: Sun

JAVA_HOME: Set the JAVA home value

MEM_ARGS: Memory setting's for the server

call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"

(you need to run the install service command, which will be located in the 'wlserver\server\bin' path

The file should look like below:

----------
echo off
SETLOCAL
set DOMAIN_NAME=NodeDomain
set USERDOMAIN_HOME=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\NodeDomain
set SERVER_NAME=AdminServer
set PRODUCTION_MODE=true
set WLS_USER=weblogic
set WLS_PW=Venkat1984
set JAVA_VENDOR=Sun
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_45
set ADMIN_URL=http://localhost:7001
set MEM_ARGS=-Xms256m -Xmx256m
call "C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"
ENDLOCAL
--------

Save the file.

Run the 'Admin.cmd' as an Administrator, if not you may get the error.

OpenSCManager failed - Access is denied. (0x5)

Now run the 'Services.msc'. you can see the weblogic admin server created as a service.


Start the service with the command:

In the path (generic) execute the command:

C:\Oracle\Middleware\Oracle_Home\wlserver\server\bin>wlsvc -debug "service name"

 "service name" should be name of your service created

Access admin server with the console url





Sunday 2 February 2014

How to set or change the session timeout value in Oracle Weblogic Server

1) Login into the Admin console and go to left pane click on 'Lock & Edit'

Navigate to YourDomain--> Deployments

Click on the deployed war file

Go to the 'çonfiguration' tab and change the 'Session Timeout (in seconds):' value

This value will be for the application session interval. Please find the below screenshot. In this example, the deployed .war file is 'benefits'.






Once you change this value the value will be set in the 'weblogic.xml' file. Open the file, you can find the below lines.
<session-descriptor>
    <timeout-secs>180</timeout-secs>
    <invalidation-interval-secs>180</invalidation-interval-secs>
</session-descriptor>
Alternatively you can even change the 'timeout-secs' value in the 'weblogic.xml' and re-start the server. Your changed will be reflected.

2) You can also set the session timeout value in the web.xml file as below.

<session-config>
  <session-timeout>60</session-timeout>
</session-config>
 If you set two different values in web.xml and weblogic.xml, the web.xml file is given more preference and it will be considered by the server.

What is Invalidation Interval ?

The time (in seconds) that WebLogic Server waits between doing house-cleaning checks for timed-out and invalid sessions, and deleting the old sessions and freeing up memory.