Sunday, March 22, 2015

BEA-160197: Unable to load descriptor weblogic.utils.classloaders.ChangeAwareClassLoader


Error while starting the weblogic server using WLST scripts -

<Error> <J2EE> <BEA-160197> <Unable to load descriptor weblogic.utils.classloaders.ChangeAwareClassLoader@18d0f31d finder: weblogic.utils.classloaders.CodeGenClassFinder@18d0f348 annotation:


Resolution -

The session had JAVA_HOME variable set to a different JAVA installation path (compared to the Java path in the setDomainEnv.sh) and the Java versions were not matching. 
Java path used in the session can be verified by running the 'which java' command in the linux server.



Thursday, March 19, 2015

Weblogic: Memory settings Xmx and Xms


Xmx - denotes the maximum memory allocation pool for JVM
Xms - denotes the minimum memory allocation pool for JVM


example:

java -Xmx1024m -Xms512m

This specifies that the JVM will be started with Xms (512 MB) and will be able to use a maximum of 1024MB

When a weblogic server is started, the memory settings are taken effect from setDomainsEnv.sh file.


Memory settings can be specified per Weblogic server in setDomainsEnv.sh -

case "$SERVER_NAME" in
        AdminServer)
                USER_MEM_ARGS="${MEASUREMENT_ARGS} -Xms2048m -Xmx3072m -XX:MaxPermSize=1024m"
                export USER_MEM_ARGS
  
        managed_server*)
                USER_MEM_ARGS="${MEASUREMENT_ARGS} -Xms2048m -Xmx4608m"
                export USER_MEM_ARGS

Saturday, March 14, 2015

Linux Tips: Extract text between 2 line numbers


Command to extract text between 2 line numbers from a file

sed -n 12196, 12765p weblog.txt > extract.txt

12916 is the first line number from which the text has to be extracted
12765 is the last line that needs to be extracted
p - append p with the last line number

Friday, March 13, 2015

Weblogic: How to take a Heap dump for weblogic server in jrockit


Steps to take a Heap Dump for a weblogic server running on jrockit-

1. Run ps -ef | grep oracle or ps -ef | grep managedserver to find the process id (pid)

2. Check the java path in the process

3. Run the below command for the heap dump

/usr/local/java/bin/jrcmd 19456 print_threads >  /tmp/heap_dump.txt

19456 is the process id or pid

jrcmd is a command-line tool included with the JRockit JDK that you can use to send diagnostic commands to a running JVM process

Oracle Documentation reference -
https://docs.oracle.com/cd/E15289_01/doc.40/e15061/ctrlbreakhndlr.htm

jrcmd <jrockit pid> [<command> [<arguments>]] [-l] [-f file] [-p] -h]
  • <jrockit pid> is either the process ID or the name of the Main class that runs the application.
  • [<command> [<arguments>]] is any diagnostic command and its associated arguments; for example, versionprint_propertiescommand_line.
  • -l displays the counters exposed by this process. These counters are for internal use by Oracle and are not officially supported or documented.
  • -f reads and executes commands from the file.
  • -p lists JRockit JVM processes on the local machine.
  • -h displays help.