I am getting the following java stackoverflow error on a xml transformation in weblogic server 10g hosted in sun solaris. This happens only for a particular xml tranformation and rest all xml transformation works fine. The xsl file used is also not very big.
I am using the Transformation api available in rt.jar but getting this error from xalan apache package(com.sun.org.apache.xalan.internal.xsltc.dom.SimpleResultTreeImpl
) which I havent packaged in my application.
Another interesting thing is that I didnt get this exception when I run the application in weblogic 10g server hosted in windows machine, I get this only in sun solaris.
Can anyone let me know why I get this error.
Can you let me know which jar file is causing the exception ? Will weblogic have a xalan.jar ? If so I can try to upgrade the jar file and see if its working ?
Caused by: java.lang.StackOverflowError
at com.sun.org.apache.xalan.internal.xsltc.dom.SimpleResultTreeImpl.characters(SimpleResultTreeImpl.java)
at com.sun.org.apache.xalan.internal.xsltc.dom.SimpleResultTreeImpl.copy(SimpleResultTreeImpl.java:438)
at com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary.copy(BasisLibrary.java:1317)
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
at GregorSamsa.replace()
It appears that there is some recursion happening here based on all the calls to GregorSamsa.replace()
. The fact that it works on Windows and not Solaris could be due to different implementations of the JVM or more likely, default JVM options for stack size.
Here is what the JVM stack size option does.
Here is how you can increase the stack size in Eclipse.
Here is how you can set the stack size via command line along with more discussion on this topic:
$ javac TT.java
$ java -Xss4m TT
-Xss4m = 4 megs
-Xss1024k = 1024kb
If you want to launch a new thread from your application with a specified stack size for only that thread then take a look at the constructors for Thread class, including:
public Thread(ThreadGroup group, Runnable target,String name,long stackSize)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With