Saturday, September 1, 2012

Thread Dumps in WebLogic12c Server

Here going to provide information about different ways on taking java thread dumps in a WebLogic Server environment.

Thread dumps are very useful to analyze and troubleshoot performance related issues such as server hang, deadlocks, slow running, idle or stuck applications,  etc.

Different ways to take thread dumps in WebLogic Server

Always prefer Operating system(OS) commands rather instead of Admin Console or Java Classes, because if the console is hanging, users won't be able to connect to it to issue thread dumps.

1. OS Commands for Thread Dumps

i) On Windows,

<ctrl>+<break> -- the thread dumps are generated in the server stdout

ii) On Solaris / Linux

first identify the process ID (pid) using   ps -ef | grep java, then run   kill -3 <pid> td_filename 2>&1

2. Using weblogic.WLST ( work only from WLS 9.x onwards)


First set CLASSPATH using setDomain.cmd or setDomain.sh (wlst.sh /wlst.cmd will also do in path C:\Oracle\Middleware\wlserver_12.1\common\bin ). Then run below command

java weblogic.WLST ThreadDumps.py

save below code in ThreadDumps.py file:
connect("<username>","<password>","t3://<url>:<port>")
cd(‘Servers’)
cd(‘AdminServer’)
threadDump()
disconnect()
exit()
threadDump()

The thread dumps get stored in the location from where you run it.

3. From Weblogic Administration Console

navigating to Server -> <server_name> -> Monitoring -> Dump threads stack.

4. From the JRockit Command line

jrcmd <pid> print_threads

Tuesday, August 28, 2012

Disabling and enabling the Weblogic 12c Administration Console

To disable:

1. Select your domain name in the Domain Structure panel of the console(as base_domain below).



     2. Select Configuration | General, and click Advanced at the bottom of the page, and unselect Console Enabled.

OR

Using WLST:-

connect("username","password")
edit()
startEdit()
cmo.setConsoleEnabled(false)
save()
activate()
disconnect()
exit()

3. To enable, you can use WLST. The following code shows how to do it:

connect("username","password")
edit()
startEdit()
cmo.setConsoleEnabled(true)
save()
activate()
disconnect()
exit()

 

Saturday, August 25, 2012

Weblogic 12c Installation Directories Structure

Exploring Middleware Home Directory

By default, Weblogic 12c choose C:\Oracle\Middleware directory for installation on Windows.

Oracle\Middleware Directory









































































DirectoryContents
/ coherence_3.7Coherence home directory
/ jdk160_29Sun JDK ((Recommended for Development Mode))
/ jrockit_versionJRockit JDK (Recommended for Production Mode)
/ logsLocation for various log files about installation and uninstallation for the Middleware home directory.
/modulesLocation for modules such as Apache Ant
/ oepe_12.1.1.0.1Files related to Oracle Enterprise Package for Eclipse
/ patch_ocp371 
/ patch_oepe101 
/user_projectsContains Domain
/ utilscontains utilities that are used to support the installation of all products installed in this home directory.
/ wlserver_12.1WebLogic Server home directory
.homeThis file contains the information about the Middleware home directory.
domain-registry.xmlThis registry file contains the location of all domains currently registered with this WebLogic Server installation. Whenever you add a new domain, it is registered in this file.
ocm.rspThis response file contains information about the Oracle Configuration Manager (OCM) installation.
registry.datThis registry contains product-related information, such as version number, patch set level, patch level, and location of the product installation directories. It also contains the name of the installed JDK(s) and the Java home.
registry.xmlThis is an encrypted version of the registry.xml file.

WebLogic Server Home Directory(WL_HOME): By default it is located in the Oracle\Middleware\wlserver_12.1



WebLogic Server Domain Directory





















































DirectoryContent
/ autodeployIn a development environment, the server will automatically deploy any applications or modules you place here. You must run the server in development mode for it to take advantage of the automatic deployment feature.
/ binContains the start and stop scripts
/ configContains the key domain configuration file, config.xml.
/ console-extContains any Administration Console extensions you've created
/ init-info This directory contains files that are used for WebLogic domain provisioning. You should not modify any files in this directory.
/ libYou can place JAR files in this directory so they can be available to all applications running on the domain's server instances.
/ securityHolds security-related files such as SerializedSystemIni.dat.
/ serversThis is an important directory that contains a separate subdirectory for each of the servers in your domain, including both Admin and Managed Servers.
fileRealm.properties 
startWebLogic.cmd 
startWebLogic.sh 

Note:

Note while creating  the Middleware home directory:

  • Do not include spaces in the name of your Middleware home directory otherwise the CLASSPATH may not be resolved properly.

  •  You can install only one instance of each version of a WebLogic Server product in a single Middleware home directory. For example, you can install only one instance of the current version of WebLogic Server in a Middleware home directory, but you can have an earlier version of WebLogic Server in a separate Middleware home directory.

  • If the home directory is not empty and it does not contain registry.xml, or if any of the product installation directories are not empty, one of the following messages is displayed:


For home directory selection task—Middleware home directory is not empty. Proceed with installation?

For product installation directory selection task—One or more installation directories are not empty. Proceed with installation?

 

Wednesday, May 23, 2012

JAVA Enterprise Edition 6.0 - JEE6

List of Technologies that are included in Java Enterprise Edition 6.0 ( JEE6 ) release .





















































































































































Web Services Technologies:


Java API for RESTful Web Services (JAX-RS) 1.1JSR 311
Implementing Enterprise Web Services 1.3JSR 109
Java API for XML-Based Web Services (JAX-WS) 2.2JSR 224
Java Architecture for XML Binding (JAXB) 2.2JSR 222
Web Services Metadata for the Java PlatformJSR 181
Java API for XML-Based RPC (JAX-RPC) 1.1JSR 101
Java APIs for XML Messaging 1.3JSR 67
Java API for XML Registries (JAXR) 1.0JSR 93

Web Application Technologies:


Java Servlet 3.0JSR 315
JavaServer Faces 2.0JSR 314
JavaServer Pages 2.2/Expression Language 2.2JSR 245
Standard Tag Library for JavaServer Pages (JSTL) 1.2JSR 52
Debugging Support for Other Languages 1.0JSR 45

Enterprise Application Technologies:


Contexts and Dependency Injection for Java (Web Beans 1.0)JSR 299
Dependency Injection for Java 1.0JSR 330
Bean Validation 1.0JSR 303
Enterprise JavaBeans 3.1 (includes Interceptors 1.1)JSR 318
Java EE Connector Architecture 1.6JSR 322
Java Persistence 2.0JSR 317
Common Annotations for the Java Platform 1.1JSR 250
Java Message Service API 1.1JSR 914
Java Transaction API (JTA) 1.1JSR 907
JavaMail 1.4JSR 919

Management and Security Technologies:


Java Authentication Service Provider Interface for ContainersJSR 196
Java Authorization Contract for Containers 1.3JSR 115
Java EE Application Deployment 1.2JSR 88
J2EE Management 1.1JSR 77

Java EE-related Specs in Java SE


Java API for XML Processing (JAXP) 1.3JSR 206
Java Database Connectivity 4.0JSR 221
Java Management Extensions (JMX) 2.0JSR 255
JavaBeans Activation Framework (JAF) 1.1JSR 925
Streaming API for XML (StAX) 1.0JSR 173

 Read more for the application servers supporting JEE6




Application Servers Which Support JEE6 Specifications 


 

Oracle WebLogic Server Version 12.1.1 . 


This version of Oracle Weblogic Server is also Known as Weblogic 12c Release 1 .

Check this link for more details on JEE6 Specifications supported by Weblogic Server 12c Release 1.

Weblogic Server 12c Release 1 Download. 

 

JBoss Application Server 7 :


JBoss Application Server 7 is the latest release in JBoss Application Server Release.

For Downloading , and Supporting Specifications and Start Up Guide :  

 

IBM WebSphere Application Server V8 :


This was the first application Server that was released with JEE6 Support.

For Downloading WebSphere Application Server V8.5 :

 

Oracle GlassFish Open Source Edition 3.1.2 . 


For Downloading GlassFish Server :

 

Tuesday, May 15, 2012

Error With Apache 2.4 on Windows 7 64 bit

I was trying to install Apache Http Server 2.4 on Windows 7 64 bit and was receiving error while starting the Apache Server :

 

AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using XXXX::XXXX:XXXX:XXXX.
Set the 'ServerName' directive globally to suppress this message


 

Root Cause :


Apache Server is looking for the hostname name which it can use to start and listen for request. If there is a hostname configured on the machine and it is not configured in the httpd.conf file then it will throw this error .

Solution:



  • Get the hostname of the machine on which the Apache Server is installed using the OS command : hostname

  • Configure the same in the httpd.conf file with the directive : ServerName as shown below:


ServerName Sandeep

  • Restart the Apache Server.


In case you do not want to use the Machine Hostname with the Apache Server then make the ServerName Entry in the httpd.conf file as localhost.



 

 

Wednesday, March 14, 2012

Different Memory Argument values for SOA Servers and BAM Servers In Weblogic 11g.

This post is about providing specific memory arguments values to SOA server and BAM servers in Weblogic 11g.

There are two scenarios:




  1. Admin Server is Started using the startWeblogic.cmd or startWeblogic.sh file and all other servers are started using startManagedWeblogic.cmd or startManagedWeblogic.sh 




  2. Admin Server is Started using the startWeblogic.cmd or startWeblogic.sh file and all other servers are started using the Admin Server Console.




Case1 :  


Admin Server is Started using the startWeblogic.cmd or startWeblogic.sh file and all other servers are started using startManagedWeblogic.cmd or startManagedWeblogic.sh 


First of all we have to analyse the startWeblogic.sh file that is used to start the Admin Server and the startManagedWeblogic.sh file that is used to start all other managed servers such as SOA server and BAM server.

Both the above mentioned file uses setDomainEnv.sh file to set the Domain related environment.

And setDomainEnv.sh file uses setSOADomainEnv.sh file for setting SOA specific environments.

So the memory related arguments like Xmx and Xms are picked up from the file : setSoaDomainEnv.sh file present in the $DomainHome/bin directory.

So, in order to provide different Xmx and Xms values for Admin Server , SOA server and BAM server we have to modify the setSOADomainEnv.sh file as shown below :

Imp : Please make sure to take backup of all the original files before modifying them .

In setSOADomainEnv.sh file comment the below lines :
# DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
# PORT_MEM_ARGS="-Xms2048m -Xmx2048m"

Insert the below lines replace the above commented code :
# line to specify different Xmx and Xms values to soa_server and bam_server.

if [ "${SERVER_NAME}" = "soa_server1" ] || [ "${SERVER_NAME}" = "soa_server2" ]; then
DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
elif [ "${SERVER_NAME}" = "bam_server1" ] || [ "${SERVER_NAME}" = "bam_server2" ]; then
DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
elif [ "${SERVER_NAME}" = "" ] || [ "${SERVER_NAME}" = "AdminServer" ]; then
DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
else
DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
fi

# end of code

 

Case 2 :  


Admin Server is Started using the startWeblogic.cmd or startWeblogic.sh file and all other servers are started using the Admin Server Console.


In this case, the Memory Arguments can be provided to from the Admin Server Console using the below steps :

 

  •  Login into the Weblogic Administration Console using URL : http://admin_server_hostname:port/console

  • Expand Environment Tree available on the left hand panel of the Admin Console.

  • Click on Servers .

  • For each Server say ( soa_server1 , and bam_server ) click on the server name .

  • Then click on the Configuration tab.

  • Then go to the Server Start tab available on the top of the page.

  • Add the memory values in the Arguments field as shown below. There is no need to use newline. You can provide as many memory options as you want in this area and all the options will be separated by one white space character only.


 

-Xmx2048m -Xms2048m

  • Click Save






Post you may be Interested: 




Click If want to learn how to start Managed Servers using Node Manager and Admin Console then you can follow the below link :




If you are facing any issues with the Node Manager then you can see some debug steps in the below link :

 

 

 

Friday, February 17, 2012

Starting Managed Servers without an Administration Server using Node Manager and WLST

Weblogic 12c


 

The steps for starting the Managed  Server without AdminServer using WLST and Node Manager are as follows :

i)  Setting up your environment.

Add WebLogic Server classes to the CLASSPATH environment variable and WL_HOME\server\bin to the PATH environment variable.  OR

You can use a  C:\Oracle\Middleware\wlserver_12.1\server\bin\setWLSEnv.cmd  script to set both variables.



 

ii)  Start WLST Session using command : java weblogic.WLST



iii)  Start Node Manager using command :

                         startNodeManager(verbose='true', NodeManagerHome='C:\\Oracle\\Middleware\\wlserver_12.1\\common\\nodemanager', ListenPort='5556', ListenAddress='localhost')





iv) Connect WLST to a Node Manager by entering the nmConnect command.

nmConnect('weblogic', 'weblogic123', 'localhost', '5556', 'base_domain' , 'C:\\Oracle\\Middleware\\user_projects\\domains\\base_domain' , 'ssl')



note: Node Manager security relies on a one-way SSL connection between the client and server.If you are establishing a command line connection to the Java Node Manager using the WebLogic Server Scripting Tool (WLST) nmConnect command, you provide the Node Manager user name and password(here weblogic and weblogic123 respectively). Node Manager verifies the username and password against the domain's nm_password.properties file.Node Manager credentials are located on the Security>General>Advanced Options of Console page.Administration Console users do not need to explicitly provide credentials to connect to Node Manager—the Node Manager user name and password are available in the domain configuration and are provided automatically.

v) Starts the managed server in the current domain using Node Manager. : nmStart('Server-0')



 

 

 Related Common Issues :


 

If you are trying to automate the environment using Node Manager and WLST .

And you are trying to Start the Admin Server and all the Managed Server using WLST only.

And the Managed servers are to be started for the first time using WLST and Node Manager then you may encounter the below error :

 






There are 1 nested errors:

weblogic.management.ManagementException: Booting as admin server, but servername, soa_server1, does not match the admin server name, AdminServer
at weblogic.management.provider.internal.RuntimeAccessService.start(RuntimeAccessService.java:67)
at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesManager.java:461)
at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServicesManager.java:166)
at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:879)
at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:566)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:467)
at weblogic.Server.main(Server.java:71)


Cause :


The reason for the above error is that when the Managed Server are to be started for the first time using the Node Manager and WLST,  the boot.properties file ( at %domain_home%/servers/ManagedServer/security/) and startup.properties file ( %domain_home%/servers/ManagedServer/data/NodeManager/) should be already present.

Solution :


To generate the boot.properties file , and startup.properties file use the below WLST command :

 nmGenBootStartupProps('ms1') 


 

 

 

 

Starting the Managed Server Using Node Manager and WLST

Weblogic 12c


 

The steps for starting the Managed  Server  using WLST and Node Manager are as follows :

i)  Setting up your environment.

Add WebLogic Server classes to the CLASSPATH environment variable and WL_HOME\server\bin to the PATH environment variable.  OR

You can use a  C:\Oracle\Middleware\wlserver_12.1\server\bin\setWLSEnv.cmd  script to set both variables.



 

ii)  Start WLST Session using command : java weblogic.WLST



iii)  Start Node Manager using command :

                         startNodeManager(verbose='true', NodeManagerHome='C:\\Oracle\\Middleware\\wlserver_12.1\\common\\nodemanager', ListenPort='5556', ListenAddress='localhost')





iv) Connect WLST to a Node Manager by entering the nmConnect command.

nmConnect('weblogic', 'weblogic123', 'localhost', '5556', 'base_domain' , 'C:\\Oracle\\Middleware\\user_projects\\domains\\base_domain' , 'ssl')



note: Node Manager security relies on a one-way SSL connection between the client and server.If you are establishing a command line connection to the Java Node Manager using the WebLogic Server Scripting Tool (WLST) nmConnect command, you provide the Node Manager user name and password(here weblogic and weblogic123 respectively). Node Manager verifies the username and password against the domain's nm_password.properties file.Node Manager credentials are located on the Security>General>Advanced Options of Console page.Administration Console users do not need to explicitly provide credentials to connect to Node Manager—the Node Manager user name and password are available in the domain configuration and are provided automatically.

 

v) Use the nmStart command to start a server.
nmStart('AdminServer')



Monitor the status of the Administration Server by entering the nmServerStatus command.
nmServerStatus('AdminServer')

vi) Connect WLST to a running WebLogic Administration Server instance using the connect command.
connect('weblogic','weblogic123')



vii) To start a Managed Server or cluster, enter the following command:
start('Server-0','Server')
         start('mycluster', 'Cluster')



viii) Stop the server by entering the nmKill command.
nmKill('Server-0')



 

ix) Stop the AdminServer by entering the nmKill command.
nmKill('AdminServer')



  x) Disconnect the node manager :     nmDisconnect()   and   Exit the WLST:     exit()



note:  To find node manager process :
For windows
netstat -ao| findstr 5556
TCP    ajit:5556              ajit:0                 LISTENING       1900

here : PID - 1900.

For Linux/unix :

netstat -an | grep -v grep | grep weblogic.NodeManager

 

 

Starting the Administration Server Using Node Manager and WLST

Weblogic 12c


The steps for starting an Administration Server using WLST and Node Manager are :

 

i)  Setting up your environment.

Add WebLogic Server classes to the CLASSPATH environment variable and WL_HOME\server\bin to the PATH environment variable.  OR

You can use a  C:\Oracle\Middleware\wlserver_12.1\server\bin\setWLSEnv.cmd  script to set both variables.



 

ii)  Start WLST Session using command : java weblogic.WLST



iii)  Start Node Manager using command :

                         startNodeManager(verbose='true', NodeManagerHome='C:\\Oracle\\Middleware\\wlserver_12.1\\common\\nodemanager', ListenPort='5556', ListenAddress='localhost')





iv) Connect WLST to a Node Manager by entering the nmConnect command.

nmConnect('weblogic', 'weblogic123', 'localhost', '5556', 'base_domain' , 'C:\\Oracle\\Middleware\\user_projects\\domains\\base_domain' , 'ssl')



note: Node Manager security relies on a one-way SSL connection between the client and server.If you are establishing a command line connection to the Java Node Manager using the WebLogic Server Scripting Tool (WLST) nmConnect command, you provide the Node Manager user name and password(here weblogic and weblogic123 respectively). Node Manager verifies the username and password against the domain's nm_password.properties file.Node Manager credentials are located on the Security>General>Advanced Options of Console page.Administration Console users do not need to explicitly provide credentials to connect to Node Manager—the Node Manager user name and password are available in the domain configuration and are provided automatically.

 

v) Use the nmStart command to start a server.
nmStart('AdminServer')



Monitor the status of the Administration Server by entering the nmServerStatus command.
nmServerStatus('AdminServer')

vi) Connect WLST to a running WebLogic Administration Server instance using the connect command.
connect('weblogic','weblogic123')



vii) Stop the AdminServer by entering the nmKill command.
nmKill('AdminServer')



viii) Disconnect the node manager :     nmDisconnect()   and   Exit the WLST:     exit()

Start a Managed Server using Node Manager through the Administration Console

 

Before you start  make sure that your  environment meets the following Prerequisites:

 

i) Start Node Manager using command prompt

C:\Oracle\Middleware\wlserver_12.1\server\bin>startNodeManager.cmd localhost 5556



ii) Navigate to Domain Structure in Oracle Weblogic Server 12c  console  and click  Servers. And then click on control tab in the right pane i.e  Summary of Servers.



 

iii) Select managed server need to start and click on start tab.



iv) A request has been sent to the node manager to start the server. See Snap below



 

Monday, February 13, 2012

Weblogic Server Release Version

Now days there is lot of confusion regarding the WebLogic Server Release versions available.

I will post here the the version details for the WebLogic Server 11g .

The new Naming convention for the WebLogic Server 11g is : WebLogic Server 11g Release [1-2] Patch Set [1-3]

WebLogic Server 12c    ------------------------------12.1.1.0
WebLogic Server 11gR2  ----------------------------10.3.5.0
WebLogic Server 11gR1 Patch Set 3 ---------------10.3.4.0
WebLogic Server 11gR1 Patch Set2 ----------------10.3.3.0
WebLogic Server 11gR1 Patch Set1 ----------------10.3.2.0
WebLogic Server 11g   -------------------------------10.3.1.0



To get the WebLogic Server Version Installed , you can use anyone of the below steps :

1 : Check the registry.xml   present at location : %MIDDLEWARE_HOME%

2 : For Windows ,  command prompt execute setWLSEnv.cmd to set the environment and then execute the on the same command prompt java weblogic.version -verbose.
%Middleware_Home%/wl_server/server/bin/setWLSEnv.cmd
java weblogic.version -verbose

 

3 : For Linux :

source %Middleware_Home%/wl_server/server/bin/setWLSEnv.sh

java weblogic.version -verbose

 

 

 

Weblogic Server as Daemon Process

Script to start WebLogic domain server at  Machine Start in distributed environment .


I had a requirement to configure weblogic server to start at the server reboot on linux machine , i.e. to configure weblogic server as a daemon process. In my case the weblogic domain was distributed over two different physical machines .

Challenges :



  • In Weblogic Domain Admin Server should be started First.

  • After the Admin Server has come to RUNNING state, then we can start the Managed Server  of the local Machine and Remote Machine.


Steps :



  • Here I will mention the steps I followed to write the shell script to complete the above mentioned task. I will post the code snippet and the task they fulfill and in the end I will provide the complete


First task is to start the Weblogic Admin Server using the startWeblogic.sh file from $DOMAIN_HOME/bin dir.

My code snippet to check for the domain dir, then check for any nohup.out file existing or not and then finally start the server .
domain=/Middleware/user_projects/domains/BASE_DOMAIN
# Clear the nohup file that is existing
echo ${domain}/bin
cd ${domain}/bin
if [ `pwd` == ${domain}/bin ]
then
if [ -f nohup.out ]
then
rm -f nohup.out
fi
fi

# Start the Weblogic Admin Server.
echo " Starting Weblogic Admin Server "
nohup ./startWebLogic.sh &

 

Now we have to get the status of the Admin Server and wait till the Server comes in RUNNING State. For that I will use the weblogic.Admin GETSTAT command with below snippet .
CLASSPATH="/opt/Middleware1032/wlserver_10.3/server/lib/weblogic.jar${CLASSPATH}"
export CLASSPATH

status=`java weblogic.Admin -adminurl t3://host1.com:7231 -username weblogic -password weblogic123 GETSTATE AdminServer | awk '{print$6}'`

printf "Admin Server is Starting "

count=1
while [ "$status" != "RUNNING" ]
do
printf "."
status=`java weblogic.Admin -adminurl t3://host1.com:7231 -username weblogic -password weblogic123 GETSTATE AdminServer | awk '{print$6}'`
count=$count+1
if [ $count -gt 100 ];
then
echo " There is some problem with admin server "
exit 0
fi
done

After Admin Server has come to RUNNING state we will start the Managed Server of local machine.
if [ "$status" == "RUNNING" ];
then
echo "Admin Server is running "
echo "Starting Managed Server "
cd ${domain}/servers/MS1/bin
if [ `pwd` == ${domain}/servers/MS1/bin ]
then
if [ -f nohup.out ]
then
rm -f nohup.out
fi
fi

./startMS1.sh

echo " Managed Server is Starting "

echo " do : tail -f $pwd/nohup.out  to check the status of Server "

fi

Once Managed Server of local machine is started we will start the Managed Server of Remote Machine with below snippet.
# starting Managed Server on remote machine
#
MACHINE2=host2.com
if  ping -c 1 -w 10 $MACHINE2
then
echo "This machine is up and reachable"
echo " Checking MS2 server PID "

# Getting PID of MS2 on MACHINE2

PID=`ssh weblogic@host2.com \`\`ps -ef |grep -v grep |grep  weblogic.Name=MS2 | awk '{print\$2}'\`\``

echo $PID

if [ -z "$PID" ]
then
echo " MS2  Server not running "
echo " Starting MS2 Server "
ssh weblogic@host2.com '/flexcube/user_projects/domains/BASE_DOMAIN/servers/MS2/bin/startRelease1.sh ;/flexcube/user_projects/domains/BASE_DOMAIN/servers/MS2/bin/nohup.out'

else

#CLASSPATH="/oracle/app/Middleware1032/wlserver_10.3/server/lib/weblogic.jar${CLASSPATH}"
#export CLASSPATH

MS2_status=`java weblogic.Admin -adminurl t3://host2.com:7231 -username weblogic -password weblogic123 GETSTATE MS2 | awk '{print$6}'`

if [ "$MS2_status" = "RUNNING" ]
then
echo " MS2 is already Running "
echo " exiting from script"
exit 0
else
echo " MS2 PID=$PID exist and current state of server is $MS2_status"
fi

fi

fi

The complete script startBASE_DOMAIN.sh is available here :


One additional script has been used ,  startMS1.sh is available here :


${domain}/servers/MS1/bin .  The additional script can be found at below location.

Configuring the Above script in init.d directory.

In Linux : /etc/init.d

In AIX :   /etc/rc.d/init.d

Create a file weblogic.sh with the below contents :
#!/bin/sh
# Start the weblogic domains
su - weblogic -c "/opt /Middleware1032/wlserver_10.3/server/bin/startNodeManager.sh"
su - weblogic -c "/opt/user_projects/domains/scripts/startup/startBASE_DOMAIN.sh"

Now create soft link in /etc/rc.d/rc5.d with any name starting with S98 as given below:
Linux
ln –s  /etc/init.d/weblogic.sh S98weblogicstart

 AIX
ln –s /etc/rc.d/init.d/weblogic.sh S98weblogicstart

 
startBASE_DOMAIN.sh

#!/bin/sh
# To Start BASE_DOMAIN Domain while server start
# Written by Sandeep Singh
#
umask 037

domain=/flexcube/user_projects/domains/BASE_DOMAIN

# Clear the nohup file that is existing
echo ${domain}/bin
cd ${domain}/bin
if [ `pwd` == ${domain}/bin ]
then
if [ -f nohup.out ]
then
rm -f nohup.out
fi
fi

# Start the Weblogic Admin Server.
echo " Starting Weblogic Admin Server "
nohup ./startWebLogic.sh &

CLASSPATH="/opt/app/Middleware1032/wlserver_10.3/server/lib/weblogic.jar${CLASSPATH}"
export CLASSPATH

status=`java weblogic.Admin -adminurl t3://host1.com:7231 -username weblogic -password weblogic123 GETSTATE AdminServer | awk '{print$6}'`
printf "Admin Server is Starting "
count=1
while [ "$status" != "RUNNING" ]
do
printf "."
status=`java weblogic.Admin -adminurl t3://host1.com:7231 -username weblogic -password weblogic123 GETSTATE AdminServer | awk '{print$6}'`
count=$count+1
if [ $count -gt 40 ];
then
echo " There is some problem with admin server "
exit 0
fi
done
if [ "$status" == "RUNNING" ];
then
echo "Admin Server is running "
echo "Starting Managed Server "

cd ${domain}/servers/MS1/bin
if [ `pwd` == ${domain}/servers/MS1/bin ]
then
if [ -f nohup.out ]
then
rm -f nohup.out
fi
fi

./startMS1.sh
echo " Managed Server is Starting "
echo " do : tail -f $pwd/nohup.out  to check the status of Server "
fi

# Starting Managed Server on remote machine
#
MACHINE2=host2.com

if  ping -c 1 -w 10 $MACHINE2
then
echo "This machine is up and reachable"
echo " Checking MS2 server PID "

# Getting PID of MS2 on MACHINE2

PID=`ssh weblogic@host2.com \`\`ps -ef |grep -v grep |grep  weblogic.Name=MS2 | awk '{print\$2}'\`\``
echo $PID
if [ -z "$PID" ]
then
echo " MS2 Server not running "
echo " Starting MS2 Server "
ssh weblogic@host2.com '/flexcube/user_projects/domains/BASE_DOMAIN/servers/MS2/bin/startMS2.sh >/flexcube/user_projects/domains/BASE_DOMAIN/servers/MS2/bin/nohup.out &'
else
#CLASSPATH="/opt/app/Middleware1032/wlserver_10.3/server/lib/weblogic.jar${CLASSPATH}"
#export CLASSPATH
MS2_status=`java weblogic.Admin -adminurl t3://host1.com:7231 -username weblogic -password weblogic123 GETSTATE MS2 | awk '{print$6}'`

if [ "$MS2_status" = "RUNNING" ]
then
echo " MS2 is already Running "
echo " exiting from script"
exit 0
else
echo " MS2 PID=$PID exist and current state of server is $MS2_status"
fi
fi

fi

 

startMS1.sh



#!/bin/sh
#  Purpose : Starting the SOA SERVER1 of DOMAIN : BASE_DOMAIN
#
# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions to this configuration.

export HOME=/flexcube/user_projects/domains/BASE_DOMAIN
export SR=MS1

nohup ${HOME}/bin/startManagedWebLogic.sh ${SR} http://host1.com:7231 &

 

 

Monday, January 30, 2012

Issue with NodeManager and Weblogic Server

Error :


<Jan 24, 2012 11:33:43 AM AST> <Error> <NodeManager> <BEA-300033> <Could not execute command "getVersion" on the node manager. Reason: "Access to domain 'Base_Domain' for user 'EZRXyZIP1P' denied".>

Debug Steps:


The default log level for node manager is : Info .
We need to set the log level to Finest.

Below are the available log level for Node Manager :

SEVERE             ----- (highest value)
WARNING
INFO                    ---- Default value .
CONFIG
FINE
FINER
FINEST             ----- (lowest value)

Then We will restart the Node Manager and check for the log file error message again.

Solution :


1 : Log on to the Admin Console of the domain for which we are getting the error ( http://hostname:port/console )

2 : Go to Domain Name (Base_Domain) in my case >>>>> Then to security >>>>

3 : Click on the Advance Option.

4 : Change the username and password values that you want to use with the node manager.

in my case : username is : weblogic

password is : weblogic123

5 : save the changes.

Then each remote host:

  • Navigate to the folder %DOMAINHOME%\config\nodemanager

  • Edit the file: nm_password.properties

  • Content should be set to:

  • username=weblogic

  • password=weblogic123

  • Save

  • Restart the Weblogic Node Manager


6 : Then go to the Base_Domain/servers/mannaged_server/data/nodemanager/ dir.

7 : open the boot.properties file and enter the below values :

username=weblogic

password= weblogic123

the same values as set on Admin Console.

8: Restart the Admin Server.

9 : Now run the nmEnroll() wlst command for all the machines that has the Managed server.

wlst>connect('username','password','t3://admin_host:admin_port')

online>>nmEnroll('Domain_dir_path','NodeManager_Home_Path')

online>>exit()

Now you can check the node manager status from Admin Console .

left panel >> Machines >> Machine1 >> Monitoring >>

The Status should be reachable.

If the above steps did not resolve the issue the you can still post you issue in the comments below and I can try to help .

 

 

 Error :


Feb 2, 2012 2:55:02 AM weblogic.nodemanager.server.NMServer main SEVERE: Fatal error in node manager server java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.<init>(ServerSocket.java:185) at java.net.ServerSocket.<init>(ServerSocket.java:141) at weblogic.nodemanager.server.Listener.init(Listener.java:56) at weblogic.nodemanager.server.NMServer.start(NMServer.java:206) at weblogic.nodemanager.server.NMServer.main(NMServer.java:377) at weblogic.NodeManager.main(NodeManager.java:31)

Reason :


The error message : java.net.BindException: Address already in use at

Shows that the Port number used by the Node Manager process is being already  used by some other process .

Solution :


1 : First thing we need to check is whether Node Manager is already running on the machine :

For unix :

ps -ef | grep -v grep | grep -i weblogic.NodeManager

For windows :

netstat -a0 | findstr <NM_PORT_NO>

tasklist | findstr nodemanager

2 : If the process is not running already then, check which process is using the using the port assigned to node manager .

By default Weblogic Node Manager runs on port : 5556

So, to check which process is using this port use the below command .

For unix :

netstat -an | grep 5556

For Windows :

netstat -ao | findstr 5556

3 : If this port is already used by some other process then try to change the Node Manager Port number from file

%Middleware_Home%/wlserver_10.3/common/nodemanager/nodemanager.properties file :

ListenPort = XXXX

4 : Now try to start the Node manager from :

%Middleware_Home%/wlserver_10.3/server/bin/startNodemanager.sh or

%Middleware_Home%/wlserver_10.3/server/bin/startNodemanager.cmd

 

 Error :


NodeManager not Reachable: java.io.IOException: Invalid State File Format

Due to above error, Managed Servers cannot be started as the nodemanager is not reachable to Admin Console.

Stack trace from nodemanager.log file :



    

java.io.IOException: Invalid state file format. State file contents: at weblogic.nodemanager.common.StateInfo.load(StateInfo.java:135) at weblogic.nodemanager.server.ServerMonitor.loadStateInfo(ServerMonitor.java:475) at weblogic.nodemanager.server.ServerMonitor.isCleanupAfterCrashNeeded(ServerMonitor.java:139) at weblogic.nodemanager.server.ServerManager.recoverServer(ServerManager.java:255) at weblogic.nodemanager.server.DomainManager.initialize(DomainManager.java:103) at weblogic.nodemanager.server.DomainManager.(DomainManager.java:55) at weblogic.nodemanager.server.NMServer.getDomainManager(NMServer.java:257) at weblogic.nodemanager.server.Handler.handleDomain(Handler.java:224) at weblogic.nodemanager.server.Handler.handleCommand(Handler.java:108) at weblogic.nodemanager.server.Handler.run(Handler.java:70) at java.lang.Thread.run(Thread.java:619)


 

 

 Reason :


The state file of the managed server is in an invalid state.
Under each managed server directory, there is a NodeManager directory containing a state file <managed_server_name>.state. If this file is empty or corrupt, then the described errors occur.

For example, underE:\oracle\middleware\user_projects\domains\base_domain\servers\soa_server1\data\nodemanager, the soa_server1.state file is empty.
The major cause of the corruption of this file is unexpected shutdown of the Machine.

Solution :



  1. Stop the managed server if it is RUNNING.

  2. Stop the Admin Server.

  3. Stop Node Manager.

  4. Delete the following files:



E:\oracle\middleware\user_projects\domains\base_domain\servers\soa_server1\data\nodemanager\soa_server1.state
E:\oracle\middleware\user_projects\domains\base_domain\servers\soa_server1\data\nodemanager\soa_server1.lck
E:\oracle\middleware\user_projects\domains\base_domain\servers\soa_server1\data\nodemanager\soa_server1.pid


  1. Start Node Manager again.

  2. Start the Admin Server again.

  3. Start the managed server using the Admin Console.


 

Thursday, January 26, 2012

XDMCP connection failed.

Not able to connect to Xbrowser.


 

Enable XDMCP in Linux


Problem:


Need to enable the xdmcp protocol in the Linux server for getting remote using XBrowser.

Release:


RedHat Enterprise Linux 5
SUSE Linux 10

Error:


Error :


XDMCP connection failed.

cat: 0.log: No such file or directory
[root@KWWBDCSRVOAM01 gdm]# cat :0.log

X Window System Version 7.1.1
Release Date: 12 May 2006
X Protocol Version 11, Revision 0, Release 7.1.1
Build Operating System: Linux 2.6.18-128.1.10.el5 x86_64 Red Hat, Inc.
Current Operating System: Linux KWWBDCSRVOAM01 2.6.18-155.el5 #1 SMP Fri Jun 19 17:06:31 EDT 2009 x86_64
Build Date: 03 June 2009
Build ID: xorg-x11-server 1.1.1-48.64.el5
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Jan 24 14:06:34 2012
(==) Using config file: "/etc/X11/xorg.conf"
(WW) VMWARE(0): Failed to set up write-combining range (0xd4000000,0x400000)
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Multiple symbols for level 1/group 1 on key <I5F>
>                   Using XF86Sleep, ignoring XF86Standby
> Warning:          Symbol map for key <I5F> redefined
>                   Using last definition for conflicting fields
Errors from xkbcomp are not fatal to the X server

Solution:


1)      Install the gdm package

# yum install gdm

2)      Enable the xdmcp protocol by adding the below entries in the custom.conf file.

# vi /etc/gdm/custom.conf

[security]

AllowRemoteRoot=true

DisallowTCP=false

[xdmcp]

Enable=true

Note: Here “AllowRemoteRoot=true” used to allow root access.

3)      Restart the gdm service

# gdm-restart


4)      Check weather xdmcp port is opened or not, using netstat command

# netstat –an | grep 177


udp        0      0 0.0.0.0:177         0.0.0.0:*


5)  Firewall was blocking the Xmanager connection.
6) SE Linux was on. Turning off the SE Linux resolved the issue.

 

 

 

Tuesday, January 24, 2012

Deploy application on weblogic server

Deploy application on weblogic server 12c


 

Steps to Deploy Application using Administration Console


1. Start the Admin Server and Managed Server.

How to start Admin Server.  click here

How to start Managed Server. click here

2. Navigate to Administration console  http://localhost:7001/console and login.

3. Navigate to Domain Environment --> Deployments. Lock the console.



4. click the 'Install' button.



5. Browse to the location on your file system and select Application (war, jar, ear) File . Click the radio button next to the .war file and click 'Next' .



6. 'Install this deployment as an application'  is selected. Click 'Next'.



7. Select deployment targets



8.  Click 'Next' again to accept the defaults in this next pane.



9. Then click 'Finish'.



10. Click the 'Save' button and Activate Changes by clicking on button on left as shown in screen below. The application has been 'prepared', but not yet deployed at this point.



 

11. Again navigate to the Domain Structure --> 'Deployments' link. In the Summary of Deployments, check the box next to your application  and click the 'Start' button. Select 'Servicing all requests'. Click Yes to continue.



 

12. If the state of your deployment says 'Active', you have successfully deployed your Web application to Weblogic.


 Test application  deployment using Weblogic Administration Console


 

1. Navigate to  Domain Structure -->'Deployments'.

2. In the Summary of Deployments page, click on the name of the deployed Web application.



3. Select the 'Testing' tab .  Click the link to launch it .