Thursday, November 12, 2009

WebLogic OutOfMemory: PermGen Error

This error can appear when starting WebLogic Server and is easy to fix although it took a while for me to work that fix out! It's all to do with which Java Virtual Machine (JVM) you are using.

By default WebLogic Server uses Oracle JRockit as its JVM - it gets installed as part of the WebLogic installation. This JVM is fast but if you get errors it gives you a generic error message of Erroneous Handlers Error (see previous blog entry on this) - in order to find the real error you have to switch your JVM to Sun.

JRockit does not use something called "generational garbage collection" so it doesn't use something called "permanent generation space" - therefore you never get PermGen errors.

(Permanent Generation Space (PermGen) is info that JVM keeps about the classes that are being run).

Sun's JVM uses PermGen so you will get the PermGen error if so many classes have been loaded that it has run out of memory to store them.

The fix is to set the amount of memory for PermGen using the -XX:MaxPermSize java option.

In setDomainEnv.sh (domain/bin dir) search for USER_MEM_ARGS.

If this is not already set then set it as follows:

USER_MEM_ARGS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"
export USER_MEM_ARGS

(The key properties being XX:PermSize and XX:MaxPermSize).

Save and restart WebLogic and the error should have gone.

Wednesday, November 11, 2009

Init Blocks

What are INIT BLOCKs?

They are pieces of code that you write in the Admin tool to initialize repository and session variables.

For example you might have a variable that gives you the current date or another that says how many days there are left until the end of the quarter. You write init blocks to initialize these variables with the correct values.

Initializing Repository Variables

Init blocks that initialize repository variables are only run at a scheduled time. When you create one of these you set the time and scheduler to run. If the BI Server is restarted they also get run.

Initializing Session Variables

Init blocks that initialize session variables are not run at a scheduled time. Instead, every time a user begins a new session these variables are initialized and they remain unchanged for the length of the session.

Thursday, August 13, 2009

Rename Column In Presentation Layer

If you rename a column in the Presentation layer then all of your reports that use the column are now going to be referencing the wrong column and thus will error.

To fix this:

Search and replace using the catalog manager
Search for Presentation Table.Market and
Replace with Presentation Table.Markets.

Thursday, March 12, 2009

Weblogic Erroneous Handlers Error

When running applications in a Weblogic server you might get this error reported on one of your pages or in one of your log files:

     java.lang.InternalError: erroneous handlers

There is a "real" error behind this error but the BEA JRockit version of java is not showing it. To find the real error you need to switch WLS to use Sun's Java.

(1) Open up setDomainEnv.sh (in the bin dir or your domain)

(2) Set SUN_JAVA_HOME to the root dir of your Java  (find this out by typing which java on cmd line)
Eg: SUN_JAVA_HOME="/scratch/me/apps/oracle/jdk"

(3) Create new env var for JAVA_VENDOR and set it to Sun
Eg:
JAVA_VENDOR="Sun"
export JAVA_VENDOR

(4) Bounce WLS

Now you'll get the real error.

Wednesday, March 11, 2009

Discoverer IE7 Drill Down Issue

When IE7 was released it broke the drill down functionality in Discoverer (see bug 5673463).

To fix this you have to do 2 things:

(1) Apply the 10.1.2.2 patch - you can get this on Metalink (4960210). It is a big patch (over 1 and half GB in size) and will upgrade your app server. The patch is easy to install but I'd advise backing up work beforehand just in case.

(2) Then apply the IE7 patch from Metalink (5758865).

Now drill down will work again.