Xml conversion exception

I get the following java stackoverflow error when converting xml in 10g web server hosted in sun solaris . This only happens for a specific xml transformation, and all xml conversions work just fine. The xsl file used is also not very large.

I am using the Transformation api available in rt.jar, but getting this error from the xalan apache package ( com.sun.org.apache.xalan.internal.xsltc.dom.SimpleResultTreeImpl ), which I did not pack in my application.

Another interesting thing: I did not get this exception, when I run the application on a 10g weblogic server hosted on a Windows machine, I only get it in a solarium.

Can someone tell me why I am getting this error.

Can you tell me which jar file throws an exception? Will weblogic have xalan.jar? If so, can I try updating the jar file and see if it works?

 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() 
+4
source share
1 answer

It seems like there is some recursion based on all calls to GregorSamsa.replace() . The fact that it runs on Windows rather than Solaris may be due to various JVM implementations or, more likely, the default JVM settings for the stack size.

Here's what the JVM stack size option does.

Here is how you can increase the stack size in Eclipse.

Here's how you can set the size of the stack through the command line, as well as continue the discussion of this topic:

 $ javac TT.java $ java -Xss4m TT 

-Xss4m = 4 megs
-Xss1024k = 1024kb

If you want to start a new thread from your application with the specified stack size for that thread only, look at the constructors for the Thread class , including:

 public Thread(ThreadGroup group, Runnable target,String name,long stackSize) 
+4
source

Source: https://habr.com/ru/post/1416194/


All Articles