gpt4 book ai didi

java - XmlJavaTypeAdapter 并阐明?

转载 作者:行者123 更新时间:2023-12-01 15:48:49 25 4
gpt4 key购买 nike

我在我的项目上运行 Enunciate 时遇到了困难。该项目是一个多模块maven项目,可从https://svn.opentripplanner.org/trunk获取。我想要的只是 API 文档。没有其他的。我们曾经通过 Maven 和 Hudson 来实现此功能,但不久前它就坏了,而且设置它的人也不在。确实,我更喜欢通过命令行界面来完成此操作,但如果有人有 Maven 解决方案,我会接受。

我阐明的命令行是:

/home/novalis/otp/enunciate-1.23/bin/enunciate -v -f /home/novalis/otp/workspace/opentripplanner/opentripplanner-api-webapp/enunciate.xml `find /home/novalis/otp/workspace/opentripplanner/ -name *.java -type f |grep -v /test/`

我的 enunciate.xml 如下所示:

<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.17.xsd">
<services>
<rest>
<content-types>
<content-type type="text/plain" id="txt"/>
</content-types>
</rest>
</services>
<modules>
<c disabled="true"/>
<obj-c disabled="true"/>
<csharp disabled="true"/>
<jaxws-client disabled="true"/>
<docs title="OpenTripPlanner API"
base="src/main/resources/docs-theme"/>
</modules>
</enunciate>

我的阐明输出是:

initializing enunciate.
invoking enunciate:generate step...
error: Could not create declaration for annotation type Autowire
error: Could not create declaration for annotation type Component
error: Could not create declaration for annotation type Autowired
error: Could not create declaration for annotation type Required
4 errors
Exception in thread "main" org.codehaus.enunciate.contract.validation.ValidationException: /home/novalis/otp/workspace/opentripplanner/opentripplanner-routing/src/main/java/org/opentripplanner/routing/patch/StopNotePatch.java:58: stop: adapter org.opentripplanner.routing.patch.AgencyAndIdAdapter does not adapt AgencyAndId
at org.codehaus.enunciate.contract.jaxb.adapters.AdapterUtil.findAdapterType(AdapterUtil.java:134)
at org.codehaus.enunciate.contract.jaxb.adapters.AdapterUtil.findAdapterType(AdapterUtil.java:57)
[more traceback snipped]
<小时/>

AgencyAndIdAdapter确实适应AgencyAndId。当我运行它时,实际代码工作得很好。我尝试使用 XmlAdapter 构建一个小型测试用例来适应随机 Java 类(JPanel),并且它工作得很好。所以我不知道如何进一步减少问题。

我不认为有关 Autowire/Component/etc 的错误导致了这种情况,因为如果我排除包含这些注释的所有文件(|xargs grep -L 'Autowire|Component|Request' 就在结束反引号之前),我仍然收到错误的其余部分。不过,解决这些问题也很好。

最佳答案

关于java - XmlJavaTypeAdapter 并阐明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6540842/

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