公交属性设置被忽略

发布于 2025-01-25 05:01:30 字数 912 浏览 2 评论 0 原文

我有cxf.xml文件:

<beans ....

<cxf:bus>
    <cxf:features>
        <cxf:logging/>
    </cxf:features>
</cxf:bus>
</beans>

但是在某些操作期间,我遇到了错误:

org.apache.cxf.interceptor.Fault: Unmarshalling Error: Maximum Number of Child Elements limit (50000) Exceeded 

我发现它可以用org.apache.cxf.stax.maxchildelements值覆盖。因此,我首先尝试将org.apache.cxf.stax.maxchildlements = 120000在gradle中,在Idea grainments中不起作用,因此我修改了我的.xml文件,

<cxf:bus>
    <cxf:features>
        <cxf:logging/>
    </cxf:features>
    <cxf:properties>
        <entry key="org.apache.cxf.stax.maxChildElements" value="120000"/>
    </cxf:properties>
</cxf:bus>

但我目前都没有想法,但我目前没有想法,截至原因,此设置未被注册。

IM与库一起工作 cxf-rt-frontend-jaxws cxf-rt-transports-http 均在版本3.2.7上。

I had cxf.xml file:

<beans ....

<cxf:bus>
    <cxf:features>
        <cxf:logging/>
    </cxf:features>
</cxf:bus>
</beans>

but during some operations, i got error:

org.apache.cxf.interceptor.Fault: Unmarshalling Error: Maximum Number of Child Elements limit (50000) Exceeded 

and I found out that it can be overridden with org.apache.cxf.stax.maxChildElements value. So i first tried putting org.apache.cxf.stax.maxChildElements=120000 in gradle, in IDEA arguments, which didnt work, so i modified my .xml file like this:

<cxf:bus>
    <cxf:features>
        <cxf:logging/>
    </cxf:features>
    <cxf:properties>
        <entry key="org.apache.cxf.stax.maxChildElements" value="120000"/>
    </cxf:properties>
</cxf:bus>

but none of this worked, and I am currently without ideas, as of why this setting is not getting registered.

Im working with libraries cxf-rt-frontend-jaxws and cxf-rt-transports-http both on version 3.2.7.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

白馒头 2025-02-01 05:01:31

您也可以尝试通过Java代码进行配置。

您可以获取用于创建 org.apache.cxf.endpoint.client 的总线实例:

    YourActual service = //return instance of your @WebService class by defining address & interpreter;
    Client client=ClientProxy.getClient(service);
    client.getBus().setProperty(StaxUtils.MAX_CHILD_ELEMENTS,120000)

或者,如果您拥有端点实现者,则可以做:

Bus bus=BusFactory.getDefaultBus();
bus.setProperty(StaxUtils.MAX_CHILD_ELEMENTS,120000);

Object implementor = <Your service implementation class>;
EndpointImpl ep = (EndpointImpl) Endpoint.publish(yourendpoint, implementor);
ep.setBus(bus);

上面是从 cxf doc doc

You can try doing configuration via java code as well.

You can get Bus instance which is used for creating your org.apache.cxf.endpoint.Client:

    YourActual service = //return instance of your @WebService class by defining address & interpreter;
    Client client=ClientProxy.getClient(service);
    client.getBus().setProperty(StaxUtils.MAX_CHILD_ELEMENTS,120000)

Or if you have your endpoint implementor then you can do :

Bus bus=BusFactory.getDefaultBus();
bus.setProperty(StaxUtils.MAX_CHILD_ELEMENTS,120000);

Object implementor = <Your service implementation class>;
EndpointImpl ep = (EndpointImpl) Endpoint.publish(yourendpoint, implementor);
ep.setBus(bus);

Above Bus configuration psudo-code taken from CXF doc.

天邊彩虹 2025-02-01 05:01:31

如果当您说“想法参数”时,您的意思是这个框(标记:程序参数)...

“在此处输入图像说明”

尝试启用修改选项 - &gt;添加VM选项

“在此处输入图像描述”

然后在标有VM选项的框中写入您的VM选项字符串。
尝试

-Dorg.apache.cxf.stax.maxChildElements=1000000

这可能会根据您的想法参数的意思而作用,也可能不起作用。我的想法忽略了许多尝试通过工作中的“程序参数”框传递到JVM的选项。希望这能解决您的问题。如果失败,我将尝试监视此线程。

If when you say "IDEA Arguments" you mean this box (labeled: Program Arguments)...

enter image description here

Try instead enabling Modify Options -> Add VM Options

enter image description here

Then write your VM Option string in the box labeled VM options.
try

-Dorg.apache.cxf.stax.maxChildElements=1000000

enter image description here

This may or may not work depending on what you meant by IDEA Arguments. I have had IDEA ignore many options that I have tried to pass to the JVM via the "Program Arguments" box at work. Hopefully this resolves your issue. If this fails, I will try to monitor this thread.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文