hi rafael, once you enable myfaces-test as external-container, omnifaces gets loaded as well (if it's on the test-classpath). it looks like that not everything (which is required by omnifaces) is on your test-classpath. however, even after adding the missing part/s you will get issues due to the implementation of org.omnifaces.config.BeanManager (since it just works once you have a proper jndi-setup).
regards, gerhard http://www.irian.at Your JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces, DeltaSpike and OpenWebBeans 2015-04-04 4:12 GMT+02:00 Rafael Pestano <[email protected]>: > Hi guys, > > I'm facing an issue with myfaces test and omnifaces, as soon i add > omnifaces 2.0 dependency I got the error when running tests (driven by ds > test control): > > java.lang.NoClassDefFoundError: Could not initialize class > org.omnifaces.config.BeanManager > at > org.omnifaces.application.OmniApplication.<init>(OmniApplication.java:69) > at > > org.omnifaces.application.OmniApplicationFactory.createOmniApplication(OmniApplicationFactory.java:88) > at > > org.omnifaces.application.OmniApplicationFactory.getApplication(OmniApplicationFactory.java:54) > at > > org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:172) > at > > org.apache.myfaces.webapp.AbstractFacesInitializer._dispatchApplicationEvent(AbstractFacesInitializer.java:329) > at > > org.apache.myfaces.webapp.AbstractFacesInitializer.destroyFaces(AbstractFacesInitializer.java:364) > > > I've cloned Gerhard ee6-ds-demo to show the issue: > > https://github.com/rmpestano/ee6-ds-demo > > just run any test to reproduce. > > > *If i comment > > src/test/resources/META-INF/services/org.apache.deltaspike.testcontrol.spi.ExternalContainer* > the tests passes, it also work with omnifaces 1.x and myfaces test enabled. > > this is the code which throws the exception: > > https://github.com/omnifaces/omnifaces/blob/master/src/main/java/org/omnifaces/application/OmniApplication.java#L69 > > and here is how BeanManager is obtained: > > > https://github.com/omnifaces/omnifaces/blob/master/src/main/java/org/omnifaces/config/BeanManager.java#L79 > > > Do you think there is a problem in Omnifaces code? > > > > -- > <http://www.advancedit.com.br/>Att, > > Rafael M. Pestano > > Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul > http://rpestano.wordpress.com/ > @realpestano <https://twitter.com/realpestano> >
