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

  1. Confirm the matching logo asset exists on the classpath: logo_local.png when offline, logo_pro.png otherwise.
  2. Rebuild the start module so frontend/static assets (including the logo pngs) are assembled into the jar/resources.
  3. Align chat2db.network.status with the logo variant actually packaged.
  4. 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

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


AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14). Data as JSON: /api/errors/4a3ad2faac6e0ec2. Report an issue: GitHub.