7 Replies Latest reply on Jun 30, 2006 3:45 AM by Thomas Heute

    Error during model data update, but no exception in the log

    P K Newbie

      I'm developing my first Seam application. I have a form<-->Stateless Session<-->Ejb3 Entity construct. The only thing missing is the table in the database for the entity bean.

      So I tried to deploy and use the application without the table, just to see where it would break. The problem I run into is that the application prints a message under the form: "username" Error during model data update but there is no exception in the JBoss log about a missing table or a failed SQL.

      It's going to be very difficult to work with Seam if it hide the Exceptions and stack traces from me. How can I turn on exception logging for Seam, JSF, MyFaces, etc. ?

        • 1. Re: Error during model data update, but no exception in the
          Pete Muir Master

          Model update is a JSF lifecycle phase, it has nothing to do with entity persistence.

          I've found model update errors often occur when the object it refers to is null, but I would suggest using the debugger to find out more

          Depending on the setting of hibernate.hbm2ddl.auto in persistence.xml the table will be auto created e.g.

          <property name="hibernate.hbm2ddl.auto" value="create-drop" />

          will result in the database tables being dopped and created according to the EJB3 persistence annotations when the ear is deployed.

          JBoss limits apache (tomcat, myfaces) to info as otherwise it is *extremely* verbose. You can alter it in JBOSS_HOME/server/default/conf/log4j.xml

          • 2. Re: Error during model data update, but no exception in the
            P K Newbie

             

            Model update is a JSF lifecycle phase

            I agree with this. But if there is an error in the application (lifecycle, persistence or whatever), I need to see the exception in the log and a stack trace. First for debugging purposes and later for monitoring the application in production. Also limiting a logger category to info should not stop any exception logging.

            Thanks for the hbm2ddl.auto tips but I have data in my tables and I like to keep it that way.

            • 3. Re: Error during model data update, but no exception in the
              P K Newbie

              It seems like seam cannot locate my user variable in the contexts. Actualy it seems like it can't even locate the class annotated with @Name("user"):

              15:31:18,155 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
              15:31:18,155 DEBUG [org.jboss.seam.Component] seam component not found: user
              15:31:18,155 DEBUG [org.apache.myfaces.el.VariableResolverImpl] Variable 'user' could not be resolved.
              15:31:18,155 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              15:31:18,162 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
              15:31:18,163 DEBUG [org.jboss.seam.Component] seam component not found: user
              15:31:18,163 DEBUG [org.apache.myfaces.el.VariableResolverImpl] Variable 'user' could not be resolved.
              15:31:18,163 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              

              Am I reading this right? and if yes, should it not throw an Exception?


              • 4. Re: Error during model data update, but no exception in the
                Gavin King Master

                 

                "free67" wrote:
                Model update is a JSF lifecycle phase

                I agree with this. But if there is an error in the application (lifecycle, persistence or whatever), I need to see the exception in the log and a stack trace.


                And of course you will. Seam does not swallow any exceptions, and you have not seen it swallow exceptions. Why assume Seam would do something totally evil when you have zero evidence for that?

                • 5. Re: Error during model data update, but no exception in the
                  Gavin King Master

                   

                  "free67" wrote:
                  It seems like seam cannot locate my user variable in the contexts. Actualy it seems like it can't even locate the class annotated with @Name("user"):
                  Am I reading this right? and if yes, should it not throw an Exception?


                  Probably Seam has not installed your "user" component. Probably you are missing seam.properties. No, Seam most certainly should not throw an exception. Why should Seam throw an exception when plain JSF, or even plain JSP would not?

                  • 6. Re: Error during model data update, but no exception in the
                    P K Newbie

                    King, you say I say Seam is evil!?! Of course it is. How else do you expect it to take over the world.

                    You are right. Seam does not swallow exceptions and... I never mentioned swallowing in my post. blah, that's so anticlimactic.

                    Fine, this is just the way faces is designed and also the way myfaces is implemented. I'm not the only person that thinks this is odd:
                    http://www.mail-archive.com/users@myfaces.apache.org/msg11592.html.
                    But this forum is not the right place to discuss faces specs. I'll move my comments on that elsewhere.

                    However, in Seam, the outcome of not finding an @Name(d) class, should that not be a medium sized error, something that might throw an exception? or maybe just and ERROR log line? On the other hand, perhaps a missing @Name(d) class is just a special case of a wider scenario that could play out without ultimate failure.

                    • 7. Re: Error during model data update, but no exception in the
                      Thomas Heute Master

                      When you deploy your app, Seam tells you the component it found. Look there. My guess is that it is something else.