StackOverflowError in PAC processing

The public knowledge pool and discussion forum of the OWS community. Do not post confidential information here!
Masuda
Posts: 6
Joined: 22 Oct 2025, 09:46

StackOverflowError in PAC processing

Post by Masuda »

Nice to meet you.

We are planning to migrate a system that currently runs under Java Web Start (Oracle JRE 8) to Open Web Start.
While verifying whether the system functions correctly with Open Web Start, we encountered the error described below, so I am contacting you for assistance.
In our environment, the proxy configuration is set to use a PAC-based proxy. When launching the JNLP file from the browser and Open Web Start starts, the following error message is displayed.

Fatal: Initialization Error: Could not initialize application. The application has not been initialized

Upon reviewing the logs captured at the time of the failure, the output shown below was generated.

--------------------------------------------------------------------------------
[com.openwebstart.proxy.pac.PacFileEvaluator] Open PAC url 'http://[xxx.xxx.xxx.xxx]/pac/Proxy_hq.pac'
[com.openwebstart.proxy.pac.PacBasedProxyProvider] PAC Proxies found for 'socket://[xxx.xxx.xxx.xxx]:80' : [DIRECT]
[net.adoptopenjdk.icedteaweb.resources.initializer.BaseResourceInitializer] failed to determine best URL: java.util.concurrent.ExecutionException: java.lang.StackOverflowError
[net.adoptopenjdk.icedteaweb.resources.initializer.UnversionedResourceInitializer] Failed to determine best URL for [l=https://[FQDN]/[Application]/jnlp/Extention.jnlp v=nul s=I] will try all of [https://[FQDN]/[Application]/jnlp/Extention.jnlp]
[net.adoptopenjdk.icedteaweb.resources.downloader.BaseResourceDownloader] Will download in background: https://[FQDN]/[Application]/jnlp/Extention.jnlp
[net.adoptopenjdk.icedteaweb.resources.downloader.BaseResourceDownloader] downloadFrom exception: null
[net.adoptopenjdk.icedteaweb.resources.downloader.BaseResourceDownloader] Could not download resource [l=https://[FQDN]/[Application]/jnlp/Extention.jnlp v=nul s=I] from any of theses urls [https://[FQDN]/[Application]/jnlp/Extention.jnlp] caused byExecutionException: java.lang.StackOverflowError caused by StackOverflowError: nul
[net.adoptopenjdk.icedteaweb.resources.ResourceTracker] Download done. Shutting down executor
[net.adoptopenjdk.icedteaweb.resources.ResourceTracker] Error flag set for resource 'https://[FQDN]/[Application]/jnlp/Extention.jnlp'. Can not return a local file for the resource
[net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader]
Exception while initializing extension 'https://[FQDN]/[Application]/jnlp/Extention.jnlp'
java.io.IOException: Error fetching file from https://[FQDN]/[Application]/jnlp/Extention.jnlp
----------------------------------------------------------------------------------

From the logs, it appears that a StackOverflowError is thrown during the process that consults the PAC file; this is the immediate cause of the failure.
The problem does not occur whenever a PAC-based proxy is selected; rather, it appears to manifest only under specific conditions within the PAC file.

the environment in which the issue reproduces is as follows:

OpenWebStart 1.12.0
Amazon Corretto 1.8.0_472

I would appreciate any guidance on how to diagnose or resolve this issue, including whether there are known limitations in Open Web Start’s PAC processing or recommended workarounds.

Thank you for your time and assistance.

Sincerely,

Janak Mulani
Posts: 1088
Joined: 24 Mar 2020, 13:37

Re: StackOverflowError in PAC processing

Post by Janak Mulani »

OWS is using Rhino https://github.com/mozilla/rhino for processing the PAC proxy JavaScript.

Can you find out which URL pattern is making the PAC proxy JS execution go into infinite recursion? Please examine the JS code of the PAC file for that URL pattern.

I would like to look at your OWS logs. But this being public forum I can understand your hesitation to share them here.

I would request you to buy paid support https://openwebstart.com/support/ where in you can get a private channel on the forum and guaranteed response time to your posts.

Masuda
Posts: 6
Joined: 22 Oct 2025, 09:46

Re: StackOverflowError in PAC processing

Post by Masuda »

Thank you for your reply.

Regarding the logs, the ones I have posted are all the logs I was able to obtain from the location where the error occurred (with certain IP addresses and other details masked). If there is a way to obtain more detailed logs, could you please let me know? I believe that would help in identifying which URL pattern is causing the issue.

Also, could you tell me which version of Rhino is used in OWS?

Janak Mulani
Posts: 1088
Joined: 24 Mar 2020, 13:37

Re: StackOverflowError in PAC processing

Post by Janak Mulani »

https://openwebstart.com/docs/OWSGuide.html#_logging

Rhino v1.7.12. Current Rhino version is 1.18.0 we could upgrade to that. However, we had upgraded to 1.7.14 but had to downgrade to 1.7.12 due to https://github.com/karakun/OpenWebStart/issues/583.

Masuda
Posts: 6
Joined: 22 Oct 2025, 09:46

Re: StackOverflowError in PAC processing

Post by Masuda »

I would like to provide an update regarding the cause of the StackOverflowError encountered during the PAC proxy processing. It appears that the error was simply due to the PAC processing being excessively lengthy, which resulted in an insufficient thread stack size.

This issue was resolved by adding the following setting to the deployment.properties file:
ows.jvmargs.for.jvm_args_1.jnlp=Xss2048k

I would appreciate your confirmation regarding the specification method for Java VM arguments. My understanding is that the segment "jvm_args_1.jnlp" corresponds to the name of the applicable JNLP file. Is there a way to specify JVM arguments that apply universally to all JNLP files, rather than on a per-JNLP file basis?

I would like to inform you of the methods I have currently tried in an attempt to resolve the issue, but unfortunately, these approaches did not yield the desired results:

 Setting the Java VM arguments via the Windows environment variable JAVAWS_VM_ARGS.
 Configuring the Java VM arguments within the javaws.vmoptions file located in AppData\Local\Programs\OpenWebStart.

Janak Mulani
Posts: 1088
Joined: 24 Mar 2020, 13:37

Re: StackOverflowError in PAC processing

Post by Janak Mulani »

Happy to know that the problem is solved. Thanks for sharing how you fixed it.

Normally jvm args are specified in the Jnlp file itself as these are specific to the JRE and the Jnlp application specified in the Jnlp file.

For the legacy apps where it is not possible to modify the Jnlp file, OWS provides the option of specifying JVM args for a particular Jnlp :
https://openwebstart.com/docs/OWSGuide. ... _arguments

The option that you have chosen to specify JVM arg ows.jvmargs.for.jvm_args_1.jnlp will apply to the Jnlp file: jvm_args_1.jnlp.

However, if you wish to add/override JVM args for all Jnlps files through a deployment property, we can do a custom implementation for you. Would you like us to send a quotation for the same? I would also request you to buy support to help sustain the OWS open source project: https://openwebstart.com/support/

FYI, in the next release of OWS due by November end we have upgraded the version of Rhino.

Janak Mulani
Posts: 1088
Joined: 24 Mar 2020, 13:37

Re: StackOverflowError in PAC processing

Post by Janak Mulani »

Further to the earlier post, I tried setting the environment variable: set JAVAWS_VM_ARGS=-Xss2048k. This worked for me. But this will work only in Stage 2 of OWS when the PAC is processed while downloading the jar files

You said that for you JAVAWS_VM_ARGS=-Xss2048k did not work. Do you mean to say that you ran into the Stackoverflow issue when the PAC was processed while downloading the Jnlp file in Stage 1 of OWS?

Can you please provide the logs?

One solution you can try is to also specify -Xss2048k in the javaws_vmoptions file (which is in the OWS install directory) as follows:

Code: Select all

# Enter one VM parameter per line
# For example, to adjust the maximum memory usage to 512 MB, uncomment the following line:
# -Xmx512m
# To include another file, uncomment the following line:
# -include-options [path to other .vmoption file]
-Xss2048k
So, you need to specify the -Xss vm arg in javaws.vmoptions as well as either in JAVAWS_VM_ARGS or Jnlp file or deployment.properties file for a specific Jnlp. In case you want a universal solution via property in deployment.properties file, we can provide a quote for that feature.

Post Reply