本文介绍了使用arquillian + omnifaces运行测试时的java.util.ServiceConfigurationError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我收到以下错误

我已经提出了最基本的测试案例:

I have put the most basic test case I could here: https://www.dropbox.com/s/kou5v8kqs5g4g4m/test.zip?dl=0

推荐答案

尝试运行内置后战争并在Wildfly独立运行它,我设法将问题缩小到Arquillian,在测试Arquillian + Glassfish嵌入并运行没有问题后,我认为问题是Arquillian + Wildfly,更多的谷歌搜索,我发现类似的问题与使用嵌入Arquillian的Wildfly和使用Arquillian管理的Wildfly运行良好,我无法分辨的原因似乎有点像o f bug,但似乎也是在网上使用托管或远程容器进行Arquillian测试而不是嵌入式测试的一般建议。

After trying to run a built war and running it on Wildfly standalone, I managed to narrow the problem to Arquillian, after testing Arquillian+Glassfish embedded and running without problems, I figured the issue was Arquillian+Wildfly, some more googling around and I found similar issues that were related to using Wildfly embedded with Arquillian and that Wildfly managed with Arquillian runs well, the reason why I can't really tell seems like some sort of bug, but also seems like general advice on-line to use managed or remote containers for the Arquillian tests instead of the embedded ones.

所以解决方案非常简单删除了这个:

So the solution is really simple just removed this:

    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-arquillian-container-embedded</artifactId>
        <version>8.2.0.Final</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-embedded</artifactId>
        <version>8.2.0.Final</version>
        <scope>provided</scope>
    </dependency>

并添加:

    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-arquillian-container-managed</artifactId>
        <version>8.2.0.Final</version>
        <scope>test</scope>
    </dependency>

该解决方案最终没有使用嵌入Arquillian的Wildfly,而是进行了管理。

The solution ends up being not using Wildfly embedded with Arquillian, but managed instead.

这篇关于使用arquillian + omnifaces运行测试时的java.util.ServiceConfigurationError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 14:49