XJC 生成错误:无法解析参数号

Gon*_*_09 5 wsdl xjc jaxb2 maven

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

无法在项目 hblws.test 上执行目标 org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate (CreateWebServiceAccountV1):目标 org.jvnet.jaxb2.maven2:maven-jaxb2-plugin 的执行 CreateWebServiceAccountV1: 0.12.3:生成失败:无法解析参数号:'' http://java.sun.com/xml/ns/jaxb '':对于输入字符串:“'' http://java.sun.com /xml/ns/jaxb ''" -> [帮助 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>
Run Code Online (Sandbox Code Playgroud)

在此先感谢您的帮助 !

小智 4

这是 JDK\xef\xbc\x8csee JDK-8204933的错误。

\n

解决方案,将 locale 更改为en,其他都会失败:

\n
<configuration>\n   <locale>en</locale>\n<configuration>\n
Run Code Online (Sandbox Code Playgroud)\n
\n

英语(和葡萄牙语)版本正确引用\n,所有其他本地化版本都将其替换为错误的

\n
\n

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

\n
\n

org.xml.sax.SAXParseException:不是外部绑定文件。根元素必须是 {http://java.sun.com/xml/ns/jaxb}bindings 但它是 {https://java.sun.com/xml/ns/jaxb}bindings

\n
\n