An internal error occurred during: "Building UI model". com/google/common/base/Function

在Eclipse Neon.2中安装STS(Spring Tool Suite)后创建项目时遇到问题,错误源于STS版本与Eclipse版本不一致。解决方法包括下载与Eclipse版本兼容的STS版本或在Eclipse内通过'Install new software'安装。避免错误信息'An internal error occurred during: "Building UI model". com/google/common/base/Function',无需安装TestNG插件。
An internal error occurred during: "Building UI model".  com/google/common/base/Function

Eclipse Neon.2 Release (4.6.2) 安装了 STS(Spring Tool Suite) 后,创建项目时遇到些问题。


错误原因:

STS 版本与 Eclipse 版本不匹配。

解决方法:

1、下载正确的版本进行安装:

/** * NOTE: This file has been copied and slightly modified from {com.alibaba.csp.sentinel.datasource.redis}. * <p> * <h2>Redis Datasource Task Elements Operation</h2> * * This class is a concrete implementation of a remote configuration data source, * built on top of Redis's high-performance read/write capabilities and Pub/Sub real-time * messaging mechanism. It enables dynamic loading, listening, and publishing of rule or * configuration data with low latency and strong consistency. * * <p>The primary design objectives are:</p> * * <ul> * <li><b>Real-time Updates</b>: Subscribes to a designated Redis Pub/Sub channel to detect * configuration changes immediately and trigger hot-reload events.</li> * <li><b>Deployment Flexibility</b>: Supports multiple Redis deployment modes including * standalone, Sentinel (for high availability), and Redis Cluster (for horizontal scaling).</li> * <li><b>Security Support</b>: Provides full SSL/TLS encryption support with compatibility for * both JKS and PEM certificate formats, meeting production security requirements.</li> * <li><b>Extensibility</b>: Extends {@link RemoteDatasourceTaskElementsOperation}, adhering to a unified * datasource abstraction contract. Can be seamlessly integrated into systems requiring * runtime reconfiguration, such as rule engines, policy managers, or distributed gateways.</li> * </ul> * * <h3>Working Principle</h3> * <p>During initialization, the class automatically selects the appropriate client based on * the provided {@link RedisConnectionConfig}: * <ul> * <li>If cluster nodes are configured, it creates a {@link RedisClusterClient}.</li> * <li>Otherwise, it uses a {@link RedisClient} for standalone or Sentinel mode connections.</li> * </ul> * * Additionally, it sets up a "lazy-loaded" subscription via {@link #setLazyListener(java.util.function.Supplier)} — * meaning the actual Pub/Sub connection and subscription occur only when an external system * explicitly requests listening (e.g., during startup of a configuration watcher). * This lazy initialization strategy reduces resource consumption and improves application startup time. * * <h3>Key Method Overview</h3> * <table border="1" cell-padding="8"> * <tr><th>Method</th><th>Purpose</th></tr> * <tr> * <td>{@link #getRemoteConfigInfo()}</td> * <td>Retrieves the current configuration value associated with {@code ruleKey} from Redis (via GET)</td> * </tr> * <tr> * <td>{@link #publishConfig(String)}</td> * <td>Publishes new configuration data to Redis (via SET), typically used to broadcast updates</td> * </tr> * <tr> * <td>{@link #subscribeFromChannel(String)}</td> * <td>Establishes a Pub/Sub connection and subscribes to a specific channel; incoming messages * are dispatched through {@link DelegatingRedisPubSubListener}</td> * </tr> * <tr> * <td>{@link #close()}</td> * <td>Gracefully shuts down the Redis client and releases all underlying resources</td> * </tr> * </table> * * <h3>Typical Use Cases</h3> * <ul> * <li>Dynamic rule loading in rule engines (e.g., Drools, Easy Rules)</li> * <li>Hot-reloading of distributed configurations in microservices</li> * <li>Real-time policy or permission updates in access control systems</li> * <li>Centralized rate-limiting or circuit-breaker configuration management</li> * </ul> * <h3>Example Usage</h3> * <pre>{@code * RedisConnectionConfig config = new RedisConnectionConfig(); * config.setHost("localhost"); * config.setPort(6379); * config.setTimeout(5000); * * RedisDatasourceTaskElementsOperation redisSource = * new RedisDatasourceTaskElementsOperation(config, "rule:flow", "channel:rule-update", ConfigFormat.JSON); * * // Retrieve current configuration * String currentConfig = redisSource.getRemoteConfigInfo(); * * // Start listening (triggers lazy subscription) * redisSource.startListen(); * * // Publish new config (other instances will receive notification) * redisSource.publishConfig("{\"rateLimit\": 1000}"); * * // Clean up resources * redisSource.close(); * }</pre> * * @author <a href="mailto:929160069@qq.com">zhangpengfei</a> * @since 3.0.2 */ 编译报错 [ERROR] /Users/zhangpengfei/workspace/assembly/assembly-simplified-cron/cron-redis-datasource-driven-scheduled/src/main/java/top/osjf/cron/datasource/driven/scheduled/redis/RedisDatasourceTaskElementsOperation.java:97: 错误: 此处不允许使用标记: <tr> [ERROR] * <tr>
最新发布
11-20
你遇到的编译错误: ``` [ERROR] 错误: 此处不允许使用标记: <tr> [ERROR] * <tr> ``` 虽然你在 Javadoc 中使用了 `<table>` 标签包裹 `<tr>`,但仍然报错,**原因在于 Javadoc 的 `-Xdoclint`(文档检查工具)在较新版本的 JDK(如 JDK 8u40+、JDK 9+)中默认启用,会对 HTML 合法性进行严格校验**。即使结构看似正确,只要存在轻微不符合 HTML 规范的地方,就会导致编译失败。 --- ### ✅ 问题定位 你的代码中这段是关键: ```java <table border="1" cell-padding="8"> <tr><th>Method</th><th>Purpose</th></tr> ... </table> ``` 问题出在属性名拼写错误: 👉 `cell-padding` 是 **无效的 HTML 属性**,正确的属性是 `cellpadding`(无连字符)! 所以这行: ```html <table border="1" cell-padding="8"> ``` 应改为: ```html <table border="1" cellpadding="8"> ``` 此外,建议加上 `summary` 或 `role="presentation"` 以满足无障碍和语义化要求(可选但推荐)。 --- ### ✅ 解决方案 将错误的 `cell-padding` 改为 `cellpadding`,并确保所有标签闭合、嵌套合法。 #### ✅ 修复后的 Javadoc 示例片段: ```java /** * ... * <h3>Key Method Overview</h3> * <table border="1" cellpadding="8" summary="Description of key methods in RedisDatasourceTaskElementsOperation"> * <tr> * <th>Method</th> * <th>Purpose</th> * </tr> * <tr> * <td>{@link #getRemoteConfigInfo()}</td> * <td>Retrieves the current configuration value associated with {@code ruleKey} from Redis (via GET)</td> * </tr> * <tr> * <td>{@link #publishConfig(String)}</td> * <td>Publishes new configuration data to Redis (via SET), typically used to broadcast updates</td> * </tr> * <tr> * <td>{@link #subscribeFromChannel(String)}</td> * <td>Establishes a Pub/Sub connection and subscribes to a specific channel; incoming messages * are dispatched through {@link DelegatingRedisPubSubListener}</td> * </tr> * <tr> * <td>{@link #close()}</td> * <td>Gracefully shuts down the Redis client and releases all underlying resources</td> * </tr> * </table> * ... */ ``` --- ### 🔍 其他可能导致 Javadoc 报错的原因(补充建议) | 问题 | 建议 | |------|------| | 缺少 `</th>` 或 `</td>` 等闭合标签 | 所有标签必须成对出现或自闭合 | | 使用了非标准标签如 `<br>` 应写为 `<br />` | XML 风格更安全 | | 特殊字符未转义,如 `<`, `>` | 使用 `{@code ...}` 包裹代码或用 `<`, `>` | | 表格缺少 `<th>`/`<tr>` 结构 | 必须完整 | 例如,更好的写法是: ```java <td>{@code redisSource.publishConfig("{\"rateLimit\": 1000}")}</td> ``` 而不是直接写 JSON 字符串中的 `{}` 被误解析。 --- ### 🛠 如何临时关闭 doclint(不推荐生产环境) 如果你只是想快速跳过验证(开发阶段),可在 Maven 的 `pom.xml` 中添加: ```xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.11.0</version> <configuration> <source>8</source> <target>8</target> <encoding>UTF-8</encoding> <compilerArgs> <arg>-Xdoclint:none</arg> </compilerArgs> </configuration> </plugin> ``` 但这会失去文档质量保障,**建议修复而非关闭检查**。 --- ### ✅ 总结 - ❌ `cell-padding` 是非法属性 → 改为 `cellpadding` - ✅ 使用合法 HTML 标签结构,尤其是表格必须包含 `<table>`、`<tr>`、`<th>`/`<td>` - ✅ 所有标签必须闭合,避免遗漏 `</tr>`、`</td>` 等 - ✅ 推荐使用 `{@code ...}` 来展示代码片段,防止 `< >` 被解析为 HTML - ✅ 不要禁用 `-Xdoclint`,而应修正文档格式提升代码质量 ---
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值