A quick tutorial for middleware products

  • WeblogicArch

  • J2EEArch

  • FussionArch

Tuesday, April 21, 2015

On April 21, 2015 by Kamlesh   5 comments
WLST Script for checking the status of JDBC Datasource in Weblogic 


WLST has some good features like we can monitor the weblogic domain, monitor JMS Cluster, Datasource target and untarget etc.
In this post I am explaining about how to monitor JDBC Datasource like status of datasource, load on datasource etc. by WLST script.

Step by step explaining how to prepare the JDBCmonitor.py file and how to run it.

1)  Prepare the JDBCmonitor.py file and save it in somewhere in your machine.


#############################################################################
# @author Middlewaregeek.blogspot.in
#############################################################################

from java.io import FileInputStream
import java.lang
import os
import string

username = 'weblogic'

password = 'weblogic'

url='t3://localhost:7001'

connect(username,password,url)

allServers=domainRuntimeService.getServerRuntimes();

if (len(allServers) > 0):

  for tempServer in allServers:

    jdbcServiceRT = tempServer.getJDBCServiceRuntime();

    dataSources = jdbcServiceRT.getJDBCDataSourceRuntimeMBeans();

    if (len(dataSources) > 0):

        for dataSource in dataSources:

            print 'ActiveConnectionsAverageCount      '  ,  dataSource.getActiveConnectionsAverageCount()

            print 'ActiveConnectionsCurrentCount      '  ,  dataSource.getActiveConnectionsCurrentCount()

            print 'ActiveConnectionsHighCount         '  ,  dataSource.getActiveConnectionsHighCount()

            print 'ConnectionDelayTime                '  ,  dataSource.getConnectionDelayTime()

            print 'ConnectionsTotalCount              '  ,  dataSource.getConnectionsTotalCount()

            print 'CurrCapacity                       '  ,  dataSource.getCurrCapacity()

            print 'CurrCapacityHighCount              '  ,  dataSource.getCurrCapacityHighCount()

            print 'DeploymentState                    '  ,  dataSource.getDeploymentState()

            print 'FailedReserveRequestCount          '  ,  dataSource.getFailedReserveRequestCount()

            print 'FailuresToReconnectCount           '  ,  dataSource.getFailuresToReconnectCount()

            print 'HighestNumAvailable                '  ,  dataSource.getHighestNumAvailable()

            print 'HighestNumUnavailable              '  ,  dataSource.getHighestNumUnavailable()

            print 'LeakedConnectionCount              '  ,  dataSource.getLeakedConnectionCount()

            print 'ModuleId                           '  ,  dataSource.getModuleId()

            print 'Name                               '  ,  dataSource.getName()

            print 'NumAvailable                       '  ,  dataSource.getNumAvailable()

            print 'NumUnavailable                     '  ,  dataSource.getNumUnavailable()

            print 'Parent                             '  ,  dataSource.getParent()

            print 'PrepStmtCacheAccessCount           '  ,  dataSource.getPrepStmtCacheAccessCount()

            print 'PrepStmtCacheAddCount              '  ,  dataSource.getPrepStmtCacheAddCount()

            print 'PrepStmtCacheCurrentSize           '  ,  dataSource.getPrepStmtCacheCurrentSize()

            print 'PrepStmtCacheDeleteCount           '  ,  dataSource.getPrepStmtCacheDeleteCount()

            print 'PrepStmtCacheHitCount              '  ,  dataSource.getPrepStmtCacheHitCount()

            print 'PrepStmtCacheMissCount             '  ,  dataSource.getPrepStmtCacheMissCount()

            print 'Properties                         '  ,  dataSource.getProperties()

            print 'ReserveRequestCount                '  ,  dataSource.getReserveRequestCount()

            print 'State                              '  ,  dataSource.getState()

            print 'Type                               '  ,  dataSource.getType()

            print 'VersionJDBCDriver                  '  ,  dataSource.getVersionJDBCDriver()

            print 'WaitingForConnectionCurrentCount   '  ,  dataSource.getWaitingForConnectionCurrentCount()

            print 'WaitingForConnectionFailureTotal   '  ,  dataSource.getWaitingForConnectionFailureTotal()

            print 'WaitingForConnectionHighCount      '  ,  dataSource.getWaitingForConnectionHighCount()

            print 'WaitingForConnectionSuccessTotal   '  ,  dataSource.getWaitingForConnectionSuccessTotal()

            print 'WaitingForConnectionTotal          '  ,  dataSource.getWaitingForConnectionTotal()

            print 'WaitSecondsHighCount               '  ,  dataSource.getWaitSecondsHighCount()



2) Set the class path by using setDomainEnv script or go to the below path and execute JDBCmonitor.py file.

$WL_HOME/wlserver_10.3/common/bin

Then execute below command

$ ./wlst.sh <location of .py file >/ JDBCmonitor.py


3) You should get following output.



Initializing WebLogic Scripting Tool (WLST) ...

*sys-package-mgr*: skipping bad jar, '/WL_HOME/wlserver_10.3/common/lib/mssqlserver.jar'
Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Connecting to t3://localhost:7001 with userid
Successfully connected to Admin Server 'admin' that belongs to domain 'XYZ'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.

Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)

ActiveConnectionsAverageCount       0
ActiveConnectionsCurrentCount       0
ActiveConnectionsHighCount          0
ConnectionDelayTime                 30
ConnectionsTotalCount               20
CurrCapacity                        10
CurrCapacityHighCount               1
DeploymentState                     2
FailedReserveRequestCount           0
FailuresToReconnectCount            0
HighestNumAvailable                 10
HighestNumUnavailable               0
LeakedConnectionCount               0
ModuleId                            DS1
Name                                DS1
NumAvailable                        10
NumUnavailable                      0
Parent                              [MBeanServerInvocationHandler]com.bea:Name=AdminServer,Location=AdminServer,Type=ServerRuntime
PrepStmtCacheAccessCount            0
PrepStmtCacheAddCount               0
PrepStmtCacheCurrentSize            0
PrepStmtCacheDeleteCount            0
PrepStmtCacheHitCount               0
PrepStmtCacheMissCount              0
Properties                          {databaseName=jdbc:pointbase:server://localhost:7001/TestDS, user=XYZ}
ReserveRequestCount                 0
State                               Running
Type                                JDBCDataSourceRuntime
VersionJDBCDriver                   com.pointbase.jdbc.jdbcUniversalDriver
WaitingForConnectionCurrentCount    0
WaitingForConnectionFailureTotal    0
WaitingForConnectionHighCount       0
WaitingForConnectionSuccessTotal    0
WaitingForConnectionTotal           0
WaitSecondsHighCount                0





Regards,

Middlewaregeek



Friday, April 10, 2015

On April 10, 2015 by Kamlesh   1 comment
WLST Script for Monitoring the JMS status of Weblogic Domain

After long time writing something about WLST
WLST has some good features like we can monitor the weblogic domain, monitor JMS Cluster, Datasource target and untarget etc.
In this post I am explaining about how to monitor JMS Cluster like message count, pending message etc. by WLST script.

Step by step explaining how to prepare the JMSmonitor.py file and how to run it.

1)  Prepare the JMSmonitor.py file and save it in somewhere in your machine.


#############################################################################
# @author Middlewaregeek.blogspot.in
#############################################################################

from java.io import FileInputStream
import java.lang
import os
import string

username = 'weblogic'

password = 'weblogic'

url='t3://localhost:7001'

connect(username,password,url)

servers = domainRuntimeService.getServerRuntimes();

if (len(servers) > 0):

    for server in servers:

        jmsRuntime = server.getJMSRuntime();

        jmsServers = jmsRuntime.getJMSServers();

        for jmsServer in jmsServers:

            destinations = jmsServer.getDestinations();

            for destination in destinations:

                print '  BytesCurrentCount           ' ,  destination.getBytesCurrentCount()

                print '  BytesHighCount              ' ,  destination.getBytesHighCount()

                print '  BytesPendingCount           ' ,  destination.getBytesPendingCount()

                print '  BytesReceivedCount          ' ,  destination.getBytesReceivedCount()

                print '  BytesThresholdTime          ' ,  destination.getBytesThresholdTime()
                print '  ConsumersCurrentCount       ' ,  destination.getConsumersCurrentCount()

                print '  ConsumersHighCount          ' ,  destination.getConsumersHighCount()

                print '  ConsumersTotalCount         ' ,  destination.getConsumersTotalCount()

                print '  ConsumptionPausedState      ' ,  destination.getConsumptionPausedState()

                print '  '

                print '  DestinationInfo             ' ,  destination.getDestinationInfo()

                print '  '

                print '  DestinationType             ' ,  destination.getDestinationType()

                print '  InsertionPaused             ' ,  destination.isInsertionPaused()

                print '  InsertionPausedState        ' ,  destination.getInsertionPausedState()

                print '  MessagesCurrentCount        ' ,  destination.getMessagesCurrentCount()

                print '  MessagesDeletedCurrentCount ' ,  destination.getMessagesDeletedCurrentCount()

                print '  MessagesHighCount           ' ,  destination.getMessagesHighCount()

                print '  MessagesMovedCurrentCount   ' ,  destination.getMessagesMovedCurrentCount()

                print '  MessagesPendingCount        ' ,  destination.getMessagesPendingCount()

                print '  MessagesReceivedCount       ' ,  destination.getMessagesReceivedCount()

                print '  MessagesThresholdTime       ' ,  destination.getMessagesThresholdTime()

                print '  Parent                      ' ,  destination.getParent()

                print '  Paused                      ' ,  destination.isPaused()

                print '  ProductionPaused            ' ,  destination.isProductionPaused()

                print '  ProductionPausedState       ' ,  destination.getProductionPausedState()

                print '  State                       ' ,  destination.getState()

                print '  Type                        ' ,  destination.getType()



2) Set the class path by using setDomainEnv script or go to the below path and execute JMSmonitor.py file.

$WL_HOME/wlserver_10.3/common/bin

Then execute below command

$ ./wlst.sh <location of .py file >/ JMSmonitor.py


3) You should get following output.



Initializing WebLogic Scripting Tool (WLST) ...

*sys-package-mgr*: skipping bad jar, '/WL_HOME/wlserver_10.3/common/lib/mssqlserver.jar'
Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Connecting to t3://localhost:7001 with userid
Successfully connected to Admin Server 'admin' that belongs to domain 'XYZ'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.

Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)


  DestinationType              Queue
  InsertionPaused              0
  InsertionPausedState         Insertion-Enabled
  MessagesCurrentCount         0
  MessagesDeletedCurrentCount  0
  MessagesHighCount            3
  MessagesMovedCurrentCount    0
  MessagesPendingCount         0
  MessagesReceivedCount        268
  MessagesThresholdTime        0
  Parent                       [MBeanServerInvocationHandler]com.bea:ServerRuntime=MS1,Name=XYZJMSServer_MS1,Location=MS1,Type=JMSServerRuntime
  Paused                       0
  ProductionPaused             0
  ProductionPausedState        Production-Enabled
  State                        advertised_in_cluster_jndi
  Type                         JMSDestinationRuntime
  BytesCurrentCount            0
  BytesHighCount               19181
  BytesPendingCount            0
  BytesReceivedCount           6636125
  BytesThresholdTime           0
  ConsumersCurrentCount        5
  ConsumersHighCount           5
  ConsumersTotalCount          5
  ConsumptionPausedState       Consumption-Enabled




Regards,

Middlewaregeek


On April 10, 2015 by Kamlesh   6 comments
WLST Script for checking the health status of Weblogic Domain (Admin/Managed node)

After long time writing something about WLST
WLST has some good features like we can monitor the weblogic domain, monitor JMS Cluster, Datasource target and untarget etc.
In this post I am explaining about how to monitor Weblogic domain like Server State, Server Health, Listen Port, Listen Addresses etc. by WLST script.

Step by step explaining how to prepare the wlsstatus.py file and how to run it.

1)  Prepare the wlsstatus.py file and save it in somewhere in your machine.


############################################################################
# This script is for checking the Health Status of the servers
#  Author: @Middlewaregeek.blogspot.in
############################################################################
#       Connect to the Admin Server
from java.io import FileInputStream
import java.lang
import os
import string

username = 'weblogic'

password = 'weblogic'

url='t3://localhost:7001'

connect(username,password,url)

domainRuntime()

cd('ServerRuntimes')

servers=domainRuntimeService.getServerRuntimes()
for server in servers:
     serverName=server.getName();
     print '**************************************************'
     print '##############' , serverName,'###############'
     print '**************************************************'
     print '##### Server State         #####', server.getState()
     print '##### Server ListenAddress #####', server.getListenAddress()
     print '##### Server ListenPort    #####', server.getListenPort()
     print '##### Server Health State    #####', server.getHealthState()


2) Set the class path by using setDomainEnv script or go to the below path and execute wlsstatus.py file.

$WL_HOME/wlserver_10.3/common/bin

Then execute below command

$ ./wlst.sh <location of .py file >/wlsstatus.py


3) You should get following output.



Initializing WebLogic Scripting Tool (WLST) ...

*sys-package-mgr*: skipping bad jar, '/WL_HOME/wlserver_10.3/common/lib/mssqlserver.jar'
Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Connecting to t3://localhost:7001 with userid
Successfully connected to Admin Server 'admin' that belongs to domain 'XYZ'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.

Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)

**************************************************
############## MS1 ###############
**************************************************
##### Server State         ##### RUNNING
##### Server ListenAddress ##### Listening Address
##### Server ListenPort    ##### 7001
##### Server Health State    #####  Component:ServerRuntime,State:HEALTH_OK,MBean:MS1,ReasonCode:[]
**************************************************
############## MS2 ###############
**************************************************
##### Server State         ##### RUNNING
##### Server ListenAddress ##### Listening Address
##### Server ListenPort    ##### 7001
##### Server Health State    #####
Component:ServerRuntime,State:HEALTH_OK,MBean:MS2,ReasonCode:[]
**************************************************
############## MS3  ###############
**************************************************
##### Server State         ##### RUNNING
##### Server ListenAddress ##### Listening Address
##### Server ListenPort    ##### 7001
##### Server Health State    #####  Component:ServerRuntime,State:HEALTH_OK,MBean:MS3,ReasonCode:[]
**************************************************
############## admin ###############
**************************************************
##### Server State         ##### RUNNING
##### Server ListenAddress ##### Listening Address
##### Server ListenPort    ##### 7001
##### Server Health State    ##### Component:ServerRuntime,State:HEALTH_OK,MBean:admin,ReasonCode:[]
**************************************************
############## MS4  ###############
**************************************************
##### Server State         ##### RUNNING
##### Server ListenAddress ##### Listening Address
##### Server ListenPort    ##### 7001
##### Server Health State    ##### Component:ServerRuntime,State:HEALTH_OK,MBean:MS4,ReasonCode:[]


Regards,

Middlewaregeek


Saturday, November 22, 2014

On November 22, 2014 by Kamlesh   2 comments

How to Deploy Application using WLST


We can use WLST to quickly deploy an Application in a Weblogic Server.

Requirement:-
·The ear/war/rar/jar file (uploaded to a directory in the target WebLogic Server )
·A simple WLST script
·Credentials for the Weblogic Server (preferably, the weblogic user).

·Write a simple WLST Script to do your work and save it as "deploy.py"

print  WEBLOGIC : START
print 'connecting to admin server....'
connect( 'weblogic', 'weblogic', 't3://localhost:7001', adminServerName='AdminServer' )
print 'stopping and undeploying ....'
stopApplication('application')
print 'deploying....'
deploy('shoppingcart', 'c:/application.war', targets='AdminServer')
startApplication('application')
print 'disconnecting from admin server....'
disconnect()
exit()
print  WEBLOGIC : STOP

·Open a Terminal Window / Command Prompt
·Run the setDomainEnv.sh/ setDomainEnv.bat script to set the required environment variables under <weblogic domain>/bin.
·run :-  java weblogic.WLST deploy.py
 output -
 java weblogic.WLST sc
ript.py
Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

*** WEBLOGIC : START ***
connecting to admin server....
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'bas
e_domain'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.

stopping and underplaying ....
Stopping application………….

Completed the stop of Application with status completed
Current Status of your Deployment:
Deployment command type: stop
Deployment State       : completed
Deployment Message     : no message
Deploying....
Deploying application from D:\application.war to targets AdminServer (upload=fa
lse) ...
Completed the deployment of Application with status completed
Current Status of your Deployment:
Deployment command type: deploy
Deployment State       : completed
Deployment Message     : no message
Starting application……….
Completed the start of Application with status completed
Current Status of your Deployment:
Deployment command type: start
Deployment State       : completed
Deployment Message     : no message
disconnecting from admin server....
Disconnected from weblogic server: AdminServer

Exiting WebLogic Scripting Tool.
On November 22, 2014 by Kamlesh   No comments
WLST Server Start
The server of a WebLogic domain can be started using different techniques. The best setup depends on the technical requirements but also on the security/administration guidelines of the company. The following section introduces the different possibilities and will provide best practices information based on real project experience.
Administration Server
The administration server can be started in three different ways as explained in the subsequent sections. You can start an administration server using a start script or using WLST with or without the NodeManager. All starting mechanisms have their own advantages and disadvantages. Readers are advised to define their own strategy carefully, but keep it simple and stay with one of the discussed methods for your environments.

Using WLST and NodeManager

The NodeManager is normally used to start managed-servers. However, it can also be used to start the administration server. 


The nmConnect command can be used to connect to the NodeManager using WLST. The credentials can be given either using a user/password combination or a userconfig/keyfile combination. The following is an example that uses username/password to connect the NodeManager.

nmConnect([username, password], [host], [port], [domainName], [domainDir], [nmType])
nmConnect([userConfigFile, userKeyFile], [host], [port], [domainName], [domainDir], [nmType])

Exp:-

nmConnect('weblogic','<pw>','localhost','5556','TestDomain','/application/domains/TestDomain','SSL')
Connecting to Node Manager ...
Successfully connected to Node Manager.
wls:/nm/TestDomain>

The next script demonstrates starting the administration server using the nmStart command. This command must be provided with the name of the server, the domain directory, and properties.

nmStart([serverName], [domainDir], [props], [writer], [serverType])

Exp:-

wls:/nm/TestDomain>nmStart('AdminServer')
starting server AdminServer
Server AdminServer started successfully
wls:/nm/TestDomain>

Monitor the status of the server using the NodeManager by entering the nmServerStatuscommand:

wls:/nm/TestDomain>nmServerStatus('AdminServer')
RUNNING
wls:/nm/TestDomain>

Example for starting the NodeManager and then the AdminServer with the NodeManager:

print 'Start the NodeManager';
startNodeManager(verbose='false',NodeManagerHome='/opt/wls/nodemanager/xyz', ListenPort='5556');

print 'Wait for a short time to allow the nodemanager to start ...'

print 'Connect to the Node Manager';
nmConnect(<user>,<password>, 'localhost', '5556', <domainName>, <domainLocation>, 'plain');


print 'Start the AdminServer using the NodeManager';
nmStart('AdminServer');

print 'Again wait for a short while to allow the AdminServer to start ...'

print 'Connect to the AdminServer';
connect(<user>, <password>, <url>);

It is better and much more secure to use the secret key files as there is no need to provide user and password in the readable script. This is also available for the NodeManager:

nmConnect([userConfigFile, userKeyFile], [host], [port], [domainName], [domainDir], [nmType])

Exp;-

print 'Start the NodeManager';
startNodeManager(verbose='false',NodeManagerHome='/opt/wls/nodemanager/xyz', ListenPort='5556');

print 'Wait for a short time to allow the nodemanager to start ...'

print 'Connect to the Node Manager';
nmConnect(userConfigFile='/opt/domainaccess/testNM/user', userKeyFile='/opt/domainaccess/testNM/key','localhost','5556',<domainName>, <domainLocation>, 'plain');

print 'Start the AdminServer using the NodeManager';
nmStart('AdminServer');

print 'Again wait for a short while to allow the AdminServer to start ...'

print 'Connect to the AdminServer';
connect(userConfigFile='/opt/domainaccess/testDomain/user', userKeyFile='/opt/domainaccess/testDomain/key', <url>);

Using WLST without NodeManager

Using the WLST startServer command, the administration server can be started without using a NodeManager. The server runs in a separate process from WLST, which means that exiting WLST does not shutdown the server.

startServer([adminServerName], [domainName], [url], [username], [password],[domainDir], [block], [timeout], [serverLog], [systemProperties], [jvmArgs])

Exp:-

wls:/offline> startServer('AdminServer','TestDomain','t3://myTestServer:12345',
'admin','<pw>5','/application/domains/TestDomain','false',60000,jvmArgs='-XX:MaxPermSize=125m, -Xmx512m, -XX:+UseParallelGC')
wls:/offline>

WLST Managed-Server
Similar to the AdminServer, WebLogic also offers different ways to start managed-servers. However, these differ from the possible ways to start an administration server.  The big difference is that the administration server is already running and can be used (and will be used) to start the managed-servers.

Using the start script

Similar to the admin server, WebLogic creates a startscript in the bin folder of the domain during domain creation. This can be used to start the different managed-servers by calling the script with the managed-server?s name. This script is called startManagedWebLogic.sh.

Using the NodeManager

If the domain is enrolled with the NodeManager and the server start attributes are configured correctly, then WLST can communicate with the NodeManager and start the server based on the configuration.

start('Test_Domain_MS1','Server')

This requires that the NodeManager on the target machine is started, the domain is enrolled, and the server start attributes are configured.

The managed-server can also be started using the AdminServer and the ServerLifeCycleRuntimeof the managed-server. This also requires that the NodeManager responsible for this managed-server is started.

connect('weblogic','xxxxx','t3://localhost:12345')
domainRuntime()
wls:/Test_Domain/domainRuntime>


cd ('/ServerLifeCycleRuntimes/Test_Domain_MS1')

cmo.start()
On November 22, 2014 by Kamlesh   No comments

How to create WebLogic Domain using Domain template:
1. Open an existing domain template (assuming WebLogic Server is installed at c:/bea/ wlserver_10.3). In this example, we open the Basic WebLogic Server Domain template.
readTemplate('c:/bea/wlserver_10.3/common/templates/domains/wls.jar')
wls:/offline/base_domain>


2. Configure the domain.
a.    Configure the Administration Server and SSL port.
cd('Servers/AdminServer')
set('ListenAddress','')
set('ListenPort', 7001)
create('AdminServer','SSL')
cd('SSL/AdminServer')
set('Enabled', 'True')
set('ListenPort', 7002)
b.    Define the default user password.
cd('/')
cd('Security/base_domain/User/weblogic')
cmo.setPassword('weblogic')
c.    Create a JMS Server.
cd('/')
create('myJMSServer', 'JMSServer')
d.    Create a JMS system resource.
cd('/')
create('myJmsSystemResource', 'JMSSystemResource')
cd('JMSSystemResource/myJmsSystemResource/JmsResource/NO_NAME_0')
cd("Servers/myserver")

e.Create a JMS queue and its subdeployment.
myq=create('myQueue','Queue')
myq.setJNDIName('jms/myqueue')
myq.setSubDeploymentName('myQueueSubDeployment')
cd('/')
cd('JMSSystemResource/myJmsSystemResource')
create('myQueueSubDeployment', 'SubDeployment')
f.     Create a JDBC data source, configure the JDBC driver, and create a new JDBC user.
cd('/')
create('myDataSource', 'JDBCSystemResource')
cd('JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcDriverParams','JDBCDriverParams')
cd('JDBCDriverParams/NO_NAME_0')
set('DriverName','com.pointbase.jdbc.jdbcUniversalDriver')
set('URL','jdbc:pointbase:server://localhost/demo')
set('PasswordEncrypted', 'PBPUBLIC')
set('UseXADataSourceInterface', 'false')
create('myProps','Properties')
cd('Properties/NO_NAME_0')
create('user', 'Property')
cd('Property/user')
cmo.setValue('PBPUBLIC')

cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcDataSourceParams','JDBCDataSourceParams')
cd('JDBCDataSourceParams/NO_NAME_0')
set('JNDIName', java.lang.String("myDataSource_jndi"))

cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')
create('myJdbcConnectionPoolParams','JDBCConnectionPoolParams')
cd('JDBCConnectionPoolParams/NO_NAME_0')
set('TestTableName','SYSTABLES')
g.    Target the resources.
cd('/')
assign('JMSServer', 'myJMSServer', 'Target', 'AdminServer')
assign('JMSSystemResource.SubDeployment', 'myJmsSystemResource.myQueueSubDeployment', 'Target', 'myJMSServer')
assign('JDBCSystemResource', 'myDataSource', 'Target', 'AdminServer')
3.    Save the domain.
setOption('OverwriteDomain', 'true')
writeDomain('c:/bea/user_projects/domains/wls_testscript')
4.    Close the current domain template.
closeTemplate()
5.    Exit WLST.

exit()