使用arquillian + omnifaces运行测试时的java.util.ServiceConfigurationError [英] java.util.ServiceConfigurationError when running tests using arquillian+omnifaces

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

问题描述

我收到以下错误


java.util.ServiceConfigurationError:
javax.servlet.ServletContainerInitializer:Provider
org.omnifaces.ApplicationInitializer在运行Arquillian测试时未找到

"java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.omnifaces.ApplicationInitializer not found"

我已经提出了最基本的测试案例: https:// www。 dropbox.com/s/kou5v8kqs5g4g4m/test.zip?dl=0

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆