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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:25:31+00:00 2026-06-08T22:25:31+00:00

I have a large system in Java, which basicaly consists of an user interface,

  • 0

I have a large system in Java, which basicaly consists of an user interface, the “core engine” of the application and a lot of other modules.
I am trying to create an applet that will consist only of the “core engine”, without the other parts, so I need to share the same codebase to keep up with the updates.
I’ve done this and it works well, the problem is that there are a lot of external jars used in the other parts that I don’t need, and the applet currently requires them all.

I don’t call the part of the code that needs the external jar and the stack trace gives me an error when I am calling a constructor of a class, so what I am guessing is that it requires the jars as soon as this class (that I’m using the constructor) is loaded. But I’ve read on the internet that Java only loads classes when required, so I’m not sure what is going on here. Could anybody give me some advice about how can I make it not need these jars?

PS: I’m sure the best approach would be to refactor it, separating the functionality into clear layers, so I could tackle this more easily. The problem is that this is a very old and big codebase and doing this kind of mass-refactoring (although I would like to) is not viable right now.

Edit – adding one of the stack traces and more information:

java.io.FileNotFoundException: http://localhost:3000/applet/jess.jar
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.getJarFileWithoutCache(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.downloadJarFileWithoutCache(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
    at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
    at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at my.package.MyClass.<init>(MyClass.java:187)
    at my.package.MyApplet.start(MyApplet.java:38)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.start(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

MyClass line 187 is just:
MyClass2 obj = new MyClass2();

All other FileNotFoundException traces are identical, but missing other files.
Also, on this system, I have more than one release (academic and commercial version, for exemple) and a lot of the jars that are being required are not in the academic version, but I can compile the other versions using the same code without having problems with it needing these jars.

I know is kind of a tough situation to give help, but I though that maybe someone has been in a similar situation and could give me a hint.

Also, is there any chance that the fact that I have some method like:

public void myMethod() {
 ClassInOneOfTheJars c = new ClassInOneOfTheJars();
}

but never could this method could make the VM try to fetch the jar that contains ClassInOneOfTheJars? (As far as I’ve read, it seems like the answer would be ‘no’).

  • 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-06-08T22:25:33+00:00Added an answer on June 8, 2026 at 10:25 pm

    Based on the comments, what happened is that only when trying to load MyClass2 did the JVM try and access less.jar when searching the classpath. My guess is that just how classes are only loaded when they’re needed the first time, so are .jars / other classpath entries only first accessed when a class is not found in the previous ones.

    One way to explain the behaviour you see is that your classpath contains these .jars in the following order:

    1. a.jar (local)
    2. less.jar (remote)
    3. b.jar (local)

    Where MyClass is in a.jar; and MyClass2 is in b.jar. The classloader tries to load MyClass, opens a.jar, finds it there and loads it, and starts running the constructor. The constructor needs MyClass2, so the classloader opens a.jar, doesn’t find the class there, and moves on to the next classpath entry. This is less.jar, which is inaccessible, and you get the crash. When you removed the inaccessible .jar from the classpath, the classloader can move on to b.jar and finds MyClass2 there.

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

Sidebar

Related Questions

We have a large high-performance software system which consists of multiple interacting Java processes
I have a java applet in which I have to display a large amount
I'm trying to improve a Java project which uses a lot of large case
I have an Java EE application as follows: - Server is on Amazon (large
I have a large non-Java EE, JSF-based web app project. Our system is layered
We have a large (>500,000 LOC) Java system that depends on 40-50 OSS packages.
I have a large Java project(a SQL-backed personnel system, in Java 6) with a
I have a lot of zips with a large amount of Files which i
I have a large Java EE system connecting to an Oracle database via JDBC
I have a large system that I have coded and I wish to make

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.