- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试通过 hyperjaxb 运行一个真实的模式。我已经使用 jaxb 反复测试了模式,并且 jaxb 每次都正确地导入了模式。但是,当我尝试让 hyperjaxb 从同一模式生成带 hibernate 注释的 java 类时,出现以下错误:
[ERROR] Error while parsing schema(s).Location [ file:/C:/path/to/src/main/resources/schema.xsd{4,32}].
org.xml.sax.SAXParseException; systemId: file:/C:/path/to/src/main/resources/schema.xsd;
lineNumber: 4; columnNumber: 32;
Using "http://annox.dev.java.net" customizations requires the "-Xannotate" switch
to enable this plug-in.
我用谷歌搜索了这个错误消息并阅读了其他关于它的帖子,但没有找到任何清晰的解决方法。我找到的最接近的是 this article ,它表示 annox 插件 由 -Xannotate 命令行参数激活
。
我读了this link , 但将以下内容添加到 xsd 文件并没有消除错误,可能是因为 xsd
没有在任何地方使用 jaxb
前缀。
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
jaxb:version="2.1"
xmlns:annox="http://annox.dev.java.net"
jaxb:extensionBindingPrefixes="annox"
我已上传包含所有相关 Material 的 zip 文件以快速重现问题 to this link .它是包含预期架构的项目的 zip 文件。重现问题所需要做的就是将命令行导航到解压缩项目的根目录,然后键入 mvn clean install
以重现错误。
我该如何解决这个错误?
我已经尝试将以下内容添加到 pom.xml 中的插件配置中,但到目前为止还没有成功。
<args>
<arg>-Xannotate</arg>
</args>
我在pom.xml
中添加了@lexicore的建议,但是结果是一个空指针异常
,你可以阅读by clicking on this link .为了促进其他人更轻松地使用 hyperjaxb
,我包含了完整的当前 pom.xml
at this link .这个修改后的 pom.xml
和上面的 zip 文件一起足以在几分钟内重现问题。这是配置问题还是错误?
最佳答案
为了新用户的兴趣,我现在将回答这个具体问题。
如果您看到报告的错误:
Using "http://annox.dev.java.net" customizations requires the "-Xannotate"
switch to enable this plug-in.
这意味着,嗯,您必须包含“-Xannotate”开关才能启用此插件。请参阅首页上的文档 jaxb2-annotate-plugin
:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<configuration>
<extension>true</extension>
<args>
<arg>-Xannotate</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
</plugin>
<!-- Add the dependencies with your annotations as 'plugins' below -->
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-annotate-plugin-test-annox-annotations</artifactId>
</plugin>
</plugins>
</configuration>
</plugin>
看到 -Xannotate
开关了吗?就是这个。
jaxb2-annotate-plugin
可以以相同的方式与 maven-hyperjaxb3-plugin
一起使用。这是一个 an example来自 Hyperjaxb tests :
<plugin>
<groupId>org.jvnet.hyperjaxb3</groupId>
<artifactId>maven-hyperjaxb3-plugin</artifactId>
<configuration>
<postArgs>
<arg>-Xannotate</arg>
</postArgs>
</configuration>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
<version>3.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
</dependencies>
</plugin>
(您不需要包含 jaxb2-annotate-plugin
,因为它已经被 maven-hyperjaxb3-plugin
自动包含。)
关于java - "http://annox.dev.java.net"自定义需要 "-Xannotate"开关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26430199/
我在用于 jaxb 生成的 annox 插件上收到以下错误 [ERROR] file:/Users/dhiller/Space/ifp-core/framework/src/main/resource
我在 JAXB 生成的类中有以下注释 @XmlType(name = "MessageInfoType", propOrder = { "debugTraceBoolean", "cl
我在让 JAXB 绑定(bind)文件与 annox 和 SCD 元素选择一起使用时遇到困难。该模式是一个简单的基本模式,具有名为 SongType 的 ComplexType。我尝试了正常的方法做如
我对注释的使用场景有点困惑,我希望得到您的意见。 给定以下注释(与 ExistingCustomerValidator 类在同一项目中定义)包 com.tktserver.constraints; @
我正在尝试通过 hyperjaxb 运行一个真实的模式。我已经使用 jaxb 反复测试了模式,并且 jaxb 每次都正确地导入了模式。但是,当我尝试让 hyperjaxb 从同一模式生成带 hiber
当我将 jxb:class 与 annox:annotate 一起使用时,出现此异常: com.sun.istack.SAXParseException2; systemId: file:/usr/w
我正在尝试使用 jaxb2 maven 插件从 xsd 生成 Java 类。 生成类时出现以下异常: SAXParseException Binding declaration namespace "
我是一名优秀的程序员,十分优秀!