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 231183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:54:43+00:00 2026-05-11T19:54:43+00:00

I started to ask this question and then figured out the answer before submitting

  • 0

I started to ask this question and then figured out the answer before submitting it. I’ve decided to post the question anyway so that other people who run into the same problem will be able to learn from my mistakes.


I’m having a problem with an applet (a JApplet actually) unable to instantiate another class which is included in the same jar as the applet. The exception I’m seeing on the Java console is:

Exception in thread "thread applet-com.company.program.cm.hmi.MediatorApplet-1" java.lang.NoClassDefFoundError: com/company/program/cm/cs/JDataStore
    at com.company.program.cm.hmi.MediatorApplet.getMediator(MediatorApplet.java:63)
    at com.company.program.cm.hmi.MediatorApplet.init(MediatorApplet.java:49)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.company.program.cm.cs.JDataStore
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 4 more
Caused by: java.io.IOException: open HTTP connection failed:http://localhost:8080/TransportHMI/pages/com/company/program/cm/cs/JDataStore.class
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 8 more

I know that the JDataStore class is included in the jar. If I list the contents using jar tvf CM_Library.jar I can see that it is there under the proper package. However, the chained exceptions above lead me to believe that the class loader isn’t searching the archive for JDataStore, and is looking for the JDataStore.class file on the web server instead. Why is this? The class loader knows to load the MediatorApplet class from the jar, why doesn’t it check it for JDataStore as well? In case I haven’t specified the parameters correctly on the applet tag, I’ll include that here as well:

<applet id="mediator-applet"
        width="0"
        height="0"
        codebase="./"
        archive="CM_Library.jar"
        code="com.company.program.cm.hmi.MediatorApplet">
</applet>
  • 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-11T19:54:43+00:00Added an answer on May 11, 2026 at 7:54 pm

    Found the answer from looking at a suggestion posted for a related question. Eddie’s answer didn’t solve that particular problem, but it did give me the solution for mine.

    What isn’t particularly obvious from my question is that the JDataStore class inherits from another class which is contained in a different jar. I hadn’t had to deal with the implementation details of JDataStore in a couple of months, so I completely forgot that its parent class, org.json.simple.JSONObject, wasn’t in CM_Library.jar, but was in json_simple-1.0.2.jar. The fix is fairly simple, just copy the missing jar to the codebase directory and add the missing jar to the comma-separated list of archives in the applet tag’s archive attribute:

    <applet id="mediator-applet"
            width="0"
            height="0"
            codebase="./"
            archive="CM_Library.jar, json_simple-1.0.2.jar"
            code="com.company.program.cm.hmi.MediatorApplet">
    </applet>
    

    That fixes the error. The exception message is not particularly helpful. It would lead you to believe that it can’t find the class at all, when the actual problem is that it cannot load the super class for the requested class.

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

Sidebar

Related Questions

This is a complete noob question, but I gotta ask it anyway I started
This might be a very stupid question, but I have to ask it anyway.
Started with this question: OpenID. How do you logout OK. So OpenID does not
i am sure this is quite a numb question to ask and most probably
We have a question we ask at our office during interviews that goes like
There may be more than one way to ask this question, so here's a
I'm sorry if this question is a dumb one, but I must ask. In
I started making a reproducible example to ask another question and can't even get
I started an application in Google App Engine right when it came out, to
I started a Rails project recently and decided to use RESTful controllers. I created

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.