Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5980159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:45:42+00:00 2026-05-22T21:45:42+00:00

I have an applet, which I was writing in Java. Recently, I thought that

  • 0

I have an applet, which I was writing in Java. Recently, I thought that it would be good to add some Scala code to it (since Scala has good interoperability with Java). Everything works fine, but when I try to optimize the resulting jars using ProGuard, I have java.lang.StackOverflowError. How can I fix it?

Error:

The following error occurred while executing this line:
/var/www/parrot/Parrot/build.xml:84: 
java.lang.StackOverflowError
    at proguard.classfile.util.SimplifiedVisitor.visitProgramClass(SimplifiedVisitor.java:53)
    at proguard.optimize.info.StaticInitializerContainingClassFilter.visitProgramClass(StaticInitializerContainingClassFilter.java:50)
    at proguard.classfile.ProgramClass.accept(ProgramClass.java:280)
    at proguard.classfile.ProgramClass.hierarchyAccept(ProgramClass.java:293)
    at proguard.classfile.ProgramClass.hierarchyAccept(ProgramClass.java:333)
    at proguard.classfile.ProgramClass.hierarchyAccept(ProgramClass.java:333)
    at proguard.classfile.ProgramClass.hierarchyAccept(ProgramClass.java:333)
    ... and so on, several thousand times ...

My ant configuration for proguard:

<proguard
    optimizationpasses="${optpass}"
    obfuscate="true"
    verbose="true"
    target="6"
    printseeds="true"
    allowaccessmodification="true"
    overloadaggressively="true"
    mergeinterfacesaggressively="true"
    repackageclasses="def"
    >

    <injar file="dist/Parrot.jar" />
    <injar path="dist/lib/" /><!-- scala-library.jar is also in this lib directory -->
    <libraryjar path="/home/platon/java/jdk1.6.0_24/jre/lib/" />
    <outjar file="dist/ParrotOp.jar" filter="!**.SF" />

    <keep access="public" name="launch.parrotApp" />

    <keepclassmembers extends="java.lang.Enum">
        <method access="public static"
            type="**[]"
            name="values"
            parameters="" />
        <method access="public static"
            type="**"
            name="valueOf"
            parameters="java.lang.String" />
    </keepclassmembers>

        <!-- Processing the scala library (as shown in proguard manual) -->
        -dontwarn **$$anonfun$*
        -dontwarn scala.collection.immutable.RedBlack$Empty
        -dontwarn scala.tools.**,plugintemplate.**

        -keepclasseswithmembers public class * {
            public static void main(java.lang.String[]);
        }

        -keep class * implements org.xml.sax.EntityResolver

        -keepclassmembers class * {
            ** MODULE$;
        }

        -keepclassmembernames class scala.concurrent.forkjoin.ForkJoinPool {
            long eventCount;
            int  workerCounts;
            int  runControl;
            scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode syncStack;
            scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode spareStack;
        }

        -keepclassmembernames class scala.concurrent.forkjoin.ForkJoinWorkerThread {
            int base;
            int sp;
            int runState;
        }

        -keepclassmembernames class scala.concurrent.forkjoin.ForkJoinTask {
            int status;
        }

        -keepclassmembernames class scala.concurrent.forkjoin.LinkedTransferQueue {
            scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference head;
            scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference tail;
            scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference cleanMe;
        }

    </proguard>

And by the way – there is nothing fancy about Scala code there, actually it is just as simple as

package scala1
object Main {
    def sum = 14
}

which is called from java:

System.err.println(scala1.Main.sum());
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:45:43+00:00Added an answer on May 22, 2026 at 9:45 pm

    I played around with proguard configuration, and found that if I set “mergeinterfacesaggressively” to “false”, everything starts to work.

    I will notify the library owner about this, and I hope this question will help someone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java Applet that uses AWT. In some (rare) circumstances, the platform
I have a Java Applet that I'm making some edits to and am running
We have an ages old Java applet that we want to move forward to
I have a paint application that runs as a Java applet. I need to
I have a java applet that creates a JPEG file. I want to pass
I have a Java applet which doesn't need any special privileges to run (i.e,
Hi I am trying to write a java applet that will get some hard
I am writing a Firefox extension which creates a Java applet in the page.
We have a Java Applet built using AWT. This applet lets you select pictures
I have to write an applet that brings up a password dialog. The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.