Java.util.ServiceConfigurationError when running tests using arquillian + omnifaces

I get the following error

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

when running Arquillian tests.

I set the simplest test example here: https://www.dropbox.com/s/kou5v8kqs5g4g4m/test.zip?dl=0

+6
source share
1 answer

After trying to launch the built-in war and running it offline, Wildfly managed to narrow the problem down to Arkillian, after I tested Arquillian + Glassfish without any problems, I realized that the problem was Arquillian + Wildfly, and I found similar problems related using the Wildfly built into Arquillian and that Wildfly works with Arquillian works well, the reason I really can’t say seems like some kind of mistake, but it also seems like general advice online to use managed or remote containers for dough Arquillian instead built.

So the solution is really simple, just deleted 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> 

and added the following:

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

The solution ends up not using Wildfly built-in with Arquillian, but managed instead.

+7
source

Source: https://habr.com/ru/post/989037/


All Articles