Monday, October 31, 2011

Apply weblogic Patch to unix

January 2011 weblogic patches are available at
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=REFERENCE&id=1263333.1

( Note: If you're wondering about  what "No Error Correction (NEC)" is: it means if you find an issue on WLS-10.3.1,there will be no fix provided, the fix will be provided only for WLS-10.3.2 onwards)

Copy all patches along with the patch-catalog.xml file to the Unix box at
*/bea1033/utils/bsu/cache_dir

now if the patch comes with an xml which is like  patch-catalog_xxxx.xml (ex : patch-catalog_4444.xml) then you would have to rename this  patch-catalog_xxxx.xml to  patch-catalog.xml in cache_dir
make sure that if a file patch-catalog.xml is already present in cache_dir before you dropping the patch there
you would have to back it up first and then rename patch-catalog-xxxx.xml to patch-catalog.xml

On the Unix machine go to the bsu folder.
( Ex : */bea1033/utils/bsu/cache_dir ) and run the following command :

Syntax :
$ ./bsu.sh -prod_dir= -patchlist= -verbose -install -log=/tmp/error.log

ex:
$ ./bsu.sh -prod_dir=*/bea1033/wlserver_10.3 -patchlist=B1WK -verbose -install -log=/tmp/error.log

If you want to install multiple patches at the time use the below command :

$ ./bsu.sh -prod_dir=*/bea1033/wlserver_10.3 -patchlist=B1WK,P2MT -verbose -install -log=/tmp/error.log


You can later use the below command to check the output

*\bea1033\utils\bsu>bsu -report


restart domain

To remove a patch

On the Solaris machine go to the bsu folder. ( Ex : */bea1033/utils/bsu ) and run the following command :

bsu -remove -patchlist=4MHU -prod_dir=D:\bea\weblogic92 –verbose

If you get the error:
"Patch id **** is not associated with the given product dir."
Then the patch does not belong to the WLS version you are in, most likely bug for the patch has already been fixed in the current version.

If you get the below error:
com.bea.plateng.common.util.logging.LogWriter -  java.io.IOException: Unable to backup file D:\work\wls\patch_wls1033\patch_jars\BUG*.jar to D:\work\wls\patch_wls1033\patch_jars\BUG*.jar53888.bak
com.bea.plateng.patch.CommandLinePatchInstaller - An unexpected error was encountered removing patch DFYK.  That resource may be busy.
The patch was not removed, and has been restored to its original state.  For further information, enable logging and run patch removal again.
com.bea.plateng.patch.PatchRemovalException: java.io.IOException: Unable to backup file D:\work\wls\patch_wls1033\patch_jars\BUG*.jar to D:\work\wls\patch_wls1033\patch_jars\BUG*.jar53888.bak


The OS has the JAR locked,  So please kill all OS related weblogic processes like nodemanager and beasvc service.

 If you get the below error:

    2014-06-25 02:48:59,328 DEBUG [Main Thread] com.bea.plateng.common.util.logging.LogWriter - Restoring /data/XXX//wlserver_10.3/server/lib/schema/weblogic-domain-binding.jar from /XXXX/patch_wls1036/backup/backup.jar
    2014-06-25 02:48:59,332 ERROR [Main Thread] com.bea.plateng.patch.FilePatchRemover - Error restoring files from backup archive.
    2014-06-25 02:48:59,333 ERROR [Main Thread] com.bea.plateng.patch.PatchRemover - Error encountered removing patch.
    2014-06-25 02:48:59,335 DEBUG [Main Thread] com.bea.plateng.patch.CommandLineProgress - Command line progress stopped
    2014-06-25 02:48:59,335 DEBUG [Main Thread] com.bea.plateng.common.util.logging.LogWriter - Result: Failure
    2014-06-25 02:48:59,335 DEBUG [Main Thread] com.bea.plateng.common.util.logging.LogWriter - Failure condition follows:

The patch was not removed, and has been restored to its original state.  For further information, enable logging and run patch removal again.
com.bea.plateng.patch.PatchRemovalException: java.io.FileNotFoundException: /XXX/wlserver_10.3/server/lib/schema/weblogic-domain-binding.jar (No such file or directory)

 while patching being rolled back, its looking for jar file in wrong location.

bash-3.2$ grep -i /XXXX/wlserver_10.3/server/lib/schema/weblogic-domain-binding.jar patch-backup.xml
   <target>/XXXX/wlserver_10.3/server/lib/schema/weblogic-domain-binding.jar</target>
   <target>/XXXX/wlserver_10.3/server/lib/schema/weblogic-domain-binding.jar</target>
 
 
 
If you get the below error:
 
Exception in thread "Thread-0" java.lang.NullPointerException
        at com.bea.plateng.patch.PatchTargetHelper.loadPatchProfiles(PatchTargetHelper.java:447)
        at com.bea.plateng.patch.PatchTarget.<init>(PatchTarget.java:268)
        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:748)
java.lang.NullPointerException
 
 Solution:
 
Ensure  all the files and directories under weblogic home are under same owner and group.
 

Monday, October 24, 2011

Creating custom jvm scripts for starting through node manager

The primary aim of nodemanager is to restart managed servers when the go down and also you can start or stop managed servers from the console.
Now StartScriptEnabled=true will use the managed server script. If your start script is named startWebLogic.sh or startWebLogic.cmd, Node Manager uses one of those scripts as the default. So now when you start a managed server from console, it will use its own startWebLogic.sh or startWebLogic.cmd to come up via nodemanager since StartScriptEnabled=true.
If you would like to Set different environment properties to each jvm then doing it in the console is one of the best methods, however you can also modify the startweblogic.sh script to the example as below

if ["${SERVER_NAME}"==ms1]
then
JAVA_OPTIONS="-Xverboselog:/osb/oracle/bea/user_projects/domains/osb_domain/servers/OSBJMS2/logs/ms1gc1.log -Xverbose:memory ${JAVA_OPTIONS}"
echo %JAVA_OPTIONS%
exit
fi

if ["${SERVER_NAME}"==ms2]
then
JAVA_OPTIONS="-Xverboselog:/osb/oracle/bea/user_projects/domains/osb_domain/servers/OSBJMS2/logs/ms2gc2.log -Xverbose:memory ${JAVA_OPTIONS}"
echo %JAVA_OPTIONS%
exit
fi

Wednesday, October 5, 2011

high availability of admin server

<Warning> <Management> <BEA-141191> <The prepare phase of the configuration update failed with an exception:
weblogic.management.DeploymentException: Exception occured while downloading files
       at weblogic.deploy.internal.targetserver.datamanagement.ConfigDataUpdate.doDownload(ConfigDataUpdate.java:83)
       at weblogic.deploy.internal.targetserver.datamanagement.DataUpdate.download(DataUpdate.java:56)
       at weblogic.deploy.internal.targetserver.datamanagement.Data.prepareDataUpdate(Data.java:98)
       at weblogic.management.provider.internal.RuntimeAccessDeploymentReceiverService.downloadFiles(RuntimeAccessDeploymentReceiverService.java:898)
       at weblogic.management.provider.internal.RuntimeAccessDeploymentReceiverService.updateDeploymentContext(RuntimeAccessDeploymentReceiverService.java:564)
       Truncated. see log file for complete stacktrace
java.io.IOException: Posted content doesn't set it's Content-Length
       at weblogic.deploy.service.datatransferhandlers.MultipartParser.parseResponse(MultipartParser.java:97)
       at weblogic.deploy.service.datatransferhandlers.MultipartParser.<init>(MultipartParser.java:82)
       at weblogic.deploy.service.datatransferhandlers.MultipartParser.<init>(MultipartParser.java:45)
       at weblogic.deploy.service.datatransferhandlers.HttpDataTransferHandler.getDataAsStream(HttpDataTransferHandler.java:88)
       at weblogic.deploy.service.datatransferhandlers.DataHandlerManager$RemoteDataTransferHandler.getDataAsStream(DataHandlerManager.java:153)
       Truncated. see log file for complete stacktrace


Managed server going into Admin mode after Adminserver fails over.

As per KM 1294379.1, Released that there were 0sized files under the config directory of domain which were not being synchronized, removing those files fixed the problem.