1 Reply Latest reply on May 16, 2007 10:38 AM by dkane

    Conversion error on simple trial

    dkane

      Hi colleagues,

      Just starting to explore Seam and getting "Conversion error" message on "Registration" example.
      3 "Conversion error" lines appears below the input fields after clicking "Sumbit", and no data appears in database.

      I was searching for postings with similar problems, and have found one explanation that components.xml should contain

      <property name="jndiPattern">ear-file-name/#{ejbName}/local</property>


      instead of default

      <property name="jndiPattern">#{ejbName}/local</property>



      I have made this change (tried file names with and without extension) - no effect.

      Could anyone please help me ? Also, I would like to know is it possible to dig up the Exception trace lying under messages like "Conversion error". Stack trace always leads us into the errorneous line in Java code, but "Conversion error" is something that you just know or don't know, without any path to the solution..

      Many thanks !




        • 1. Re: Conversion error on simple trial
          dkane

          Actually, I found that stateless bean method is not even being invoked.
          I added log-string to the very first line :

          @Stateless
          @Name("register")
          public class RegisterAction implements Register
          {
          
           @In
           private User user;
          
           @PersistenceContext
           private EntityManager em;
          
           @Logger
           private Log log;
          
           public String register()
           {
          
           log.info("SEAM : REGISTER EXAMPLE IS INVOKED");
           List existing = em.createQuery("select username from User where username=:username")
           .setParameter("username", user.getUsername())
           .getResultList();
          
           if (existing.size()==0)
           {
           em.persist(user);
           log.info("Registered new user #{user.username}");
           return "/registered.jsp";
           }
           else
           {
           FacesMessages.instance().add("User #{user.username} already exists");
           return null;
           }
          
           }
           ......


          register.jsp contains the button :

          <h:commandButton type="submit" value="Register" action="#{register.register}"/>



          But when I click the button, log message "SEAM : REGISTER EXAMPLE IS INVOKED" is not being printed.

          What's wrong ?