You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by lam lam <sh...@yahoo.com> on 2003/04/22 04:53:23 UTC
Urgent: java.lang.StackOverflowError Exception
Hi all, I have written some code in Websphere 4.0 in AIX using:jaxp 1_2_01, dom (level 2), sax (2.0), xercesImp (2.0.1 ), xalan 2.2.0. I just try to use them to do some simple xml document building. Most of the time is run normally. However, some time it will throw the following exception: [03.04.20 14:32:12:812 CST] 6902870a SystemOut U java.lang.StackOverflowError
at java.lang.String.hashCode(String.java(Compiled Code))
at java.util.Hashtable.get(Hashtable.java(Compiled Code))
at java.util.Properties.getProperty(Properties.java(Compiled Code))
at java.util.Properties.getProperty(Properties.java(Compiled Code))
at java.util.Properties.getProperty(Properties.java(Compiled Code))
at java.util.Properties.getProperty(Properties.java(Compiled Code))
at java.util.Properties.getProperty(Properties.java(Compiled Code))
at java.util.Properties.getProperty(Properties.java(Compiled Code))
:
: : at java.util.Properties.getProperty(Properties.java(Compiled Code))
at java.util.Properties.getProperty(Properties.java(Compiled Code))
at java.util.Properties.getProperty(Properties.java(Compiled Code))
at java.lang.System.getProperty(System.java(Compiled Code))
at sun.security.action.GetPropertyAction.run(GetPropertyAction.java(Compiled Code))
at java.security.AccessController.doPrivileged(Native Method)
at java.io.BufferedWriter.<init>(BufferedWriter.java(Compiled Code))
at java.io.PrintWriter.<init>(PrintWriter.java(Compiled Code))
at java.io.PrintWriter.<init>(PrintWriter.java(Compiled Code))
at org.apache.xalan.processor.TransformerFactoryImpl.<init>(TransformerFactoryImpl.java(Compiled Code))
at org.apache.xalan.processor.TransformerFactoryImpl.<init>(TransformerFactoryImpl.java(Compiled Code))
at java.lang.Class.newInstance2(Native Method)
at java.lang.Class.newInstance1(Class.java(Compiled Code))
at javax.xml.transform.FactoryFinder.newInstance(Unknown Source)
at javax.xml.transform.FactoryFinder.find(Unknown Source)
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
at com.hsbc.lht.glv.ae.src.AEHealthTestServlet.generateXML(AEHealthTestServlet.java:1070)
at com.hsbc.lht.glv.ae.src.AEHealthTestServlet.createAmacisCampaignFile(AEHealthTestServlet.java:548)
at com.hsbc.lht.glv.ae.src.AEHealthTestServlet.deliverEmailHealthTestMessage(AEHealthTestServlet.java(Compiled Code))
at com.hsbc.lht.glv.ae.src.AEHealthTestServlet.deliveryHealthTest(AEHealthTestServlet.java(Compiled Code))
at com.hsbc.lht.glv.ae.src.AEHealthTestServlet.performTask(AEHealthTestServlet.java(Compiled Code))
at com.hsbc.lht.glv.ae.src.AEHealthTestServlet.mainFunction(AEHealthTestServlet.java(Compiled Code))
at com.hsbc.lht.glv.ae.src.AEHealthTestServlet.doGet(AEHealthTestServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.ServicingServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java(Compiled Code))
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
at com.ibm.ws.util.CachedThread.run(ThreadPool.java(Compiled Code))
It seems that the stack overflow problem is due to the getproperties method is automically called repeatedly until all the stack are used up. Any idea? Thanks first. Sherlane
---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
Re: Urgent: java.lang.StackOverflowError Exception
Posted by Simon Kitching <si...@ecnetwork.co.nz>.
Hi,
Well, it seems to me that there are 3 possibilities:
(a)
the stylesheet processing just requires more memory than you are
allowing the jvm to allocate
(b)
there is a memory leak somewhere in your app that reduces available
memory to a low level so that the stylesheet fails, or
(c)
there is a "race condition" in xerces or xalan which is intermittently
causing it to go into infinite recursion or similar.
I am sure you realise that these kind of problems are difficult to
solve. Unless you can provide a simple test-case that can be used to
duplicate the problem (and I realise this is difficult), people on this
list are really limited to just offering a few suggestions of things you
could try.
Here's a method that will log the amount of memory available; I suggest
that you invoke this method just before you load or execute your
stylesheet. That should prove whether (b) is the problem or not.
Note that this method uses "log4j" logging; you may have to adapt this
to whatever logging mechanism is available in your environment.
/**
* Method which outputs to the log information about the amount of
* memory being used by the JVM as a whole; this may be useful in
* detecting memory leaks.
*/
private void logMemoryUsage()
{
if (!log.isDebugEnabled())
{
return;
}
Runtime rt = Runtime.getRuntime();
long freeMemory = rt.freeMemory();
long totalMemory = rt.totalMemory();
long maxMemory = rt.maxMemory();
StringBuffer buf = new StringBuffer(200);
buf.append("memory usage:");
buf.append(" free=");
buf.append(freeMemory);
buf.append(" total=");
buf.append(totalMemory);
buf.append(" maxMemory=");
buf.append(maxMemory);
buf.append(" used=");
buf.append(totalMemory - freeMemory);
log.debug(buf.toString());
}
As for (c), it is possible that there is a bug in xerces or xalan that
causes all memory to be used. However I have a fairly heavily used app
that performs transforms in multiple threads, and runs for weeks without
restarts. I have not yet observed any "out of memory" problems, so there
is a fair chance that (a) or (b) is the cause of the issues you are
experiencing. However I am using Xalan 2.4.1 + Xerces 2.3.
Is it possible for you to upgrade to the latest xerces/xalan? I believe
Xalan 2.5 is now out...
Regards,
Simon
> [03.04.20 14:32:12:812 CST] 6902870a SystemOut U
> java.lang.StackOverflowError
> at java.lang.String.hashCode(String.java(Compiled Code))
> at java.util.Hashtable.get(Hashtable.java(Compiled Code))
> at java.util.Properties.getProperty(Properties.java(Compiled Code))
> at java.util.Properties.getProperty(Properties.java(Compiled Code))
> at java.util.Properties.getProperty(Properties.java(Compiled Code))
> at java.util.Properties.getProperty(Properties.java(Compiled Code))
> at java.util.Properties.getProperty(Properties.java(Compiled Code))
> at java.util.Properties.getProperty(Properties.java(Compiled Code))
> :
> :
> :
> at java.util.Properties.getProperty(Properties.java(Compiled Code))
> at java.util.Properties.getProperty(Properties.java(Compiled Code))
> at java.util.Properties.getProperty(Properties.java(Compiled Code))
> at java.lang.System.getProperty(System.java(Compiled Code))
> at
> sun.security.action.GetPropertyAction.run(GetPropertyAction.java(Compiled Code))
> at java.security.AccessController.doPrivileged(Native Method)
> at java.io.BufferedWriter.<init>(BufferedWriter.java(Compiled Code))
> at java.io.PrintWriter.<init>(PrintWriter.java(Compiled Code))
> at java.io.PrintWriter.<init>(PrintWriter.java(Compiled Code))
> at
> org.apache.xalan.processor.TransformerFactoryImpl.<init>(TransformerFactoryImpl.java(Compiled Code))
> at
> org.apache.xalan.processor.TransformerFactoryImpl.<init>(TransformerFactoryImpl.java(Compiled Code))
> at java.lang.Class.newInstance2(Native Method)
> at java.lang.Class.newInstance1(Class.java(Compiled Code))
> at javax.xml.transform.FactoryFinder.newInstance(Unknown Source)
> at javax.xml.transform.FactoryFinder.find(Unknown Source)
> at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
> at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.generateXML(AEHealthTestServlet.java:1070)
> at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.createAmacisCampaignFile(AEHealthTestServlet.java:548)
> at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.deliverEmailHealthTestMessage(AEHealthTestServlet.java(Compiled Code))
> at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.deliveryHealthTest(AEHealthTestServlet.java(Compiled Code))
> at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.performTask(AEHealthTestServlet.java(Compiled Code))
> at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.mainFunction(AEHealthTestServlet.java(Compiled Code))
> at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.doGet(AEHealthTestServlet.java(Compiled Code))
> at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled
> Code))
> at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled
> Code))
> at
> com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java(Compiled Code))
> at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled
> Code))
> at
> com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.ServicingServletState.service(StrictLifecycleServlet.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
> at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
> at
> com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
> at
> com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
> at
> com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
> at
> com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
> at
> com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
> at
> com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
> at
> com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
> at
> com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
> at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled
> Code))
> at com.ibm.ws.util.CachedThread.run(ThreadPool.java(Compiled Code))
>
>
> It seems that the stack overflow problem is due to the getproperties
> method is automically called repeatedly until all the stack are used
> up.
>
> Any idea?
>
> Thanks first.
>
> Sherlane
>
>
>
>
> ______________________________________________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
Re: Urgent: java.lang.StackOverflowError Exception
Posted by lam lam <sh...@yahoo.com>.
Joseph, thanks. In fact, we have increased the heap size to 512 already. Besides, the same styelsheet and xml file is using. However, it runs normally in the first few hours but suddently fails. Therefore, we don't know whether it is related to the stylesheet. Any comment? Thanks first.Sherlane
Joseph Kesselman <ke...@us.ibm.com> wrote:Your Java Virtual Machine has run out of stack space. See the JVM's
start-up options to learn how to increase that limit. Typically it's
something like -Xss or -Xoss.
Also, note that this generally indicates excessively deep recursion in
your stylesheet. You should probably recheck your logic to make sure this
isn't a bug in your stylesheet causing unterminated recursion.
______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"may'ron DaroQbe'chugh vaj bIrIQbej" ("Put down the squeezebox and nobody
gets hurt.")
---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
Re: Urgent: java.lang.StackOverflowError Exception
Posted by Joseph Kesselman <ke...@us.ibm.com>.
Your Java Virtual Machine has run out of stack space. See the JVM's
start-up options to learn how to increase that limit. Typically it's
something like -Xss or -Xoss.
Also, note that this generally indicates excessively deep recursion in
your stylesheet. You should probably recheck your logic to make sure this
isn't a bug in your stylesheet causing unterminated recursion.
______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"may'ron DaroQbe'chugh vaj bIrIQbej" ("Put down the squeezebox and nobody
gets hurt.")