gpt4 book ai didi

java - 在开发模式中看到 Twig Load 错误,但在 GAME 中没有

转载 作者:行者123 更新时间:2023-12-04 05:58:45 25 4
gpt4 key购买 nike

尝试使用 Twig(见下文)加载时,我在本地开发模式中看到了我们在 Live GAE 中看不到的异常。

我的同事也没有看到它,但我们有相同的开发设置
(虽然他在 Mac 上运行)

它失败的项目是 ArrayList<ContactStatus>在哪里ContactStatus是一个简单的枚举(见下文),这是模型
宣言

List<ContactStatus> contactStatuses = new ArrayList<ContactStatus>();

所以据我所知,这应该是开箱即用的吗?

@Child需要注释等吗? (确实添加 @Embedded 似乎
导致问题 35: http://code.google.com/p/twig-persist/issues/detail?id=35 )

当我运行调试 session 时,这似乎失败了,因为 ArrayList不实现 Comparable (因为 Enum 总是如此)

我们做错了什么?!

版本
  • Java 7
  • Twig 2.0-beta3
  • AppEngine 1.6.2.1
  • GWT 2.4.0

  • 枚举
    public enum ContactStatus implements IsSerializable, Serializable {
    Public, Secret, Blocked, Ignored;
    }

    我们在开发模式中看到的异常
    java.lang.IllegalArgumentException: Cannot compare [SimpleProperty value=[Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored] path=contactStatuses indexed=false] with [SimpleProperty value=[Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Blocked, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored, Ignored] path=contactStatuses indexed=false]
    at com.google.code.twig.util.PropertyComparator.compare(PropertyComparator.java:23)
    at com.google.code.twig.util.PropertyComparator.compare(PropertyComparator.java:7)
    at java.util.TreeMap.compare(TreeMap.java:1188)
    at java.util.TreeMap.put(TreeMap.java:531)
    at java.util.TreeSet.add(TreeSet.java:255)
    at java.util.AbstractCollection.addAll(AbstractCollection.java:334)
    at java.util.TreeSet.addAll(TreeSet.java:312)
    at com.google.code.twig.standard.StandardDecodeCommand.entityToInstance(StandardDecodeCommand.java:60)
    at com.google.code.twig.standard.StandardDecodeCommand.keyToInstance(StandardDecodeCommand.java:127)
    at com.google.code.twig.standard.StandardSingleTypedLoadCommand.keyToInstance(StandardSingleTypedLoadCommand.java:9)
    at com.google.code.twig.standard.StandardSingleTypedLoadCommand.now(StandardSingleTypedLoadCommand.java:34)
    at com.google.code.twig.standard.TranslatorObjectDatastore.load(TranslatorObjectDatastore.java:202)
    at com.recruitmentlink.server.persistence.twig.TwigProfileImpl.getExistingCandidate(TwigProfileImpl.java:92)

    最佳答案

    这是 John Patterson 对这个问题和相关代码“修复”的( super 快速)回复,该代码“修复”抑制了这种不必要的“异常”

    http://groups.google.com/group/twig-persist/browse_frm/thread/81b7d913a2ad37cc#

    该问题仅影响使用 Java 7 的人。

    由于 GAE 部署运行的是 Java 6,因此我们没有在现场看到问题。

    关于java - 在开发模式中看到 Twig Load 错误,但在 GAME 中没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9186492/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com