jeecgboot/JeecgBoot · error · JeecgBootBizTipException

调用java增强失败

Error message

调用java增强失败

What it means

This error is thrown by JimuDataReader.process() when any exception occurs during Excel file processing. The method implements IAiRagEnhanceJava and is used as a Java enhancement for AI RAG data ingestion from Jimu (JimuReport) integration. The catch block wraps all exceptions — including file-not-found, empty path, and Excel parsing errors — into a single generic '调用java增强失败' message.

Source

Thrown at jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/demo/JimuDataReader.java:45

    @Override
    public Map<String, Object> process(Map<String, Object> inputParams) {
        // inputParams: {"bizData":"/xxxx/xxxx/xxxx/xxxx.xls"}
        try {
            String filePath = (String) inputParams.get("bizData");
            if (filePath == null || filePath.isEmpty()) {
                throw new IllegalArgumentException("File path is empty");
            }

            File excelFile = new File(filePath);
            if (!excelFile.exists() || !excelFile.isFile()) {
                throw new IllegalArgumentException("File not found: " + filePath);
            }

            // Since we don't know the target entity class, we'll read the Excel generically
            return readExcelData(excelFile);
        } catch (Exception e) {
            log.error("Error processing Excel file", e);
            throw new JeecgBootBizTipException("调用java增强失败", e);
        }
    }

    /**
     * Excel导入工具方法,基于ExcelImportUtil
     *
     * @param file Excel文件
     * @return Excel读取结果,包含字段和数据
     * @throws Exception 导入过程中的异常
     */
    public static Map<String, Object> readExcelData(File file) throws Exception {
        Map<String, Object> result = new HashMap<>();

        // 设置导入参数
        ImportParams params = new ImportParams();
        params.setTitleRows(0); // 没有标题
        params.setHeadRows(1);  // 第一行是表头

View on GitHub (pinned to 96fb33f5ec)

Solutions

  1. Check the wrapped cause exception (e.getCause()) in logs for the specific failure reason.
  2. Verify the bizData file path exists and is readable by the application process.
  3. Ensure the Excel file is a valid .xls or .xlsx file that AutoPoi can parse.
  4. If the file is on a remote/share path, verify network mount and permissions.
  5. Test reading the file independently using ExcelImportUtil.importExcel() to isolate the issue.

Example fix

// before — generic catch hiding the root cause
} catch (Exception e) {
    log.error("Error processing Excel file", e);
    throw new JeecgBootBizTipException("调用java增强失败", e);
}

// after — specific error messages for common failures
} catch (IllegalArgumentException e) {
    throw new JeecgBootBizTipException("文件路径无效: " + e.getMessage(), e);
} catch (Exception e) {
    log.error("Error processing Excel file", e);
    throw new JeecgBootBizTipException("调用java增强失败: " + e.getMessage(), e);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Before calling process(), validate the file
String filePath = (String) inputParams.get("bizData");
if (filePath == null || filePath.isEmpty()) {
    throw new IllegalArgumentException("bizData (file path) is required");
}
File file = new File(filePath);
if (!file.exists() || !file.isFile()) {
    throw new IllegalArgumentException("File not found: " + filePath);
}
if (!file.getName().endsWith(".xls") && !file.getName().endsWith(".xlsx")) {
    throw new IllegalArgumentException("Only .xls and .xlsx files are supported");
}

Type guard

public static boolean isValidExcelFile(String filePath) {
    if (filePath == null || filePath.isEmpty()) return false;
    File f = new File(filePath);
    if (!f.exists() || !f.isFile() || !f.canRead()) return false;
    String name = f.getName().toLowerCase();
    return name.endsWith(".xls") || name.endsWith(".xlsx");
}

Try / catch

try {
    Map<String, Object> data = jimuDataReader.process(inputParams);
    return data;
} catch (JeecgBootBizTipException e) {
    // The cause contains the specific failure
    Throwable rootCause = e.getCause();
    log.error("Java enhancement (JimuData) failed: {}", rootCause != null ? rootCause.getMessage() : e.getMessage());
    throw e;
}

Prevention

When it happens

Trigger: The AI RAG Java enhancement pipeline calls JimuDataReader.process() with a map containing 'bizData' pointing to an Excel file path. Any failure (null/empty path, file not found, malformed Excel, AutoPoi parsing error) results in this catch-all exception. The original exception is preserved as the cause.

Common situations: The bizData file path is incorrect or the file was moved/deleted. The Excel file is corrupted or in an unsupported format (e.g. .xlsb, .xlsm with macros). The AutoPoi library encounters an unparseable cell or sheet structure. The server process doesn't have read permissions on the file. The file path uses a different OS path separator than expected.

Related errors


AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14). Data as JSON: /api/errors/bd47b98855f3ecdc. Report an issue: GitHub.