Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

On uploading: `Exception in thread "Thread-5" java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is null`

未关闭
#176 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
java
领域
api

调研方向

从 MediaFileUtils.uploadFile 第 349 行开始,跟踪请求进入 ApiConnection.getQueryString 第 588 行;stack trace 显示 null 值到达了 URL 编码过程。使用报告中的 OpenRefine 3.9.3 和 CommonsExtension 0.1.3 配置复现 Commons 上传,然后确定缺少哪个上传输入,并验证该失败会被处理或阻止。

由索引模型根据 Issue 内容生成。

描述

Exception in thread "Thread-5" java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is null
	at java.base/java.net.URLEncoder.encode(URLEncoder.java:223)
	at java.base/java.net.URLEncoder.encode(URLEncoder.java:194)
	at org.wikidata.wdtk.wikibaseapi.ApiConnection.getQueryString(ApiConnection.java:588)
	at org.wikidata.wdtk.wikibaseapi.ApiConnection.sendRequest(ApiConnection.java:434)
	at org.wikidata.wdtk.wikibaseapi.ApiConnection.sendJsonRequest(ApiConnection.java:399)
	at org.openrefine.wikibase.editing.MediaFileUtils.uploadFile(MediaFileUtils.java:349)
	at org.openrefine.wikibase.editing.MediaFileUtils.uploadRemoteFile(MediaFileUtils.java:254)
	at org.openrefine.wikibase.updates.MediaInfoEdit.uploadFile(MediaInfoEdit.java:288)
	at org.openrefine.wikibase.editing.EditBatchProcessor.performEdit(EditBatchProcessor.java:232)
	at org.openrefine.wikibase.operations.PerformWikibaseEditsOperation$PerformEditsProcess.run(PerformWikibaseEditsOperation.java:334)
	at java.base/java.lang.Thread.run(Thread.java:1583)

OpenRefine 3.9.3
CommonsExtension 0.1.3

java --version
openjdk 21.0.6 2025-01-21 LTS
OpenJDK Runtime Environment Temurin-21.0.6+7 (build 21.0.6+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.6+7 (build 21.0.6+7-LTS, mixed mode, sharing)

Maybe this is because my schema is invalid? Is it a correct way to upload changes back to Commons?

Image

Image

主要语言
Java
星标
30
派生
12
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenRefine/CommonsExtension 的其他 Issue

查看 OpenRefine/CommonsExtension 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。