【问题标题】:cvc-complex-type.2.4.a: Invalid content was found starting with element 'threadsafe'cvc-complex-type.2.4.a:发现以元素“线程安全”开头的无效内容
【发布时间】:2014-01-19 20:55:06
【问题描述】:
<?xml version="1.0" encoding="utf-8"?>

<appengine-web-app
    xmlns="http://appengine.google.com/ns/1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
    http://appengine.google.com/ns/1.0
    http://googleappengine.googlecode.com/svn/branches/1.2.1/java/docs/appengine-web.xsd">

    <application>studio-101062123</application>
    <version>release4960</version>

    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/classes/java/util/logging/logging.properties" />
    </system-properties>

    <sessions-enabled>true</sessions-enabled>
    <threadsafe>true</threadsafe>

</appengine-web-app>

为什么会出现这样的错误

cvc-complex-type.2.4.a:发现以元素“线程安全”开头的无效内容。

相同的代码在另一台计算机上没有错误。

【问题讨论】:

    标签: xml thread-safety


    【解决方案1】:

    查看http://googleappengine.googlecode.com/svn/branches/1.2.1/java/docs/appengine-web.xsdthreadsafe 元素无效。您的另一台机器可能无法获取此 xsd,或者它没有使用 xsd 验证 xml。

    【讨论】:

      【解决方案2】:

      您使用的是旧版本的 appengine-api-sdk。

      如果你使用的是 maven,我认为你应该使用这个依赖项:

          <dependency>
              <groupId>com.google.appengine</groupId>
              <artifactId>appengine-api-1.0-sdk</artifactId>
              <version>1.9.13</version>
              <scope>provided</scope>
          </dependency>
      

      对于未来的观众,请参阅 maven repo 上的此页面以获取最新版本(假设尚未创建 2.0):

      http://mvnrepository.com/artifact/com.google.appengine/appengine-api-1.0-sdk

      如果这不起作用,请将其用作 appengine-web.xml 中的根级标记:

      <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://appengine.google.com/ns/1.0
          http://googleappengine.googlecode.com/svn/branches/1.9.13/java/docs/appengine-web.xsd">
      
              ...
      
      </appengine-web-app>
      

      同样,您可能需要将“1.9.13”替换为最新版本号。

      【讨论】:

        猜你喜欢
        • 2018-03-04
        • 1970-01-01
        • 1970-01-01
        • 2020-10-31
        • 2011-07-07
        • 2019-01-26
        • 2018-12-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多