Skip to content

getJAI() fails with exception causing the application to crash #41

@Scholvac

Description

@Scholvac

Hi,

I just stumbled over an exception inside the BufferedImageHelper, that causes my application to crash.
I'm running in an plugin environment and are not able to load the JAI object, using the ComponentFactory (as indicated by the comments inside the ComponentFactory.create method).
However switching the order of statements inside the BufferedImageHelper.getJAI() method solves the issue for me.
Now I'm just getting one exception at the beginning and can use the fallback method you provided.

In my solution the BufferedImageHelper.getJAI() method looks like:

protected static Object getJAI() {
    if (!checkedForJAI) {
    	checkedForJAI = true; //mark as checked before the exception occurs to not check again
        jaiObj = ComponentFactory.create("javax.media.jai.JAI");
    }
    return jaiObj;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions