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

  • Home
  • SEARCH
  • 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
  • 0 Views
  • 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

We have some code that must access low level windows XP os calls which
I have applet which I run in command line like this: C:\Program Files (x86)\Java\jdk1.6.0_21\bin\appletviewer.exe
I have developed an applet java with Eclipse, which is included in MyPage.html. I
I'm writing an application in C++ which uses some external open source libraries. I
I have an applet that allows users to sign documents using their personal certificates.
I'm new to Java and have been asked to create an applet/servlet (not sure
I'm a building a web application in java. I have to create an applet
I am writing an iPad app that presents user documents similar to the way
I am experimenting with Java Web Start. I have just written a basic JApplet
Context: I am trying to practice BDD in a Ruby on Rails environment using

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.