Hi,
Here are two Simple WLST Scripts which helps us to Shutdown the DataSources and then start them back to the running state. Usually we need this kind of scripts when we have a schedule database maintenance and we want that our DataSource should be Shutdown to reduce the overhead on WebLogic Server … Once the Database comes up after the maintenance we can restart the DataSources back to the Normal Running state.
You can refer to the following Link to Quickly Create a DataSource Using Ant Script: http://weblogic-wonders.com/weblogic/2010/07/24/datasource-creation-using-ant-task-wlconfig/
Step1). Create a Directory somewhere in your file system “C:\stop_start_DataSources” .
Step2). Write the following WLST script “shutdownDataSource.py” inside “C:\stop_start_DataSources”:
connect(‘weblogic’,'weblogic’,'t3://localhost:7001′)
domainRuntime()
cd(‘ServerRuntimes/AdminServer/JDBCServiceRuntime/AdminServer/JDBCDataSourceRuntimeMBeans/TestDS’)
objectArray = jarray.array([], java.lang.Object)
stringArray = jarray.array([], java.lang.String)
invoke(’shutdown’, objectArray, stringArray)
exit()
Step3). Write the following WLST script “startDataSource.py” inside “C:\stop_start_DataSources”:
connect(‘weblogic’,'weblogic’,'t3://localhost:7001′)
domainRuntime()
cd(‘ServerRuntimes/AdminServer/JDBCServiceRuntime/AdminServer/JDBCDataSourceRuntimeMBeans/TestDS’)
objectArray = jarray.array([], java.lang.Object)
stringArray = jarray.array([], java.lang.String)
invoke(’start’, objectArray, stringArray)
exit()
Step5). Now run the “setWLSEnv.sh” or “setWLSEnv.cmd” file according to your operating system then run the WLST Script “shutdownDataSource.py”
Step6). Now u can verify from adminConsole that the DataSource is Shutdown…right now if you will try to test the DataSource (or if a Client will try to get a fresh connection from DataSource) then you will get the following Error:
weblogic.common.resourcepool.ResourceDisabledException: Data Source TestDS is not active, cannot allocate connections to applications
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:324)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:316)
at weblogic.jdbc.common.internal.DataSourceRuntimeMBeanImpl.testPool(DataSourceRuntimeMBeanImpl.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
Step7). Start the dataSource using the “startDataSource.py” WLST Script:
connect(‘weblogic’,'weblogic’,'t3://localhost:7001′)
domainRuntime()
cd(‘ServerRuntimes/AdminServer/JDBCServiceRuntime/AdminServer/JDBCDataSourceRuntimeMBeans/TestDS’)
objectArray = jarray.array([], java.lang.Object)
stringArray = jarray.array([], java.lang.String)
invoke(’start’, objectArray, stringArray)
exit()
.
.
Thanks
Jay SenSharma

July 27th, 2010 on 3:46 pm
Hai Jay SenSharma,
Kindly arrange to provide solution for the setup the secure the node managers in weblogic.
1. http://biemond.blogspot.com/2010/05/setup-secure-node-managers-and-enable.html
2. http://www.ora600.be/node/9066
3. http://onlineappsdba.com/index.php/2010/07/08/whole-server-migration/
In Weblogic it is not so hard to make a WLS Cluster for your java applications or make a Fusion Middleware cluster for your ADF, Webcenter applications or SOA / OSB processes. But to remotely control this cluster from the console web application you need to setup nodemanagers. If you want to go a little step further and also wants High Availability you need to enable and setup Server Migration in Weblogic. Server Migration only works when you use nodemanagers on all your servers. You can choose for a script nodemager so called SSH nodemanager or for a Java nodemanager.
And the question is, which nodemanager should you choose.
When you have a normal Weblogic domain ( Don’t enable any of the oracle_common options in the Weblogic domain wizard) then you can follow the SSH node manager guide. In this guide you will make a ndmgr account where you copy the weblogic domain from the main domain location into the home directory of ndmgr account. Enable SSH without password between the weblogic and nodemanager accounts. The Admin Server will fire remote scripts over SSH to control the Managed Servers. There is no agent running only scripts. I think the SSH nodemanager is also possible with a Fusion Middleware Cluster but you can’t create or use a ndmgr account and copy the domain to a home directory or to an other path. In Fusion Middleware you can copy the domain to a new folder next to the orginal domain. ( the java jars /ears are loaded on startup with a relative path so in a other path it can’t find the ears) and use this domain for your managed servers. So don’t use the SSH nodemanager with FMW. For a normal weblogic domain I would choose for SSH , because you can copy domain to the home directory of an account. And the nodemanager does not take any resources.
The first part of this blogpost is about the SSH Nodemanager and the second part is about the Java Nodemanager
Before you can follow these steps you need to install Weblogic ( /oracle/Middleware ) and use oracle as user and group. I will show you the steps for Oracle Enterprise Linux ( RedHat )
SSH Nodemanager
Create a user ndmgr which belongs to the oracle group and a home directory /home/ndmgr
log on as ndmgr and in the home directory a hidden ssh folder. mkdir.ssh and cd .ssh
create a rsa key ssh-keygen -t rsa ( accept the location and use no password )
fix the ssh rights by making a keys file copy id_rsa.pub authorized_keys
change the permissions of the .ssh folder cd .. and chmod 700 .ssh
Log in as root and copy this .ssh folder to all the oracle and ndmgr accounts on all machines
Change the owner of this folder chown oracle:oracle .ssh or chown ndmgr:oracle .ssh
For Server migration and fire sudo commands over SSH you need to edit vi /etc/sudoers this allows ifconfig command for the oracle and ndmgr account
Add oracle ALL=NOPASSWD: /sbin/ifconfig,/sbin/arping
Add ndmgr ALL=NOPASSWD: /sbin/ifconfig,/sbin/arping
Enable sudo over ssh by disabling this rule Defaults requiretty
Restart ssh cd /etc/init.d and ./sshd stop and ./sshd start
Log in as oracle and test the ssh connections to all the servers ssh -l ndmgr server1_ip_address
Test adding a new ip address with the weblogic script.
cd /oracle/Middleware/wlserver_10.3/common/bin
./wlsifconfig.sh -addif eth0 10.10.10.150 255.255.255.0
./wlsifconfig.sh -removeif eth0 10.10.10.150
The next step is create a Weblogic domain and copy this to ndmgr account.
Start the domain wizard cd /oracle/Middleware/wlserver_10.3/common/bin and start ./config.sh
Don’t enable the oracle_common options
log in as root and copy this domain from the user_project folder to the ndmgr home directory like cp -R /oracle/Middleware/user_projects/domains/wls_domain /home/ndmgr
Change the rights to the ndmgr user chown ndmgr:oracle /home/ndmgr/wls_domain
log in as ndmgr and create in the home directory a new file vi nodemanager.domains
Add the local domain path /home/ndmgr/wls_domain
Go to the bin folder of your local domain and change in each script the domain variable value to the home directory path.
Create a boot.properties file for each managed server because else weblogic will ask for a password and this will not work remotely. cd /home/ndmgr/wls_domain and mkdir -p servers/Server_1/security Do this for every server
add username=weblogic and password=weblogic
You can test it when you log in as oracle and try to ask the status of a managed server.
ssh -l ndmgr -o PasswordAuthentication=no Server_ip_address /oracle/Middleware/wlserver_10.3/common/bin/wlscontrol.sh -d wls_domain -n /home/ndmgr -c -f startManagedWebLogic.sh -s \’Server_1\’ STAT
The SSH nodemanager does not have a nodemanager.properties file so you need to change the settings in the oracle/Middleware/wlserver_10.3/common/bin/wlscontrol.sh file. In our case you need to add the network device name and subnet mask.
Interface=${WLS_Interface:-”eth0″}
NetMask=${WLS_NetMask:-”255.255.255.0″}
The last part of the SSH node manager is to configure these node manager in the weblogic console.
go to http://xxxx:7001/console
Environment / Machines and select the right servers
In the Node Manager Tab use the following values
Type = SSH
Listen Address= your server ip address
Node manager home = /home/ndmgr
Shell Command = ssh -l ndmgr -o PasswordAuthentication=no -p %P %H /oracle/Middleware/wlserver_10.3/common/bin/wlscontrol.sh -d %D -n /home/ndmgr -c -f startManagedWebLogic.sh -s %S %C
for more information see the Oracle Weblogic documentation
Java Nodemanager
For you can configure the nodemanager you need to start the node manager once. This will create the nodemanager.properties file.
cd /oracle/Middleware/wlserver_10.3/server/bin
./startNodeManager.sh
Enable sudo for the oracle account
For Server migration you need to edit vi /etc/sudoers this allows ifconfig command for the oracle account
Add oracle ALL=NOPASSWD: /sbin/ifconfig,/sbin/arping
Restart ssh cd /etc/init.d and ./sshd stop and ./sshd start
Test adding a new ip address with the weblogic script
cd /oracle/Middleware/wlserver_10.3/common/bin
./wlsifconfig.sh -addif eth0 10.10.10.150 255.255.255.0
./wlsifconfig.sh -removeif eth0 10.10.10.150
For secure communication between your Admin Server and the Java Nodemanamger you need to create some certificates. wls1.local matches with my machine name. Important for hostname verification.
java utils.CertGen welcome wls1_cert wls1_key domestic wls1.local
java utils.ImportPrivateKey wls1KeyStore.jks welcome wls1 welcome /oracle/Middleware/base_domain/wls1/certs/wls1_cert.pem /oracle/Middleware/base_domain/wls1/certs/wls1_key.pem
Make a new truststore based on the weblogic truststore
cp /oracle/Middleware/wlserver_10.3/server/lib/cacerts /oracle/Middleware/base_domain/wls1/certs/wls1TrustKeyStore.jks
cd /oracle/Middleware/base_domain/wls1/certs/
keytool -storepasswd -new welcome -keystore wls1TrustKeyStore.jks -storepass changeit
keytool -import -v -noprompt -trustcacerts -alias clientCACert -file /oracle/Middleware/wlserver_10.3/server/lib/CertGenCA.der -keystore wls1TrustKeyStore.jks -storepass welcome
Configure the nodemanager.properties by adding the network interface / subnet mask and the right certificates
cd /oracle/Middleware/wlserver_10.3/common/nodemanager
vi nodemanager.properties
Add or change these lines
NetMask=255.255.255.0
Interface=eth0
StartScriptEnabled=true
StopScriptEnabled=true
Add the security parameters
KeyStores=CustomIdentityAndCustomTrust
CustomIdentityKeyStoreFileName=/oracle/Middleware/base_domain/wls1/certs/wls1KeyStore.jks
CustomIdentityKeyStorePassPhrase=welcome
CustomIdentityAlias=wls1
CustomIdentityPrivateKeyPassPhrase=welcome
you are ready with the nodemanager configuration and can go to the weblogic console application.
go to http://xxxx:7001/console
go to environment / machines and select the right machine and go the Node manager Tab
Change the node manager field
Type = SSL
Listen Address = your server ip address
Listen Port = 5556
Next step is to change the server keystore and ssl properties
go to environment / servers and select the right server
Go to the Keystores Tab of the configuration Tab and use these values
Keystores = Custom Identity and Custom Trust
Custom Identity Keystore = /oracle/Middleware/base_domain/wls1/certs/wls1KeyStore.jks
Provide the Custom Identiy Keystore Passphrase
Custom Trust Keystore = /oracle/Middleware/base_domain/wls1/certs/wls1TrustKeyStore.jks
Provide the Custom Trust Keystore Passphrase
go the SSL Tab
Private Key Alias = wls1
Provide Private Key Passphrase
That’s all for the java node manager
Enable Server migration
To enable server migration you need to have a database with a table called ACTIVE. The scripts for all database are located at /oracle/Middleware/wlserver_10.3/server/db. for HA you can choose Oracle RAC or MySQL Cluster ( the community edition , this is very light and free ).
See this chapter how to configure WLS for this leasing table.
After that you can set a virtual ip address on your managed servers and configure the cluster and managed servers for migration.
Regards,
S.Vinoth Babu.
July 27th, 2010 on 4:12 pm
Hi Vinoth,
We really appreciate your time and effort for sharing the knowledge with us. Your comment is more that enough for anyone to understand the configuration/understanding on Node Manager. You explained almost everything on Node Manager. The Steps which u have mentioned is very clear. I don’t think that now we need to write any Post on Node Manager any more. I will always refer to your Post whenever anyone will face any issue on forums or any query on Node Manager. You left nothing for me to add some more details on this topic

I will try to add some more information’s on this topic if i will get to know.
.
.
Keep Posting
Thanks
Jay SenSharma
July 28th, 2010 on 2:30 am
hi jay..this is varun
actually im create a 2 machines & 2 nodemanagers. and start the 2 nodemanagers. and put the ms1 and ms2 in machine1 and put the ms3 in machine2.then start the ms1 with machine1 nodemanager and start the ms3 with machine2 nodemanager.but i got 1 error…the error is the request not reached to nodemnager.whats the problem
July 28th, 2010 on 10:27 am
Hi Varun,
Whenever u see that the NodeManager is “not reachable” from AdminConsole …it means we must try to enroll the NodeManager to the Domain. You must follow the Step7) and Step8) mentioned in the following link: http://weblogic-wonders.com/weblogic/2010/04/28/weblogic-clustering-in-remote-boxes/
.
.
Keep Posting
Thanks
Jay SenSharma
July 28th, 2010 on 12:28 pm
Hai Jay SenSharma,
The another new topic is ” Using-mbeans-in-weblogic-server-10gr2 , 10gre to create an alert on state change”
These instructions are for WebLogic 10gR3, which lets you do something depending on the value of an MBean attribute. For example, if you want to get notified by email that the server has changed from ‘Running’ to ‘Overloaded’ State, you can do that. You need to do a few things:
Set up the Notifier. This is what will be used to send you the notice. You can use SNMP traps, email, or drop a message on a JMS Queue.
Create a Diagnostic Module. This acts as a container for performing all the related diagnostic work you are going to set up.
Create a Collection of Metrics, in which you indicate what attributes of what MBeans you want to capture.
Create a Watch. This is basically a rule that is formed by wrapping an XPath-like comparison expression. It includes a set of simple mathematical operators with your attributes.
Create A Diagnostic Module
Under Domain Structure, go to Diagnostics > Diagnostic Modules
New > Name & Description (Make this a general Name to define multiple Watches and notifications.) In this example, mine is called DomainMonitorModule, and the description is: This module monitors the DTD domain to collect JDBC and Server Health stats.
Save and Activate Changes
Now you have an empty module ready to hold your metrics collection and watches.
Collected Metrics
In the Summary of Diagnostic Modules screen, click the name of your new Module. Click the Collected Metrics tab. Make sure the check box is enabled, and set your sampling period. Set Sampling Period (300000 = 5 minutes) This is the default.
Click New and choose choose ServerRuntime for MBean Server Location from the drop down. Click Next. You’ll be taken to the MBean selection page.
Select MBean Type On this screen, you choose the MBean you want to collect metrics for. This can be a custom MBean that you have written. There are MBeans for monitoring server status, GC, classloading, and many more.
Here we’ll choose weblogic.management.runtime.ServerRuntimeMBean, which is the same bean that gives the image of the System Status on the lower-left corner of the WL Console.
For a complete list of documentation of WL MBeans,
Once you’ve chosen your MBean, click Next.
On the Additional Metric Collection Properties page, select the attributes on this MBean that you want to collect data for. Here I’ll choose State by moving it to the Chosen box. Other values include Shutting Down, Open Sockets Current Count, and others.
Leave the Attribute Expressions box empty and click Next.
On the Select Instances screen, choose the instance from within your Cluster that you want to monitor. You have to do this for each instance in your cluster.
Click Finish. You should see your ServerRuntimeMBean in the Collected Metrics in this Module section. Click Save, and Activate Changes.
Now it’s time to create a Watch and Notification for the metrics you’re collecting from the server.
Watches and Notifications
Click the Watches and Notifications tab. Click Lock and Edit so you can make changes. You can change the Severity in the drop down to Warning so that the messages you receive are more meaningful.
Click the Notifications tab and click the New button in the Notifications area.
Give the Notification a Name. I’ll call mine DOMAIN-DEFAULT-NOTIFY because it can be used by multiple modules so I don’t want to be too specific. Choose for the Type: SMTP E-Mail. You can also choose SNMP Trap, JMS, and others. Make sure Enable Notification box is checked.
Click Next, and you will need to configure the SMTP properties for your emailer.
If you do not have a Mail Session associated with the server, you’ll need to set that up now. Here’s now:
Create a Mail Session
A mail session allows WebLogic to send SMTP messages. Click Create a New Mail Session. If you are doing this from scratch, you can start in the Domain Structure menu at Services > Mail Sessions and the rest of the steps are the same.
First, give it a name. I’ll choose AlertMailer
Then give it a JNDI name. I’ll choose mail/alertMailer.
Then specify your JavaMail properties. These values are separated by a semi-colon. You can check the help on this page to see the complete set of values. These are what I’ll use:
mail.host=mail.example.com; –> weblogic server ip address
mail.smtp.host=mail.example.com; –> smtp server ip address
mail.transport.protocol=smtp; —> smtp
mail.from=My-Cluster@example.com —> root@weblogic server ip address
Ckick Next, then you’ll be on the Mail Session Targets Screen. Associate this Mail Session with the cluster or instances in the cluster that you want. Click Finish.
Now you’ll be returned to the Create Notification Screen.
Enter a comma-separated list of email recipients.( example : vinobabu2001@gmail.com , vinobabu2001@yahoo.com ) Stick with the defaults for Email Subject and Body as they will be filled in with runtime values from the MBean.
In the Email Recipients list, I’ll use: notify@example.com
Now Save and Activate Changes. You should see EmailNotifier under your list of Notifications.
Now that you have a Nofication set up, it’s time to make a Watch.
Watches
You now have a way to send a notice through the Notification, and you have some metrics you are collecting from the MBeans running in the server. Now you need to create a watch to put these together with an expression you want to evaluate the runtime MBean values against, and trigger a notification if necessary.
To create a new Watch, click the Watches tab. Under the Watches area, click New. Give your watch a name. I’ll pick a very descriptive name that includes the MBean I’m checking and the server it’s running on, because we’ll need to repeat this step once for each MBean on each server we’re watching. I’ll choose this name: SVR-BEA1-S1-SERVER-STATE.
Click Next
Now you have to add a Watch Rule. Click Add Expressions. Choose ServerRuntime from the drop down, click next.
From the drop down, choose the same MBean type you are collecting metrics for. In this case it’s weblogic.management.runtime.ServerRuntimeMBean. Click Next.
Choose the Server instance from the cluster that you want. Here we’ll choose BEA1-S1. Click Next.
Set the Expression. Choose the attribute of this MBean you want to participate in the expression. Here we’ll choose State for the Message Attribute.
Then choose Operator != and Value of RUNNING (it is case-sensitive and others, like the JDBC one, is ‘Running’).
This returns us to the Configure Watch Rule Expression screen and writes this rule into the text box:
(${ServerRuntime//weblogic.management.runtime.ServerRuntimeMBeancom.bea:Name=SVR-BEA1-S1,Type=ServerRuntime//State} != ‘Running’)
Click Next and ‘Use an automatic reset alarm’ to restart the watch. Leave the default of 60 seconds.
Now on the Configure Watch Notifications screen choose the Email Notifier by moving it to the Chosen box.
Click Save and Activate Changes.
Target The Watch
Now choose Targets, and associate it with your server instance. Click Lock and Edit and Choose your server name. Then Activate Changes.
Resulting Email Notice
You’re all done. The email alert you’ll get will look something like this:
SUBJECT: WatchTime: Jan 13, 2009 2:12:16 PM MSTEMAIL
BODY: WatchTime: Jan 13, 2009 2:12:16 PM MST
WatchDomainName: SVR10DOMAIN
WatchServerName: SVR-BEA3-S2
WatchSeverityLevel: Warning
WatchName: SVR-BEA3-S2-JDBC-POOL-STATE
WatchRuleType: Harvester
WatchRule: (${ServerRuntime//[weblogic.management.runtime.JDBCConnectionPoolRuntimeMBean]com.bea:Name=MyWebDataSource,ServerRuntime=SVR-BEA3-S2,Type=JDBCConnectionPoolRuntimeState} != ‘Running’)
WatchData: ServerRuntime//[weblogic.management.runtime.JDBCConnectionPoolRuntimeMBean]com.bea:Name=MyWebDataSource,ServerRuntime=SVR-BEA3-S2,Type=JDBCConnectionPool
RuntimeState = Overloaded
WatchAlarmType: AutomaticResetWatchAlarm
ResetPeriod: 60000
SMTPNotificationName: AlertMailer
This email notice indicates that the server was looking for a Not Running state, and found a state of Overloaded, which is a Bad Thing. So it’s a Good Thing to know that’s going on.
=========================================================================================================================================================
mail.host:=localhost
mail.smtp.host=localhost
mail.transport.protocol=smtp
mail.from=weblogic@localhost
JavaMail Properties:
=====================
mail.host:=localhost;
mail.smtp.host=smtp ip address;
mail.transport.protocol=smtp;
mail.from=root@localhost
mail.host=mail.example.com;
mail.smtp.host=mail.example.com;
mail.transport.protocol=smtp;
mail.from=My-Cluster@example.com
mail.from=root@localhost mail.transport.protocol=smtp; mail.smtp.host=smtp ip address; mail.host==localhost;
In Properties, specify information for connecting to an existing mail server.
The following table describes all valid properties and default values (all of which are derived from the JavaMail API Design Specification).
Specify a property only if you want to override the default value. If you do not specify any properties, this mail session will use the JavaMail default property values.
Express each property as a name=value pair. Separate multiple properties with a semicolon (;).
Property Description Default
mail.store.protocol Protocol for retrieving email. Example: mail.store.protocol=imap imap
mail.transport.protocol Protocol for sending email. Example: mail.transport.protocol=smtp smtp
mail.host The name of the mail host machine. Example: mail.host=mailserver Local machine
mail.user Name of the default user for retrieving email. Example: mail.user=postmaster Value of the user.name Java system property.
mail.protocol.host Mail host for a specific protocol. For example, you can set mail.SMTP.host and mail.IMAP.host to different machine names. Examples: mail.smtp.host=mail.mydom.com mail.imap.host=localhost Value of the mail.host property.
mail.protocol.user Protocol-specific default user name for logging into a mailer server. Examples: mail.smtp.user=weblogic mail.imap.user=appuser Value of the mail.user property.
mail.from The default return address. Examples: mail.from=master@mydom.com username@host
mail.debug Set to True to enable JavaMail debug output. False
Regards,
S.Vinoth Babu.
July 28th, 2010 on 1:54 pm
Thanks for sharing it with our readers!
-Faisal
July 29th, 2010 on 12:05 pm
Hai Jay SenSharma,
Today the new topic how to configure the JRockit Misson control into the weblogic console to monitor the heap size and other many features in your windows platform.( example : the weblogic server is configure in the linux environment but you have monitor the heap size in the linux environment)
JRockit is the first JVM designed to run server-side applications. It is now the high performance JVM used in the core of Oracle Fusion Middleware. With its deterministic nature for performing garbage collection, it is now used on many time driven and high through application architectures like Algo Trading, Military Asset Tracking, Transportation & Logistics etc.
With its wide adoption, rich tool set and high performance, JRockit is now used for Enterprise Application Servers, Portal Servers, Integration Servers, Enterprise Service Bus, Identity Management Servers, Time Driven & Complex Event Processing Applications etc.
Oracle WebLogic Server installations are bundled with 2 flavors of JVM. On all Intel based installers in addition to Sun’s Hotspot JVM, Oracle’s JRockit JVM is also included. The default JVM for a WebLogic Domain is configured when a Domain is created using the Configuration Wizard or WLST. But all the built-in tools comes with WebLogic Server are configured to JRockit JVM. If the Domain is selected to run in Production Mode the JVM selection will default to the bundled JRockit SDK whereas Sun SDK will be selected for the Domains configured in Development Mode.
After the fact that you create the domain if you want to change your server(s) JDK to JRockit, you can do so by modifying the server’s start up scripts. The server start up scripts startWebLogic.cmd/sh and startManagedWebLogic.cmd/sh both rely on a setup script for environment setting – setDomainEnv.sh. You can include an environment variable (JAVA_VENDOR) definition either on top of that script or on the shell to modify the JVM that the server(s) should use.
Windows:
set JAVA_VENDOR=BEA
*nix:
export JAVA_VENDOR=BEA
After this variable is set, the server(s) should start using JRockit JVM. You can find out the version of JVM used by the server on its log output or stdout. Some of the non-standard command-line options are not supported by all JVM vendors. So you might want to refer to JRockit’s documentation for JRockit specific command-line options
JRockit provides lot of tools that you can use to get more inside and realtime information from the applications running on JRockit JVM. These tools are packaged as JRockit Mission Control. I will write more about JRockit Mission Control and the tools included in that package on my future entries.
Oracle JRockit in not only for WebLogic Server and WebLogic Suite of products. You can use this for any Java application. JRockit is a certified and compatible with Java application complied using Sun SDK.
To find out more about JRockit go to the official FAQ page – http://www.oracle.com/technology/software/products/jrockit/FAQ.html
To download JRockit go to – http://www.oracle.com/technology/software/products/jrockit/index.html
Regards,
S. Vinoth Babu
July 29th, 2010 on 1:33 pm
Thanks Vinod for sharing it with us.
Hope it will help our readers.
Keep Posting!!
Faisal Khan
July 30th, 2010 on 11:47 am
Using storeUserConfig For Security Access
Hi Jay SenSharma & Faisal Khan,
Today the new topic is storeUserConfig keyword to create the user key file & config file due to remote deployment in the Windows environment. The application are configured in the linux environment. But we deploy the application through the windows command prompt not using the weblogic console and what is difference between stage and nostage mode for example in you console all the shared libraries are deployed in the nostage mode.
[root@localhost bin]# pwd
/oracle/Middleware_1033/wlserver_10.3/common/bin
[root@localhost bin]# ls -lrt
total 104
-rwxr-x— 1 root root 13386 Jun 8 16:15 wlsifconfig.sh
-rwxr-x— 1 root root 759 Jun 8 16:15 wlst.sh
-rwxr-x— 1 root root 30461 Jun 8 16:15 wlscontrol.sh
-rwxr-x— 1 root root 3296 Jun 8 16:15 upgrade.sh
-rwxr-x— 1 root root 2148 Jun 8 16:15 unpack.sh
-rwxr-x— 1 root root 4086 Jun 8 16:15 startManagedWebLogic.sh
-rwxr-x— 1 root root 2702 Jun 8 16:15 pack.sh
-rwxr-x— 1 root root 2272 Jun 8 16:15 config.sh
-rwxr-x— 1 root root 2120 Jun 8 16:15 config_builder.sh
-rwxr-x— 1 root root 22073 Jun 8 16:15 commEnv.sh
-rwxr-x— 1 root root 2182 Jun 8 16:15 setPatchEnv.sh
[root@localhost bin]# source wlst.sh
Initializing WebLogic Scripting Tool (WLST) …
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> connect(‘weblogic’,'weblogic123′,url=’localhost:5001′)
Connecting to t3://localhost:5001 with userid weblogic …
Successfully connected to Admin Server ‘AdminServer’ that belongs to domain ‘vinoth’.
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.
wls:/offline>storeUserConfig(userConfigFile=’/prosun/vinoth_userconfigfile.properties’,userKeyFile=’/prosun/vinoth_usekeyfile.properties’)
wls:/vinoth/serverConfig> storeUserConfig(userConfigFile=’/prosun/vinoth_userconfigfile’,userKeyFile=’/prosun/vinoth_usekeyfile’)
Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to create the key file? y or n
Please confirm user config key creation: y or ny
The username and password that were used for this WebLogic Server connection are stored in /prosun/vinoth_userconfigfile and /prosun/vinoth_usekeyfile.
wls:/vinoth/serverConfig>
wls:/vinoth/serverConfig> exit()
Exiting WebLogic Scripting Tool.
[root@localhost bin]#
Using userConfigFile File to get Access to AdminServer
Now we connect the weblogic through the userConfigFile & userKeyFile:
[root@localhost bin]# java weblogic.WLST
Initializing WebLogic Scripting Tool (WLST) …
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> connect(userConfigFile=’/prosun/vinoth_userconfigfile.properties’,userKeyFile=’/prosun/vinoth_userkeyfile.properties’,url=’localhost:5001′)
Connecting to t3://localhost:5001 with userid weblogic …
Successfully connected to Admin Server ‘AdminServer’ that belongs to domain ‘vinoth’.
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.
output:
[root@localhost prosun]# pwd
/prosun
[root@localhost prosun]# ls -lrt
-rw-r—– 1 root root 227 Jul 5 16:25 vinoth_userconfigfile
-rw-r—– 1 root root 64 Jul 5 16:25 vinoth_usekeyfile
Remote Deployment Using userConfigFile:
The weblogic console is configured in Linux environment. But in you local PC is the Windows environment but you have install the jdev 11g R2 in you local pc. Then create the batch file and deploy the application in Linux Envrironment.
Deploy (nostage) — remote deployment
[root@sis-prosun02 ears]# java weblogic.Deployer -adminurl t3://localhost2:7001 -user weblogic -password weblogic1 -deploy -name ManagedServerName -nostage -upload /prosun/ears/ManagedServerName.ear -targets psMS1,psMS2
weblogic.Deployer invoked with options: -adminurl t3://localhost:7001 -user weblogic -deploy -name ManagedServerName -nostage -upload /prosun/ears/ManagedServerName.ear -targets psMS1,psMS2
Task 78 initiated: [Deployer:149026]deploy application ManagedServerName on psMS1,psMS2.
Task 78 completed: [Deployer:149026]deploy application ManagedServerName on psMS1,psMS2.
Target state: deploy completed on Server psMS1
Target state: deploy completed on Server psMS2
[root@sis-prosun01 app]# find / -name ManagedServerName.ear
/oracle/Middleware_1032/user_projects/domains/psdomain/servers/AdminServer/upload/ManagedServerName/app/ManagedServerName.ear
[root@sis-prosun01 app]#
===========================================================================================================================================================
Deploy (stage) — remote deployment
[root@sis-prosun02 bin]# java weblogic.Deployer -adminurl t3://localhost2:7001 -user weblogic -password weblogic1 -deploy -name ManagedServerName -stage -upload /prosun/ears/ManagedServerName.ear -targets psMS1,psMS2
weblogic.Deployer invoked with options: -adminurl t3://localhost:7001 -user weblogic -deploy -name ManagedServerName -upload /prosun/ears/ManagedServerName.ear -targets psMS1,psMS2
Task 66 initiated: [Deployer:149026]deploy application ManagedServerName on psMS1,psMS2.
Task 66 completed: [Deployer:149026]deploy application ManagedServerName on psMS1,psMS2.
Target state: deploy completed on Server psMS1
Target state: deploy completed on Server psMS2
[root@sis-prosun01 ears]# find / -name ManagedServerName.ear
/oracle/Middleware_1032/user_projects/domains/psdomain/servers/psMS1/stage/ManagedServerName/ManagedServerName.ear
/oracle/Middleware_1032/user_projects/domains/psdomain/servers/AdminServer/upload/ManagedServerName/app/ManagedServerName.ear
/oracle/Middleware_1032/user_projects/domains/psdomain/servers/psMS2/stage/ManagedServerName/ManagedServerName.ear
===========================================================================================================================================================
Deploy (nostage) — remote deployment
[root@sis-prosun02 ears]# java weblogic.Deployer -adminurl t3://localhost:7001 -user weblogic -password weblogic1 -deploy -name ManagedServerName -nostage -upload /prosun/ears/ManagedServerName.ear -targets psMS1,psMS2
weblogic.Deployer invoked with options: -adminurl t3://localhost:7001 -user weblogic -deploy -name ManagedServerName -nostage -upload /prosun/ears/ManagedServerName.ear -targets psMS1,psMS2
Task 78 initiated: [Deployer:149026]deploy application ManagedServerName on psMS1,psMS2.
Task 78 completed: [Deployer:149026]deploy application ManagedServerName on psMS1,psMS2.
Target state: deploy completed on Server psMS1
Target state: deploy completed on Server psMS2
[root@sis-prosun01 app]# find / -name ManagedServerName.ear
/oracle/Middleware_1032/user_projects/domains/psdomain/servers/AdminServer/upload/ManagedServerName/app/ManagedServerName.ear
using the ” upload ” parameter to deploy the aplicaton through remote
using the ” source ” paramter to deploy the appliction in the curren machine
===========================================================================================================================================================
In Windows Environment if you install the jdev 11gR2 then the below batch files are available in this mentioned path. It is used to set the Environment. Deploy the application in linux environment.
1. D:\Oracle\Middleware2.0\wlserver_10.3\server\bin>setWLSEnv.cmd
CLASSPATH=/oracle/Middleware_1033/patch_wls1033/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/Middleware_1033/patch_jdev1111/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/Middleware_1033/jdk160_18/lib/tools.jar:/oracle/Middleware_1033/wlserver_10.3/server/lib/weblogic_sp.jar:/oracle/Middleware_1033/wlserver_10.3/server/lib/weblogic.jar:/oracle/Middleware_1033/modules/features/weblogic.server.modules_10.3.3.0.jar:/oracle/Middleware_1033/wlserver_10.3/server/lib/webservices.jar:/oracle/Middleware_1033/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/oracle/Middleware_1033/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:
PATH=/oracle/Middleware_1033/wlserver_10.3/server/bin:/oracle/Middleware_1033/modules/org.apache.ant_1.7.1/bin:/oracle/Middleware_1033/jdk160_18/jre/bin:/oracle/Middleware_1033/jdk160_18/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
Your environment has been set.
Deploy (nostage) — remote deployment
D:\Oracle\Middleware2.0\wlserver_10.3\server\bin>java weblogic.Deployer -adminurl t3://linuxserveripaddress:7001 -user weblogic -password weblogic1 -deploy -name ManagedServerName -nostage -upload c:/ears/ManagedServerName.ear -targets psMS1,psMS2
Deploy (nostage) — remote deployment
D:\Oracle\Middleware2.0\wlserver_10.3\server\bin>java weblogic.Deployer -adminurl t3://linuxserveripaddress:7001 -user weblogic -password weblogic1 -deploy -name ManagedServerName -stage -upload c:/ears/ManagedServerName.ear -targets psMS1,psMS2
===========================================================================================================================================================
Thanks
Vinoth Babu
July 30th, 2010 on 2:02 pm
Hi Vinoth,
Thank you for sharing great knowledge with us and our readers. We have started a new Feature in weblogic-wonders : “http://weblogic-wonders.com/weblogic/forums/”
Where users can post their comments and solutions for others. As well as for knowledge sharing also we have added a new Page : http://weblogic-wonders.com/weblogic/forums/knowledge-sharing/ Where our Experiences and Knowledge can be shared with all the Admin Community across the world.
Thanks for your time and effort.

.
.
Keep Posting
Thanks
Jay SenSharma