首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >连接到bugzilla服务器时无法解析loose.dtd

连接到bugzilla服务器时无法解析loose.dtd
EN

Stack Overflow用户
提问于 2016-05-25 14:48:12
回答 1查看 216关注 0票数 0

我试图使用xmlrpc连接到bugzilla服务器,但是在解析http://www.w3.org/TR/html4/loose.dtd时会出现错误。我见过其他解决方案,但据我所知,这些都是服务器端解决方案。服务器不是我的。有什么办法可以解决这个客户方面的问题吗?

代码语言:javascript
复制
[Fatal Error] loose.dtd:31:3: The declaration for the entity "HTML.Version" must end with '>'.
Exception in thread "main" org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse server's response: The declaration for the entity
 "HTML.Version" must end with '>'.
...
Caused by: org.xml.sax.SAXParseExceptionpublicId: -//W3C//DTD HTML 4.01 Transitional//EN; systemId: http://www.w3.org/TR/html4/loose.dtd; li
neNumber: 31; columnNumber: 3; The declaration for the entity "HTML.Version" must end with '>'.
...
Caused by:
org.xml.sax.SAXParseExceptionpublicId: -//W3C//DTD HTML 4.01 Transitional//EN; systemId: http://www.w3.org/TR/html4/loose.dtd; lineNumber: 3
1; columnNumber: 3; The declaration for the entity "HTML.Version" must end with '>'.
...

下面是生成错误的相关修改scala代码。

代码语言:javascript
复制
import org.apache.xmlrpc.client.XmlRpcClient
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl
import java.net.URL

import scala.collection.JavaConverters._

object BugzillaHello {

  val portal = new URL("http://company.domain.com/bugzilla/xmlrpc.cgi")

  def main(args: Array[String]): Unit = {

    val config = new XmlRpcClientConfigImpl()
    config.setServerURL(portal)
    config.setEnabledForExtensions(true)

    val client = new XmlRpcClient()
    client.setConfig(config)

    val cred = Map("login" -> "my username", "password" -> "my password").asJava
    val result = client.execute("User.login", Array[Object](cred))
    println("Result = " + result)
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-06-02 14:14:57

它不应该为HTML文件服务,而是因为没有启用xlmrpc。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37440652

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档