pentaho/pentaho-kettle · error · RuntimeException
Unable to load image with name
Error message
Unable to load image with name [<location>]
What it means
ImageUtil.getImageInputStream resolves the image location through KettleVFS (first against registered bases, then the filesystem) and wraps any VFS FileSystemException in a RuntimeException naming the image location. It signals that no image resource could be resolved for the given name/path.
Solutions
- Verify the image path/name exists on the classpath or filesystem (mind case sensitivity)
- If part of a plugin, confirm the plugin jar contains the image and the plugin is installed correctly
- Fix the location string passed to getImageAsResource
- Check KettleVFS resolution base configuration
Example fix
// before
Image img = ImageUtil.getImageAsResource(display, "images/myicon.png"); // throws if missing
// after (guard for existence)
InputStream in = ImageUtil.class.getClassLoader().getResourceAsStream("images/myicon.png");
if (in != null) { Image img = ImageUtil.getImageAsResource(display, "images/myicon.png"); in.close(); } Defensive patterns
Strategy: fallback
Validate before calling
InputStream in = ImageUtil.class.getClassLoader().getResourceAsStream(location);
boolean available = in != null;
if (in != null) { in.close(); } Type guard
boolean isImageResolvable(String location) {
try { return ImageUtil.class.getClassLoader().getResource(location) != null; }
catch (Exception e) { return false; }
} Try / catch
try {
Image img = ImageUtil.getImageAsResource(display, location);
} catch (RuntimeException e) {
log.warn("Image {} missing, using placeholder", location, e);
Image img = display.getSystemImage(SWT.ICON_WARNING);
} Prevention
- Keep image resources inside the jar at expected paths
- Verify exact case of resource paths (Linux is case-sensitive)
- Test image loading after plugin installation or version upgrades
When it happens
Trigger: Calling ImageUtil.getImageAsResource with a location string that is not resolvable by KettleVFS — e.g. a missing plugin image, a typo'd resource path, or a file absent from the filesystem/classpath.
Common situations: Plugin ships images not on the classpath; relocated UI resources after a version upgrade; case-mismatched resource names on Linux; broken KettleVFS base configuration.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- CustomVfsSettingsParser.Log.FailedToLoad
- Filename not provided
- A step in transformation [" + transMeta.toString() + "]…
- AbstractFileErrorHandler.Exception.CouldNotCreateFileErrorHandlerForFile
- Append file in repository is not possible
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/15a0f8df4ca33c1a.
Report an issue: GitHub.
Appendix: source
Thrown at ui/src/main/java/org/pentaho/di/ui/util/ImageUtil.java:88
if ( cl == null ) {
// Can't count on Thread.currentThread().getContextClassLoader() being non-null on Mac
// Have to provide some fallback
cl = ImageUtil.class.getClassLoader();
}
URL res = cl.getResource( location );
if ( res != null ) {
try {
java.io.InputStream s = res.openStream();
return s;
} catch ( IOException e ) {
// do nothing. just move on to trying to load via file system
}
}
try {
FileObject imageFileObject = KettleVFS.getInstance().getFileSystemManager().resolveFile( base, location );
return KettleVFS.getInputStream( imageFileObject );
} catch ( FileSystemException e ) {
throw new RuntimeException( "Unable to load image with name [" + location + "]", e );
}
}
/**
* TODO: Load splash and common images.
*/
public static Image getImageAsResource( Display display, String location ) {
return new Image( display, getImageInputStream( display, location ) );
}
/**
* TODO: not used.
*/
public static Image getImage( Display display, Class<?> resourceClass, String filename ) {
try {
return new Image( display, resourceClass.getResourceAsStream( filename ) );
} catch ( Exception e ) {
try {View on GitHub (pinned to f3058517a1)