gpt4 book ai didi

maven - XJC 生成错误 : can't parse argument number

转载 作者:行者123 更新时间:2023-12-04 18:03:43 26 4
gpt4 key购买 nike

尝试从 wsdl 生成类时出现以下错误:

Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate (CreateWebServiceAccountV1) on project hblws.test: Execution CreateWebServiceAccountV1 of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate failed: can't parse argument number: ''http://java.sun.com/xml/ns/jaxb'': For input string: "''http://java.sun.com/xml/ns/jaxb''" -> [Help 1]



我有一个 wsdl 文件和多个 XSD/XJB。 XJB 有以下命名空间: xmlns="http://java.sun.com/xml/ns/jaxb"

下面是执行 JAXB/XJC 生成的 pom.xml 代码:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<executions>
<!-- CreateWebServiceAccount V1 -->
<execution>
<id>CreateWebServiceAccountV1</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourceDestDir>
${project.build.directory}/generated-sources
</sourceDestDir>
<wsdlFiles>
<wsdlFile>CreateWebServiceAccountV1.wsdl</wsdlFile>
</wsdlFiles>
<wsdlDirectory>${basedir}/src/main/webapp/WEB-INF/wsdl/</wsdlDirectory>
<verbose>true</verbose>
<bindingFiles>
<bindingFile>${basedir}/src/main/webapp/META-INF/wsdl/CreateWebServiceAccountV1.xjb</bindingFile>
<bindingFile>${basedir}/src/main/webapp/META-INF/wsdl/CreateWebServiceAccountV1Model.xjb</bindingFile>
<bindingFile>${basedir}/src/main/webapp/META-INF/wsdl/SystemFault-v1.xjb</bindingFile>
</bindingFiles>
<staleFile>${project.build.directory}/jaxws/stale/wsdl.CreateWebServiceAccountV1.done</staleFile>
<schemaDirectory>${basedir}/src/main/webapp/META-INF/wsdl/</schemaDirectory>
</configuration>
</execution>
</executions>
</plugin>

在此先感谢您的帮助 !

最佳答案

这是JDK的一个bug,见JDK-8204933 .
解决方案 , 将区域设置更改为 zh ,其他人将失败:

<configuration>
<locale>en</locale>
<configuration>

The English (and portuguese) version correctly quote, all other localizations replace this with the faulty


对我来说,这个插件告诉我真正的原因:

org.xml.sax.SAXParseException: not an external binding file. The root element must be {http://java.sun.com/xml/ns/jaxb}bindings but it is {https://java.sun.com/xml/ns/jaxb}bindings

关于maven - XJC 生成错误 : can't parse argument number,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30894983/

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