Showing posts with label Weblogic. Show all posts
Showing posts with label Weblogic. Show all posts

Wednesday, 24 May 2017

Weblogic bsu - java.lang.OutOfMemoryError

sometime you can find the java heap space issue while applying weblogic patches using bsu. The error looks like below


Exception in thread "main" Exception in thread "Thread-0" java.lang.OutOfMemoryError: Java heap space
        at java.util.HashMap.createEntry(HashMap.java:897)
        at java.util.HashMap.addEntry(HashMap.java:884)
        at java.util.HashMap.put(HashMap.java:505)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.loadPropertyMap(XBeanDataHandler.java:778)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.<init>(XBeanDataHandler.java:99)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.createDataHandler(XBeanDataHandler.java:559)
        at com.bea.cie.common.dao.xbean.XBeanDataHandler.getComplexValue(XBeanDataHandler.java:455)
        at com.bea.plateng.patch.dao.cat.PatchCatalogHelper.getPatchDependencies(PatchCatalogHelper.java:442)
        at com.bea.plateng.patch.dao.cat.PatchCatalogHelper.getPatchDependencies(PatchCatalogHelper.java:464)
        at com.bea.plateng.patch.dao.cat.PatchCatalog.getPatchDependencies(PatchCatalog.java:56)
        at com.bea.plateng.patch.dao.cat.PatchCatalogHelper.getInvalidatedPatchMap(PatchCatalogHelper.java:1621)
        at com.bea.plateng.patch.PatchSystem.updatePatchCatalog(PatchSystem.java:436)
        at com.bea.plateng.patch.PatchSystem.refresh(PatchSystem.java:130)
        at com.bea.plateng.patch.PatchSystem.<init>(PatchSystem.java:114)
        at com.bea.plateng.patch.PatchSystem.<clinit>(PatchSystem.java:41)
        at com.bea.plateng.patch.Patch.main(Patch.java:279)
java.lang.NoClassDefFoundError: Could not initialize class com.bea.plateng.patch.PatchSystem
        at com.bea.plateng.patch.PatchClientHelper.getAllPatchDetails(PatchClientHelper.java:74)
        at com.bea.plateng.patch.PatchInstallationHelper.cleanupPatchSets(PatchInstallationHelper.java:130)
        at com.bea.plateng.patch.PatchTarget.<init>(PatchTarget.java:272)
        at com.bea.plateng.patch.PatchTargetFactory.create(PatchTargetFactory.java:30)
        at com.bea.plateng.patch.ProductAliasTarget.constructPatchTargetList(ProductAliasTarget.java:88)
        at com.bea.plateng.patch.ProductAliasTarget.<init>(ProductAliasTarget.java:46)
        at com.bea.plateng.patch.ProductAliasTargetHelper.getProdAliasTargetList(ProductAliasTargetHelper.java:55)
        at com.bea.plateng.patch.ProductAliasTargetHelper.getAllHomeToProdAliasesTargetMap(ProductAliasTargetHelper.java:32)
        at com.bea.plateng.patch.ProductAliasTargetHelper.checkProfilesInProductAliases(ProductAliasTargetHelper.java:133)
        at com.bea.plateng.patch.Patch$1.run(Patch.java:376)
        at java.lang.Thread.run(Thread.java:745)





Solution


1. open the bsu.sh (MIDDLEWARE_HOME/utils/bsu/bsu.sh) file edit mode
2. change the memory args value as below


From


MEM_ARGS="-Xms256m -Xmx512m"


To


MEM_ARGS="-Xms512m -Xmx1024m"


3. Save the file and run bsu again.

Tuesday, 16 May 2017

Apply weblogic patches in bulk using unix script.

If you apply more than one weblogic patches, then you have to either run the bsu.sh (located at $ORACLE_HOME/utils/bsu) in GUI mode or 1 by 1 in console mode. You can use the below script to install all the patches in one run.


follow the below steps:


1. Create a directory named /tmp/WLS_Patch
2. Put all the patches zip in the above directory
3. Create a sh file name run.sh and copy the below text into the file and save it.


echo "*********************"
echo Upgrade WLS
echo "*********************"
mkdir $ORACLE_HOME/utils/bsu/cache_dir
cd $ORACLE_HOME/utils/bsu/cache_dir
yes | find /tmp/WLS_Patch -name \*.zip -exec unzip  {} \;

cd ..
for i in 56MM CM69 FSG4 IMWL VRGR XA6W YVDZ ZARV
do

 ./bsu.sh -prod_dir=$WL_HOME -patchlist=$i -verbose -install | tee $i.out
 grep "Result: Success" $i.out
 if [ $? -ne 0 ]
 then
  echo "Unexpected issue applying patch $i. Check file $i.out"
  exit 1
 fi
done

echo "*********************"
echo WLS Upgraded
echo "*********************"



4. Replace the ORACLE_HOME and WL_HOME with the appropriate value as per your environment.
5. Add the patch alias name in the for loop list (highlighted in bold)
6. Save the file and run the script.
7. if any error occurred check the i.out file generated where the script is located.







Monday, 27 March 2017

Decrypt Password of Weblogic Domain Components


Password information’s are stored in the data file named SerializedSystemIni.dat, which is located at [DOMAIN_HOME]/security directory. This file cannot be opened in normal text mode. Encrypted passwords are used in various files like config.xml, boot.properties etc.
Using this method one can recover password for
  1. weblogic Admin Console
  2. KeyStore password
  3. Data source Password
Process
 
1. Go to the [DOMAIN_HOME]/security
2. Create a file named Decrypt.py
 
 
3. Copy the below lines to the file and save it
 
 
 
from weblogic.security.internal import *
from weblogic.security.internal.encryption import *
 
 #This will prompt you to make sure you have SerializedSystemIni.dat file under
#current directory from where you are running command
raw_input("Please make sure you have SerializedSystemIni.dat inside the current directory, if yes press ENTER to continue.")
 
 # Encryption service
encryptionService = SerializedSystemIni.getEncryptionService(".")
clearOrEncryptService = ClearOrEncryptedService(encryptionService)
 
 # Take encrypt password from user
pwd = raw_input("Please enter encrypted password (Eg. {3DES}Bxt5E3...): ")
 
 # Delete unnecessary escape characters
preppwd = pwd.replace("\\", "")
 
 # Decrypt password
                print "Your password is: " + clearOrEncryptService.decrypt(preppwd)
 
 
4. Go to [DOMAIN_HOME]/bin
5. Run  . ./setDomainEnv.sh
 
 
6. Go to the [DOMAIN_HOME]/security and run the below command
 
Java weblogic.WLST Decrypt.py
 
 
 
Note: Only the password from that domain can be retrieved. Password from other domain cannot be retrieved.
 
 
 
 
 
 

Followers

OIM API for adding process task and retry failed task

 In this blog you can find how to add new process task and retry any failed/rejected tasks using API. Adding new process task: /************...