首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >XmlJavaTypeAdapter和发音?

XmlJavaTypeAdapter和发音?
EN

Stack Overflow用户
提问于 2011-06-30 20:38:44
回答 1查看 1.2K关注 0票数 0

我很难就我的项目发表意见。该项目是一个多模块的maven项目,可从https://svn.opentripplanner.org/trunk获得。我想要的只是API文档。没别的了。我们曾经通过Maven和Hudson让它工作,但是它在一段时间前就坏了,而设置它的人是不可用的。实际上,我更愿意通过命令行接口来实现这一点,但是如果有人有Maven解决方案,我就接受它。

我的命令行是:

代码语言:javascript
复制
/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看起来是这样的:

代码语言:javascript
复制
<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> 

我宣布的输出是:

代码语言:javascript
复制
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的错误会导致这种情况,因为如果我排除了所有包含这些注释的文件(在结束回勾之前,grep -L‘Autowire Request’‘Autowire Request’‘),那么我仍然会得到其余的错误。尽管如此,修复这些问题也是件好事。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-08 23:54:09

请参阅附于以下各点的贴片:

http://codehaus.markmail.org/thread/xuyzbe7aigitj5vj

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

https://stackoverflow.com/questions/6540842

复制
相关文章

相似问题

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