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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:03:21+00:00 2026-06-01T22:03:21+00:00

I have a memory class loader ( here ) that I am using in

  • 0

I have a memory class loader (here) that I am using in a custom Minecraft launcher.

Memory Class Loader

Whenever I load up Minecraft (a Java LWJGL game), I am getting the following error:

27 achievements
182 recipes
Setting user
LWJGL Version: 2.4.2
java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(Unknown Source)
at lc.<init>(SourceFile:21)
at gi.<init>(SourceFile:10)
at net.minecraft.client.Minecraft.a(SourceFile:254)
at net.minecraft.client.Minecraft.run(SourceFile:657)
at java.lang.Thread.run(Unknown Source)

I am creating the class loader like this:

Base.cLoader = new CLoader(
    GameUpdater.classLoader,
    new JarInputStream(new ByteArrayInputStream(jarFileBytes)));

As you can see, it manages to load up the first part then suddenly after LWJGL Version it crashes with “input == null”.

Edit – Here is the new getResource method.

The error is on “URL()”, as shown.

Image

Code:

public URL getResource(final String name) {
    URL url = new URL() { public InputStream openStream() {
        return new ByteArrayInputStream((byte[])others.get(name));
    }};

    return url;
}
  • 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-01T22:03:22+00:00Added an answer on June 1, 2026 at 10:03 pm

    A wild guess… it could be this: Warning: URLs for this are not yet implemented! You cannot call getResource() or getResources()!

    So your code expects to retrieve an image from the JAR using the unimplemented method. An equivalent of this is probably being executed:

    ImageIO.read(memClassLoader.getResource(someString));
    

    Except that, as we have seen, the Error thrown from getResource is getting ignored and null being used as the value. ImageIO.read goes like this:

    public static BufferedImage read(URL input) throws IOException {
        if (input == null) {
            throw new IllegalArgumentException("input == null!");
        }
    
        InputStream istream = null;
        try {
            istream = input.openStream();
        } catch (IOException e) {
            throw new IIOException("Can't get input stream from URL!", e);
        }
    }
    

    Sounds familiar? So, this is roughly what you need to implement:

    public URL getResource(final String name) {
      try {
        return new URL("", "", 0, "",
            new URLStreamHandler() { public URLConnection openConnection(URL url) {
              return new URLConnection(url) {
                public void connect() {}
                public InputStream getInputStream() {
                  // return the appropriate InputStream, based on the name arg
                }
              };
            }});
      } catch (MalformedURLException e) { throw new RuntimeException(e); }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am loading an external class using a class-loader. I have a custom security
Assume, that I have class with static methods only. Will class loader load every
I have a class that parses very large file (that can't fit in memory)
I have a perm gen memory leak, that I know. Profiling using jvisualvm shows
I have a JAVA class in which I have implemented parsing of XML using
I have a class with many collections loaded in memory. Is it possible to
Let's say we have a memory-intensive class like an Image , with chainable methods
I have a static std::vector in a class. When I use Microsoft's memory leak
I am trying to load an image in memory but might have memory issues
I have a memory buffer corresponding to my screen resolution (1280x800 at 24-bits-per-pixel) that

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.