I notice that when trying to setup my JSF 2 webapp running on jetty, i have this error :
java.lang.IllegalStateException: Application was not properly
One more resolve: I got this error after I created java files on the fly with CXF from wsdl.
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
Client client = factory.createClient(wsdlURL, serviceName);
CXF puts its own ClassLoader (instance of URLClassLoader) to the Thread's classloader. It works the normal way, until user's thread gets into JSF's FactoryFinder, which is cached by the ClassLoader as the key. Because the ClassLoader changed, it creates a new FactoryManager, which cannot be initialized, because the implementation instance lists are removed when the original FactoryManager initiated. Because of it, the Implementation classes are not found, hence the IllegalStateException is thrown.
Solution: backup the original ClassLoader before CXF's createClient, save the URLClassLoader in a variable and put back the original ClassLoader to the Thread. When you want to access a dynamic class from CXF, search it through the URLClassLoader you put in a variable.