gpt4 book ai didi

java - maven cxf-codegen-plugin XMLStreamException 错误 : Attribute limit

转载 作者:行者123 更新时间:2023-12-01 19:41:55 25 4
gpt4 key购买 nike

我正在使用 maven cxf-codegen-plugin 为一个非常大的 WSDL 生成客户端,以下是配置示例:

   <plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf-version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<!--sourceRoot>${project.build.directory}/generated/cxf</sourceRoot-->
<sourceRoot>${project.basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${project.basedir}/src/main/resources/wsdl/PDT.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/PDT.wsdl</wsdlLocation>
<extendedSoapHeaders>true</extendedSoapHeaders>
<autoNameResolution>true</autoNameResolution>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>

当我尝试生成客户端时,我收到此错误:

Exception in thread "main" org.apache.cxf.tools.common.ToolException: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition file:/src/main/resources/wsdl/PDT.wsdl: WSDLException: faultCode=PARSER_ERROR: javax.xml.stream.XMLStreamException: Attribute limit (500) exceeded

是否有办法将 maven 插件中的属性限制更改为大于 500 的值?

最佳答案

我刚刚找到了答案,link您可以覆盖“org.apache.cxf.stax.maxAttributeCount=500”,在 Maven cxf 插件中设置系统 java 属性,如下所示:

<configuration>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf-version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<!--sourceRoot>${project.build.directory}/generated/cxf</sourceRoot-->
<sourceRoot>${project.basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${project.basedir}/src/main/resources/wsdl/PDT.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/PDT.wsdl</wsdlLocation>
<extendedSoapHeaders>true</extendedSoapHeaders>
<autoNameResolution>true</autoNameResolution>
</wsdlOption>
</wsdlOptions>
<additionalJvmArgs>-Dorg.apache.cxf.stax.maxAttributeCount=5000</additionalJvmArgs>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>

关于java - maven cxf-codegen-plugin XMLStreamException 错误 : Attribute limit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59166287/

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