Today we were creating WebLogic cluster on two machines for ADF/WebCenter 11g application installation. Hardware is 64 bit, each with 8 processor cores and 32 GB RAM - sounds pretty powerful. There was no problems with clustering and deployment, however we faced problem while testing WebCenter Spaces - welcome page just wasn't compiled and was throwing following error, while trying to access it:
Servlet failed with Exception
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
At first, we thought may be WebCenter Suite 11g runtime is not working on 64 bit platforms. So, we uninstalled all servers and did fresh install using only ADF 11g runtime libraries. We deployed simple ADF 11g application and got same exception. It became obvious, that its not WebCenter Suite 11g problem.
After some brainstorming, and couple of tea/coffee breaks, we understood that 64 bit JDK from Oracle (Sun) we were using is newer comparing to that 32 bit JDK packaged together with Oracle WebLogic Server installation. We were using latest jdk160_18, while Oracle WebLogic is packaged with 32 bit jdk160_14 version. So, we downloaded 64 bit jdk160_14 and reinstalled cluster again. This time ADF/WebCenter 11g deployment was working without any problems on 64 bit cluster environment.
Lesson learned: When installing Oracle WebLogic on 64 bit platform, you need to download Oracle WebLogic installation that comes without Java. Make sure you will use same 64 bit Java version, as it is used in packaged Oracle WebLogic installs with 32 bit Java.