首页 > 解决方案 > 为什么 Install4j 无法解析带有 SAXParseException 的 updates.xml 文件?

问题描述

我是 install4j 和 stackoverflow 的新手,所以如果我的 qustion 结构不正确,我很抱歉。

我们使用的是 install4j 版本 6.1.2(内部版本 6275)。当我们的应用程序启动时,install4j auto update 在检查更新时收到以下错误,并且没有执行更新(应用程序使用旧版本启动):

[ERROR] com.install4j.runtime.beans.actions.update.CheckForUpdateAction [ID 322]: could not download file
        java.io.IOException
java.io.IOException
        at com.install4j.runtime.installer.helper.XmlHelper.createIoException(XmlHelper.java:307)
        at com.install4j.runtime.installer.helper.XmlHelper.parse(XmlHelper.java:90)
        at com.install4j.runtime.installer.helper.XmlHelper.parseFile(XmlHelper.java:44)
        at com.install4j.runtime.installer.helper.XmlHelper.parseFile(XmlHelper.java:40)
        at com.install4j.runtime.installer.config.update.UpdateDescriptorImpl.read(UpdateDescriptorImpl.java:73)
        at com.install4j.runtime.beans.actions.update.CheckForUpdateAction.execute(CheckForUpdateAction.java:38)
        at com.install4j.runtime.beans.actions.SystemInstallOrUninstallAction.install(SystemInstallOrUninstallAction.java:29)
        at com.install4j.runtime.installer.ContextImpl$7.executeAction(ContextImpl.java:1668)
        at com.install4j.runtime.installer.ContextImpl$7.fetchValue(ContextImpl.java:1659)
        at com.install4j.runtime.installer.ContextImpl$7.fetchValue(ContextImpl.java:1656)
        at com.install4j.runtime.installer.helper.comm.actions.FetchObjectAction.execute(FetchObjectAction.java:14)
        at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionDirect(HelperCommunication.java:272)
        at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionInt(HelperCommunication.java:247)
        at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionChecked(HelperCommunication.java:185)
        at com.install4j.runtime.installer.helper.comm.HelperCommunication.fetchObjectChecked(HelperCommunication.java:168)
        at com.install4j.runtime.installer.ContextImpl.performActionIntStatic(ContextImpl.java:1656)
        at com.install4j.runtime.installer.InstallerContextImpl.performActionInt(InstallerContextImpl.java:151)
        at com.install4j.runtime.installer.ContextImpl.performAction(ContextImpl.java:1103)
        at com.install4j.runtime.installer.controller.Controller.executeAction(Controller.java:367)
        at com.install4j.runtime.installer.controller.Controller.executeActions(Controller.java:333)
        at com.install4j.runtime.installer.controller.Controller.handleCommand(Controller.java:194)
        at com.install4j.runtime.installer.controller.Controller.start(Controller.java:94)
        at com.install4j.runtime.installer.Application.runApplication(Application.java:71)
        at com.install4j.runtime.installer.Application.runApplicationInProcess(Application.java:52)
        at com.install4j.runtime.installer.helper.apiimpl.ApplicationLauncherImpl$1.run(ApplicationLauncherImpl.java:39)
        at com.install4j.runtime.installer.helper.apiimpl.ApplicationLauncherImpl.launchApplicationInProcess(ApplicationLauncherImpl.java:46)
        at com.install4j.api.launcher.ApplicationLauncher.launchApplicationInProcess(ApplicationLauncher.java:58)
        at com.install4j.runtime.launcher.LauncherIntegration$2.run(LauncherIntegration.java:110)
        at com.install4j.runtime.launcher.LauncherIntegration.processLauncherIntegration(LauncherIntegration.java:114)
        at com.install4j.runtime.launcher.LauncherIntegration.processLauncherIntegrations(LauncherIntegration.java:58)
        at com.install4j.runtime.launcher.LauncherIntegration.processLauncherIntegrations(LauncherIntegration.java:51)
        at com.install4j.runtime.launcher.LauncherIntegration.checkIntegrations(LauncherIntegration.java:38)
        at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Users/.../AppData/Local/Temp/i4jupd5100269909742792694.xml; lineNumber: 1; columnNumber: 50; White spaces are required between publicId and systemId.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at com.install4j.runtime.installer.helper.XmlHelper.parse(XmlHelper.java:88)
        ... 31 more
        Execute action not successful after 61 ms
[INFO] com.install4j.runtime.beans.screens.CustomizableProgressScreen [ID 320]: Canceled

我们的 updates.xml 文件以以下行开头:

<?xml version="1.0" encoding="UTF-8"?>

我们有多个部署环境,它们对同一应用程序使用相同的 install4j 版本,但使用不同的部署目标和版本号。自动更新在大多数这些环境中都能正常工作,并且这些环境中的 updates.xml 文件以与存在此问题的环境相同的行开头。

我不认为这是相关的,但以防万一,正常工作的环境使用内部托管的站点。失败的环境是 AWS 托管站点。

编辑:

日志中列出的文件不存在。但似乎其他尝试留下了 i4jupd*.xml 文件,每个文件都是 HTML 格式,表明 updates.xml 文件被移动到“这里”

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://.../updates.xml">here</a>.</p>
</body></html>

谢谢你的时间!

标签: install4jauto-updatesaxparseexception

解决方案


推荐阅读