OtterMind/Chat2DB · error · BusinessException
e.getMessage()
Error message
e.getMessage()
What it means
BusinessException carrying the raw IOException message from MainJFrame when resolving the window logo image URL fails. The code picks logo_local.png (offline) or logo_pro.png (online) from the classpath via DefaultResourceLoader and, on IOException, rethrows e.getMessage() directly as the business message.
Source
Thrown at chat2db-community-server/chat2db-community-jcef/src/main/java/ai/chat2db/community/jcef/frame/MainJFrame.java:377
private void setupGenericPlatformSpecifics(Image appIcon) {
this.setTitle(appName);
this.setIconImage(appIcon);
applyTheme(ThemeEnum.DARK);
}
private static Image buildAppLogoImage() {
ResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource;
if (ConfigUtils.isOffline()) {
resource = resourceLoader.getResource("classpath:logo_local.png");
}else {
resource = resourceLoader.getResource("classpath:logo_pro.png");
}
URL imageUrl;
try {
imageUrl = resource.getURL();
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new BusinessException(e.getMessage());
}
log.info("Image URL: {}", imageUrl);
return new ImageIcon(imageUrl).getImage();
}
public void applyTheme(ThemeEnum theme) {
log.info("Applying {} theme to menu UI.", theme);
applyCommonMenuFont();
if (theme == ThemeEnum.DARK) {
initDarkModeMenuUI();
} else {
initLightModeMenuUI();
}
SwingUtilities.updateComponentTreeUI(this);
}
private void applyCommonMenuFont() {
Font defaultFont = UIManager.getFont("Menu.font");
if (defaultFont == null) {
defaultFont = new Font("SansSerif", Font.PLAIN, 12);View on GitHub (pinned to 5ee1e990e7)
Solutions
- Confirm the matching logo asset exists on the classpath: logo_local.png when offline, logo_pro.png otherwise.
- Rebuild the start module so frontend/static assets (including the logo pngs) are assembled into the jar/resources.
- Align chat2db.network.status with the logo variant actually packaged.
- Note the message is e.getMessage() verbatim — it is not localized, so treat it as a packaging/classpath defect, not a user-facing message.
Example fix
// before
imageUrl = resource.getURL();
// after: defensive fallback to whichever logo is present
Resource r = ConfigUtils.isOffline()
? resourceLoader.getResource("classpath:logo_local.png")
: resourceLoader.getResource("classpath:logo_pro.png");
if (!r.exists()) r = resourceLoader.getResource("classpath:logo.png");
imageUrl = r.getURL();
Defensive patterns
Strategy: validation
Validate before calling
Resource r = ConfigUtils.isOffline()
? resourceLoader.getResource("classpath:logo_local.png")
: resourceLoader.getResource("classpath:logo_pro.png");
if (!r.exists()) throw new BusinessException("logo resource missing on classpath"); Try / catch
try { imageUrl = resource.getURL(); }
catch (java.io.IOException e) {
log.error("logo resource unresolved", e);
throw new BusinessException("logo resource unavailable", e);
} Prevention
- Confirm the matching logo asset is packaged for the selected offline/online mode.
- Rebuild the start module so static assets are assembled into the jar.
- Align chat2db.network.status with the logo variant that ships.
- Provide a fallback logo resource to avoid a hard startup failure.
When it happens
Trigger: resource.getURL() throws IOException because the packaged logo resource (logo_local.png / logo_pro.png) is absent from the classpath, the JAR/resource directory is unreadable, or the resource loader cannot resolve it.
Common situations: Desktop/JCEF build assembled without copying the logo asset into the jar; classpath resource renamed/removed; offline flag (chat2db.network.status=OFFLINE) selecting logo_local.png when only logo_pro.png is packaged; corrupted jar.
Related errors
- Failed to load frontend files
- Missing local file path
- Failed to update local file
- Unable to register the Chat2DB preview resource scheme
- Unable to register the Chat2DB preview resource handler
AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14).
Data as JSON: /api/errors/4a3ad2faac6e0ec2.
Report an issue: GitHub.