title: i can't reach my method with primefaces ajax
body: <p>i have an issue with my project, i'm using spring , jsf and primefaces, the problem is when i wish to call a method with ajax request, i can't and i have no error message to help me found the problem this is my first configuration with spring and jsf with annotations.
  help me please .</p>
  
  <p>my configuration:</p>
  
  <pre><code>     @Configuration
       @ComponentScan
       @EnableTransactionManagement
       public class AppConfig {
   @Bean
   public DataSource dataSource() {
          DriverManagerDataSource dataSource = new DriverManagerDataSource();
          dataSource.setDriverClassName("com.mysql.jdbc.Driver");
          dataSource.setUrl("jdbc:mysql://localhost:3306   /carouzetDb?useUnicode=true&amp;useJDBCCompliantTimezoneShift=true&amp;   useLegacyDatetimeCode=false&amp;serverTimezone=UTC");
           dataSource.setUsername("root");
         dataSource.setPassword("root");
         return dataSource;
           }
  
  private  Properties hibernateProperties() {
      Properties hibernateProperties = new Properties();
      hibernateProperties.setProperty(
              "hibernate.hbm2ddl.auto", "create");
      hibernateProperties.setProperty(
              "hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect");
  
      return hibernateProperties;
  }
  
  @Bean
  public LocalSessionFactoryBean sessionFactory() {
      LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
      sessionFactory.setDataSource(dataSource());
      sessionFactory.setPackagesToScan("com.crouzet.carouzetroject.entities");
      sessionFactory.setHibernateProperties(hibernateProperties());
  
      return sessionFactory;
  }
  
  @Bean
  public PlatformTransactionManager hibernateTransactionManager() {
      HibernateTransactionManager transactionManager
              = new HibernateTransactionManager();
      transactionManager.setSessionFactory(sessionFactory().getObject());
      return transactionManager;
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>    public class MvcContentInitializer implements WebApplicationInitializer {
      @Override
  public void onStartup(ServletContext servletContext) throws ServletException {  
         AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();  
      ctx.register(AppConfig.class);  
      ctx.setServletContext(servletContext);    
      servletContext.addListener(new ContextLoaderListener(ctx));
  
    }  
    }  
  </code></pre>
  
  <p>jsf configuration :
  faces-config.xml</p>
  
  <pre><code>     &lt;?xml version='1.0' encoding='UTF-8'?&gt;
       &lt;faces-config version="2.2"
            xmlns="http://xmlns.jcp.org/xml/ns/javaee"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"&gt;
     &lt;application&gt;
      &lt;el-resolver&gt;
           org.springframework.web.jsf.el.SpringBeanFacesELResolver
      &lt;/el-resolver&gt;
      &lt;/application&gt;
      &lt;render-kit&gt;
     &lt;renderer&gt;
      &lt;component-family&gt;org.primefaces.component&lt;/component-family&gt;
       &lt;renderer-type&gt;org.primefaces.component.FileUploadRenderer&lt;/renderer-type&gt;
      &lt;renderer-class&gt;com.crouzet.carouzetroject.FileUploadRenderer&lt;/renderer-class&gt;
     &lt;/renderer&gt;
    &lt;/render-kit&gt;
      &lt;/faces-config&gt;
  </code></pre>
  
  <p>and here is the example where i call my method:</p>
  
  <pre><code>   @ManagedBean(name = "helloBean")
     @ViewScoped
     @Component
      public class HelloBean {
   List&lt;Salarie&gt; salaries;
   List&lt;Categorie&gt; categories;
   List&lt;Poste&gt; postes;
   Production production;
   Categorie selectedCat;
  
   @Autowired
   private CategorieDAO categorieDAO;
   @Autowired
   private SalarieDAO salarieDAO;
  
  @PostConstruct
  public void init(){
      categories=categorieDAO.allCategories();
              System.out.println("==========&gt;&gt;&gt;FROM INIT"+categories.size());
  
  
  }
  
  public void actualiser(){
       categories=categorieDAO.allCategories();
  }
  public void listeDesSalaries(){
      System.out.println("========AAAAAAAAAAAAAA========&gt;&gt;&gt;&gt;");
      if(selectedCat!=null)
      salaries=salarieDAO.salariesParCategorie(selectedCat);
  }
  
  public List&lt;Salarie&gt; getSalaries() {
      return salaries;
  }
  
  public void setSalaries(List&lt;Salarie&gt; salaries) {
      this.salaries = salaries;
  }
  
  public List&lt;Categorie&gt; getCategories() {
      return categories;
  }
  
  public void setCategories(List&lt;Categorie&gt; categories) {
      this.categories = categories;
  }
  
  public List&lt;Poste&gt; getPostes() {
      return postes;
  }
  
  public void setPostes(List&lt;Poste&gt; postes) {
      this.postes = postes;
  }
  
  public Production getProduction() {
      return production;
  }
  
  public void setProduction(Production production) {
      this.production = production;
  }
  
  public Categorie getSelectedCat() {
      return selectedCat;
  }
  
  public void setSelectedCat(Categorie selectedCat) {
      this.selectedCat = selectedCat;
  }
  
  }
  </code></pre>
  
  <p>and here is my page </p>
  
  <pre><code>       &lt;h:form&gt;
           &lt;p:commandButton action="#{helloBean.actualiser()}"  value="Actualiser"  update="mesListes"/&gt;
           &lt;p:panelGrid id="mesListes" columns="2"&gt;
               &lt;p:outputLabel  value="Ligne de fabrication"/&gt;
               &lt;p:selectOneMenu  id="categori" value="#{helloBean.selectedCat}"&gt;
          &lt;f:selectItem itemLabel="Select One" itemValue="" /&gt;
          &lt;f:selectItems value="#{helloBean.categories}" var="cat" itemLabel="#{cat.nom}" itemValue="#{cat}" /&gt;
          &lt;p:ajax listener="#{helloBean.listeDesSalaries()}" /&gt;
      &lt;/p:selectOneMenu&gt;
           &lt;/p:panelGrid&gt;
  
       &lt;/h:form&gt;
  </code></pre>