A quick tutorial for middleware products

Saturday, November 22, 2014

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()

0 comments:

Post a Comment