Pages

Friday, March 6, 2015

Useful Weblogic Administration related Scripts


Below are the few tiny but useful shell scripts. I will be keep adding new scripts in this particular blog page for various task related to Weblogic Administration.

Configure JAVA_OPTONS for Particular WLS Servers Instance

 

Step1: Go to $DOMAIN_HOME\bin\setDomainEnv.sh



Modify the below shell script snipnet with your environment WLS Server Instance name and paste it inside setDomainEnv.sh file

The location could be anywhere inside setDomainEnv.sh, however I personally prefer after below lines.

 















# Customer Specific script -- BEGIN

if [ "`expr \"$SERVER_NAME\" : \".*AdminServer.*\"`" != "0" ];then
echo "Setting up Custom JAVA_OPTION Parameters for ADMIN SERVER"
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.MaxMessageSize=50000000 -Xss:512k"
else
echo "Admin Server matching criteria not met, no Custom JAVA_OPTION will be set"
fi

or

In this script, if you notice server name I have mentioned "WLS_WSM", many time its happens like we have multiple SOA, BAM and OWSM server in domain, however if we want to specify JVM option for all WSM server together in one line then we can remove numeric digit from server name. e.g. let says domain contains two OWSM server called WLS_WSM1 and WLS_WLS2 and using below script both OWSM WLS server java option will be set.

if [ "`expr \"$SERVER_NAME\" : \".*WLS_WSM.*\"`" != "0" ];then
echo "Setting up Custom JAVA_OPTION Parameters for OWSM SERVERS"
JAVA_OPTIONS="${JAVA_OPTIONS} -Xms2048m -Xmx2048m -Djava.net.preferIPv4Stack=true -Doracle.net.SDP=true"
else
echo "OWSM SERVERS Server matching criteria not met, no Custom JAVA_OPTION will be set"
fi


Note: In above script change the name of "AdminServer" to your environment specific WLS Instance name. 



Save file and restart Admin Server. 


Step2: Verify the AdminServer.out for new configuration
 

 




=============================================================================

Starting AdminServer via Custom scripts


Whenever we do start of AdminServer we need to do it manually, also at the same time we need to specify .out file location again and again. We can automate this job using below script. 

Below script will start the Admin Server in background using “nohup” command, also it will specify the AdminServer.out location and will show you the PID after restart of Admin Server.

Step1:  go to $Domain_Home\bin

Create a new script file called “vi startAdminServer.sh

Paste the below script lines –

#!/bin/bash
#This script will start the Admin Server and will generate the standard out log at given location
logFileName=AdminServer.out;
logFilePath=/u01/app/oracle/admin/dev_pre_domain/aserver/dev_pre_domain/bin;
nohup ./startWebLogic.sh > $logFilePath/$logFileName 2>&1 &
sleep 5
echo `ps -ef | grep Dweblogic.Name=AdminServer`
echo ""
echo "Standard Out log file path is : $logFilePath/$logFileName";
exit
#EOF


Save the file file using “!wq

Note:  AdminServer.out location can be changed as per your requirement.

Step2: Change the access of this file using command “chmod 755 ./startAdminServer.sh

Step3: run this script “./startAdminServer.sh






Wednesday, February 18, 2015

weblogic.socket.MaxMessageSizeExceededException



Problem Statement:

While testing some of OSB business service we were getting this below error. 
This error is generic can come from any SOA component, not just OSB. 

 
weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '10000080' bytes exceeds the configured maximum of: '10000000' bytes for protocol: 't3


Cause: 

The payload size which OSB or SOA services are dealing with is larger then allowed max message size.

Solution:

1. Go to servers--->protocols--->general--->max message size--->changed the value (do this for both the Admin server and the SOA server)

 
Note: This change must need to implement in AdminServer and Mservers both, We had struggle a bit to fix this problem coz we were making changes in only OSB and SOA servers and were not making changes in Admin server and error was still occurring, but later when we made changes in AdminServer then only problem got sorted out.

AServer Snap-

MServer Snap -



2. Go to servers--->configuration--->server start--->arguments--->
-Dweblogic.MaxMessageSize=50000000 some value given earlier

Aserver Snap - 


 MServer Snap -

Restart the Admin and WLS Managed servers after making changes.

Make sure after restarting new weblogic configuration value must be appearing in .out file. 



 

 

Tuesday, October 28, 2014

JPS-01050: Opening of wallet based credential store failed. Reason java.io.IOException: PKI-02002: Unable to open the wallet. Check password

Hi, All today I hit with very wired problem and later got solution using some Oracle post, so though to share in my blog as well.

I just did fresh domain creation and while starting the domain using ./startWeblogic.sh script I was getting below error.

Initially I though, while creating domain I gave some wrong password for "weblogic" user, so deleted the domain and re-created again, but again while starting I got same error. Second time I again thought I might gave wrong password while creating domain, I deleted it again and created Domain third time.

However, this time also same error poped-up, then I started googling on this issue and found solution. 

Error Message:

<Oct 28, 2014 12:44:48 AM EDT> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: weblogic.security.SecurityInitializationException: The loading of OPSS java security policy provider failed due to exception, see the exception stack trace or the server log file for root cause. If still see no obvious cause, enable the debug flag -Djava.security.debug=jpspolicy to get more information. Error message: JPS-01050: Opening of wallet based credential store failed. Reason java.io.IOException: PKI-02002: Unable to open the wallet. Check password.
weblogic.security.SecurityInitializationException: The loading of OPSS java security policy provider failed due to exception, see the exception stack trace or the server log file for root cause. If still see no obvious cause, enable the debug flag -Djava.security.debug=jpspolicy to get more information. Error message: JPS-01050: Opening of wallet based credential store failed. Reason java.io.IOException: PKI-02002: Unable to open the wallet. Check password.
        at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadOPSSPolicy(CommonSecurityServiceManagerDelegateImpl.java:1402)
        at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1022)
        at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
        at weblogic.security.SecurityService.start(SecurityService.java:141)
        at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
        Truncated. see log file for complete stacktrace

Solution:

open putty session from root user and run below command -

root> chmod -R 777 /tmp

Note: I really don't know relation between the weblogic error message and the solution which works for this, however above solution work in my case, and I was able to start the Admin server.
Refer below thread as well -

https://community.oracle.com/message/11006215