jeecgboot/JeecgBoot · warning · JeecgBootException
被发送人不能为空
Error message
被发送人不能为空
What it means
SystemSendMsgHandle.sendMsg() sends a system announcement and requires a non-empty recipient (esReceiver -- a username). It throws JeecgBootException '被发送人不能为空' immediately when esReceiver is blank, before delegating to sysBaseApi.sendSysAnnouncement.
Source
Thrown at jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/message/handle/impl/SystemSendMsgHandle.java:58
@Resource
private SysUserMapper userMapper;
@Resource
private SysAnnouncementSendMapper sysAnnouncementSendMapper;
@Resource
private WebSocket webSocket;
/**
* 该方法会发送3种消息:系统消息、企业微信 钉钉
* @param esReceiver 发送人
* @param esTitle 标题
* @param esContent 内容
*/
@Override
public void sendMsg(String esReceiver, String esTitle, String esContent) {
if(oConvertUtils.isEmpty(esReceiver)){
throw new JeecgBootException("被发送人不能为空");
}
ISysBaseAPI sysBaseApi = SpringContextUtils.getBean(ISysBaseAPI.class);
MessageDTO messageDTO = new MessageDTO(FROM_USER,esReceiver,esTitle,esContent);
sysBaseApi.sendSysAnnouncement(messageDTO);
}
/**
* 仅发送系统消息
* @param messageDTO
*/
@Override
public void sendMessage(MessageDTO messageDTO) {
//原方法不支持 sysBaseApi.sendSysAnnouncement(messageDTO); 有企业微信消息逻辑,
String title = messageDTO.getTitle();
String content = messageDTO.getContent();
String fromUser = messageDTO.getFromUser();
Map<String,Object> data = messageDTO.getData();
String[] arr = messageDTO.getToUser().split(",");View on GitHub (pinned to 96fb33f5ec)
Solutions
- Configure a recipient (username) on the triggering message template/schedule.
- Validate esReceiver is non-empty at the caller before invoking sendMsg.
- If recipients are computed, fall back to a default admin user instead of empty.
Example fix
// before
public void sendMsg(String esReceiver, String esTitle, String esContent) {
if(oConvertUtils.isEmpty(esReceiver)){ throw new JeecgBootException("被发送人不能为空"); }
...
}
// after - caller-side guard
if (oConvertUtils.isEmpty(receiver)) { log.warn("跳过发送:无收件人"); return; } Defensive patterns
Strategy: validation
Validate before calling
if (oConvertUtils.isEmpty(esReceiver)) {
log.warn("系统消息发送被跳过:收件人为空, title={}", esTitle);
return; // or throw, depending on caller policy
} Try / catch
try {
systemSendMsgHandle.sendMsg(receiver, title, content);
} catch (JeecgBootException e) {
if ("被发送人不能为空".equals(e.getMessage())) {
log.warn("跳过发送:无收件人");
} else throw e;
} Prevention
- Configure recipients on all message templates/schedules.
- Resolve recipient expressions to a non-empty value or skip the send.
When it happens
Trigger: A message template / schedule triggers with no configured recipient; the esReceiver argument is null/empty/whitespace; the referenced user was deleted upstream so the caller passed empty.
Common situations: Message config missing the receiver field; a workflow/notification node with an empty recipient expression; a dict-driven recipient that resolved to empty.
Related errors
AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14).
Data as JSON: /api/errors/e90a5bf73c32168a.
Report an issue: GitHub.