Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

'StackOverFlow' Issues in BEA WebLogic Server

Determine the cause before you make the phone call

A "StackOverFlow" message is usually indicative of an error in the application code of the user, an error in the Java Virtual Machine, or in BEA WebLogic Server itself.

This message is usually seen right before a Java Virtual Machine core dump or the WebLogic Server process just "goes away." It is because of either an unintentional recursive call in user/application code or a scenario where arrays of arrays of Objects can cause the stack to overflow (there are bug reports on http://java.sun.com about these types of issues). This is unfortunate, as it may require programmers to think about the implementation details of the Java Virtual Machine on which they are running. In order to investigate a "StackOverFlow" Error more thoroughly to determine the exact cause, first go through the items discussed here.

Look at any recent application code changes and see if anything could possibly be called recursively. If there is no stack trace produced for the "StackOverflow", try to add debug statements where there is suspect, code. If some application code is suspect, then you can make modifications and add the following:

catch ( StackOverflowError e ) {
System.err.println("Exception: " + e );
// Here is the important thing to do
// when catching StackOverflowError's:
// do some cleanup, destroy the thread or unravel if possible.

The next thing you can look at involves JSPs (if you're using them). A few issues involving recursive problems have been resolved by using the following information for JSPs:

  • Check within your jsp_error page to see if you have the tag <%@ page errorPage="jsp_error"%> as this would cause an infinite recursion. Please remove this and simply print the stack trace of any exceptions that could occur. This way you can find the problem in the error page. Once this is resolved you can look at the original error that gets sent to this page.
  • Feedback provided to BEA Customer Support about the JSP tag was that another problem was due to bad jsp/servlet login/auth/error reporting code. Fixing this code fixed the recursion and therefore the crash.
  • If you are using BEA WebLogic JSP Form Validation Tags, make sure that for the <wl:form> you don't set the action attribute to the same page containing the <wl:form> tag because this will create an infinite loop resulting in a "StackOverFlow" exception. For an example, see http://e-docs.bea.com/wls/docs61/jsp/validation_tags.html#67370.
A strange "StackOverFlow" was caused by the following code snippet within some application code. Please check to see if you are doing this in your code since a known Sun Issue (#4906193) addresses it. Instead of doing this in the application code:

Properties p = new Properties(System.getProperties());

do the following:

Properties p = new Properties();
p = System.getProperties();

in order to avoid the recursive call stack trace that was observed.

A suggested "possible" workaround for some "StackOverFlow" messages is to increase the size of the thread stacks with the -Xss argument to the JVM. However, if a recursive call truly has caused this, then this option will not really help at all and will only delay the inevitable. Some background on this argument to the JVM: each Java thread has two stacks, one for Java code and one for C code. This option sets the maximum stack size that can be used by C code in a thread to the value specified. For a complete definition of the "-Xss" flag see "Non-Standard Options" at http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/java.html.

If the first couple of suggestions don't help pinpoint the problem, then try periodically collecting thread dumps of the JVM as it is running when you think the problem may occur (if it occurs at a specific time or a specific sequence of events causes the problem), usually about 5-10 seconds apart. Using this information, you may be able to find the recursive code and correct it or this may enable BEA Customer Support to have a better idea of what could be causing the problem. To collect thread dumps you need to do the following on the Java Process ID (PID):

  • On all "Unix-like" platforms you can do "kill -3" before expecting the crash. "kill -3 <jvm-pid>" dumps java threads.
  • On all "Windows" platforms you can do a "kill -3" on the JVM PID. You can also do a "<CTRL> <BREAK>" in the window where the JVM is running.
The same applies to the BEA JRockit JVM as well as all platforms. You need to make sure that you do this on the root java process. To get a tree structure of the processes on Linux, use the "--forest" option. For example, to find the processes started by user "wlsuser", execute this: "ps -lU wlsuser -forest". For a specific example of getting thread dumps with the BEA JRockit JVM on Linux, see http://e-docs.bea.com/wls/docs70/cluster/trouble.html#602852.

If you cannot "time" the thread dumps to get a thread dump right before the "StackOverFlow" happens, you can set the following flags to allow a thread dump to be taken of the server right before a core happens to get the state of the threads at that moment. The option is "-XX:+ShowMessageBoxOnError" option on the Sun JVM (which is not officially documented on Sun's Web site). When the JVM crashes, the program will prompt: "Do you want to debug the problem?" You can then take a thread dump of the JVM. This option will be available on the 8.1 SP2 version of the BEA JRockit JVM when it is released. However, in that version the corresponding option will be "-Djrockit.waitonerror".

If a binary core file is produced from a "StackOverFlow", then you can run a debugger on the resulting core file to get a stack trace. This may help in pointing out the offending code to you. If you are unsure, then contact BEA Customer Support with this information so they can investigate the stack trace more thoroughly. If you are on a Windows platform, then a "Dr. Watson" file may be produced so please send this file to BEA Customer Support when opening a case. Otherwise, check the following "Unix" operating system values to make sure that they have already been properly set in order to generate a core file:

  1. Check the "ulimit -c" (configured size of the core file) at a system and user level to make sure that it is set and that the value is not set too low to produce a meaningful core file.
  2. Check the available disk space for the user. For example: Is there a disk quota?
  3. Check the following parameter, which on Solaris is usually in /etc/system file and can be used to disable core files:

    set sys:coredumpsize=0

  4. On Linux, the coredump is turned off by default on all systems. In RedHat Advanced Server 2.1 it should be under "/etc/security". There should be a self-explanatory file called limits.conf; within that file look for the word "core". If it is set to "0", then coredump files are disabled.
  5. On HP-UX check the setting called "kernel parm maxdsiz" (max_per_proc_data_size, which increases the User Process Data Segment Size) from the old value of, say, 64m, to something higher like 134M.
Please get a stack trace (or back trace) from your debugger. For example, here are the commands needed when using "dbx" or "gdb".


  • $ java -version: Need to use right version of JDK
  • $ ls /opt/bin/dbx: Need to know dbx location or "which dbx"
  • $ export DEBUG_PROG=/opt/bin/dbx: Wherever "dbx" is located
  • $ <path to java command>/java corefile
Now you are in the debugger. Execute the following commands:
  • (dbx) where: Shows a summary of the stack)
  • (dbx) threads: Shows the state of the existing threads
  • (dbx) quit
  • $ java -version: Need to use right version of JDK
  • $ ls /usr/local/bin/gdb: Need to know gdb location or "which gdb"
  • $ export DEBUG_PROG=/usr/local/bin/gdb: Wherever "gdb" is located
  • $ <path to java command>/java corefile
Now you're in the debugger. Execute the following commands:
  • (gdb) where: Shows a summary of the stack
  • (gdb) thr: Switch among threads or show the current thread
  • (gdb) info thr: Inquire about existing threads
  • (gdb) thread apply 1 bt: Apply a command to a list of threads, specifically the back trace to thread #1
  • (gdb) quit
Further Information
For additional information you can also go to http://support.bea.com and find some published solutions on "StackOverflows". In the "Question" field type "S-19795" or "S-19361" to display the information from those solutions.

If none of these hints direct you towards a solution or an identifier in your application, then contact BEA Customer Support for further diagnosis. You can open a case with a valid support contract by logging in at http://support.bea.com/login.jsp

More Stories By Steve Pozarycki

Steven Pozarycki is a backline developer relations engineer with BEA Systems, Customer Support Group. He specializes in troubleshooting and solving complex customer issues with their mission-critical applications on BEA products. Steve holds a bachelor's degree in computer science.

Reproduced with permission from BEA Systems.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

@ThingsExpo Stories
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things’). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing? IoT is not about the devices, it’s about the data consumed and generated. The devices are tools, mechanisms, conduits. In his session at Internet of Things at Cloud Expo | DXWor...
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone inn...