title: Why I get this error in CXF
body: <p>I want to make dynamic web service invoker in JSF with CXF. But when I load this simple code I get error.
  The code:</p>
  
  <pre><code>JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
  Client client = dcf.createClient("http://ws.strikeiron.com/IPLookup2?wsdl");
  </code></pre>
  
  <p>The error:</p>
  
  <p>No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions! If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml. A typical config looks like this;  org.apache.myfaces.webapp.StartupServletContextListener  </p>
  
  <p>Caused by:
  java.lang.IllegalStateException - No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions! If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml. A typical config looks like this;  org.apache.myfaces.webapp.StartupServletContextListener </p>
  
  <p>Any Idea how to solve the problem?</p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt;
    &lt;display-name&gt;ServiceInvoker&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;javax.servlet.jsp.jstl.fmt.localizationContext&lt;/param-name&gt;
      &lt;param-value&gt;resources.application&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;description&gt;State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2&lt;/description&gt;
      &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
      &lt;param-value&gt;client&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;description&gt;
      This parameter tells MyFaces if javascript code should be allowed in
      the rendered HTML output.
      If javascript is allowed, command_link anchors will have javascript code
      that submits the corresponding form.
      If javascript is not allowed, the state saving info and nested parameters
      will be added as url parameters.
      Default is 'true'&lt;/description&gt;
      &lt;param-name&gt;org.apache.myfaces.ALLOW_JAVASCRIPT&lt;/param-name&gt;
      &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;description&gt;
      If true, rendered HTML code will be formatted, so that it is 'human-readable'
      i.e. additional line separators and whitespace will be written, that do not
      influence the HTML code.
      Default is 'true'&lt;/description&gt;
      &lt;param-name&gt;org.apache.myfaces.PRETTY_HTML&lt;/param-name&gt;
      &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;org.apache.myfaces.DETECT_JAVASCRIPT&lt;/param-name&gt;
      &lt;param-value&gt;false&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;description&gt;
      If true, a javascript function will be rendered that is able to restore the
      former vertical scroll on every request. Convenient feature if you have pages
      with long lists and you do not want the browser page to always jump to the top
      if you trigger a link or button action that stays on the same page.
      Default is 'false'
  &lt;/description&gt;
      &lt;param-name&gt;org.apache.myfaces.AUTO_SCROLL&lt;/param-name&gt;
      &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;listener&gt;
      &lt;listener-class&gt;org.apache.myfaces.webapp.StartupServletContextListener&lt;/listener-class&gt;
    &lt;/listener&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>faces-config.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;faces-config
      xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
      version="1.2"&gt;
      &lt;managed-bean&gt;
          &lt;description&gt;Bean used for invoking services&lt;/description&gt;
          &lt;managed-bean-name&gt;invoker&lt;/managed-bean-name&gt;
          &lt;managed-bean-class&gt;org.cot.invoker.Invoker&lt;/managed-bean-class&gt;
          &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt;
      &lt;/managed-bean&gt;
  
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>This is what I get in the console in Eclipse:</p>
  
  <p>22.3.2010 15:00:11 org.apache.cxf.endpoint.dynamic.DynamicClientFactory outputDebug
  INFO: Created classes: com.strikeiron.ws.GetRemainingHits, com.strikeiron.ws.GetRemainingHitsResponse, com.strikeiron.ws.LicenseInfo, com.strikeiron.ws.ObjectFactory, com.strikeiron.ws.RegisteredUser, com.strikeiron.ws.SubscriptionInfo, com.strikeiron.ws.UnregisteredUser, com.strikeiron.ArrayOfMethodStatusRecord, com.strikeiron.ArrayOfSIWsStatus, com.strikeiron.ArrayOfServiceInfoRecord, com.strikeiron.ArrayOfString, com.strikeiron.ArrayOfString1, com.strikeiron.DNSInfo, com.strikeiron.DNSLookup, com.strikeiron.DNSLookupResponse, com.strikeiron.GetServiceInfo, com.strikeiron.GetServiceInfoResponse, com.strikeiron.GetStatusCodes, com.strikeiron.GetStatusCodesForMethod, com.strikeiron.GetStatusCodesForMethodResponse, com.strikeiron.GetStatusCodesResponse, com.strikeiron.MethodStatusRecord, com.strikeiron.ObjectFactory, com.strikeiron.SIWsOutputOfDNSInfo, com.strikeiron.SIWsOutputOfMethodStatusRecord, com.strikeiron.SIWsOutputOfSIWsResultArrayOfMethodStatusRecord, com.strikeiron.SIWsOutputOfSIWsResultArrayOfServiceInfoRecord, com.strikeiron.SIWsResultArrayOfMethodStatusRecord, com.strikeiron.SIWsResultArrayOfSIWsStatus, com.strikeiron.SIWsResultArrayOfServiceInfoRecord, com.strikeiron.SIWsStatus, com.strikeiron.ServiceInfoRecord
  je slo
  22.3.2010 15:00:13 javax.faces.webapp._ErrorPageWriter handleThrowable
  SEVERE: An exception occurred
  java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
  If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
  A typical config looks like this;
  
    org.apache.myfaces.webapp.StartupServletContextListener
  </p>
  
  <pre><code>at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:106)
  at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:356)
  at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
  at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:155)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>when I click on: </p>
  
  <pre><code>&lt;h:commandLink value="Invoke me!" actionListener="#{invoker.doInvoke}"&gt;&lt;/h:commandLink&gt;
  </code></pre>