paascloud/paascloud-master · error · BusinessException
TPC100500011
TPC100500011
Error message
TPC100500011
What it means
MqMessage.buildMessage throws ErrorCodeEnum.TPC100500011 when the message body cannot be converted to bytes using the platform default charset (UnsupportedEncodingException from RemotingHelper.DEFAULT_CHARSET). It indicates an internal charset problem while assembling the RocketMQ message.
Solutions
- Check the JVM's file.encoding / default charset; run with a standard value like -Dfile.encoding=UTF-8.
- Verify RemotingHelper.DEFAULT_CHARSET resolves to a supported charset name (UTF-8) in your environment.
- Log the exception (already done) to confirm which charset name failed, and rebuild/fix the runtime image if the charset is missing.
Example fix
// before java -Dfile.encoding=ISO-8859-x -jar app.jar // after java -Dfile.encoding=UTF-8 -jar app.jar
Defensive patterns
Strategy: try-catch
Validate before calling
// ensure charset support at startup
if (!Charset.isSupported("UTF-8")) {
throw new IllegalStateException("JVM does not support UTF-8");
} Try / catch
try {
Message msg = MqMessage.buildMessage(body, topic, tag, key);
} catch (BusinessException e) {
log.error("MQ message charset failure: {}", e.getMessage(), e);
} Prevention
- Launch JVMs with -Dfile.encoding=UTF-8.
- Verify charset support in container startup scripts.
- Avoid overriding RemotingHelper.DEFAULT_CHARSET with exotic charsets.
When it happens
Trigger: Calling MqMessage.buildMessage (via checkMessage) where body.getBytes(RemotingHelper.DEFAULT_CHARSET) throws UnsupportedEncodingException — practically only when the JVM does not support the configured default charset name.
Common situations: JVM started with an unusual -Dfile.encoding value on a minimal JRE lacking that charset, a broken/custom RemotingHelper constant, or running on a stripped-down runtime image.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/a473549fa72146fb.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-common/paascloud-common-core/src/main/java/com/paascloud/core/mq/MqMessage.java:127
* Instantiates a new Mq message.
*
* @param message the message
*/
public MqMessage(Message message) {
this.body = new String(message.getBody());
this.topic = message.getTopic();
this.key = message.getKeys();
this.tag = message.getTags();
}
private static Message buildMessage(String body, String topic, String tag, String key) {
Message message = new Message();
try {
message.setBody(body.getBytes(RemotingHelper.DEFAULT_CHARSET));
} catch (UnsupportedEncodingException e) {
log.error("编码转换,出现异常={}", e.getMessage(), e);
throw new BusinessException(ErrorCodeEnum.TPC100500011);
}
message.setKeys(key);
message.setTopic(topic);
message.setTags(tag);
return message;
}
/**
* Instantiates a new Mq message.
*
* @param topic the topic
* @param tag the tag
* @param key the key
* @param body the body
*/
public MqMessage(String topic, String tag, String key, String body) {
this.topic = topic;
this.tag = tag;View on GitHub (pinned to 781281a950)