1 2 Previous Next 23 Replies Latest reply on May 14, 2007 7:44 PM by d.bolesta

    Error during model data update

    jason_rency

      hi all,

      I used the booking example to creat another application regserver. after deployed, when I tried to register a new user, the following error just appears on the registration page:

      "UId": Error during model data update.
      "EMail": Error during model data update.
      "phoneNumber": Error during model data update.

      any idea?

      thanks

      here is the stack track:

      20:07:44,482 INFO [Pages] no pages.xml file found
      20:07:44,482 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
      java.lang.IllegalStateException: No active application scope
      at org.jboss.seam.core.Init.instance(Init.java:48)
      at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:87)
      at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      20:07:44,963 ERROR [STDERR] 22-Jul-2006 20:07:44 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-4.0.4/server/default/tmp/deploy/tmp12020regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
      20:07:44,993 ERROR [STDERR] 22-Jul-2006 20:07:44 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-4.0.4/server/default/tmp/deploy/tmp12020regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
      20:07:45,003 ERROR [STDERR] 22-Jul-2006 20:07:45 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-4.0.4/server/default/tmp/deploy/tmp12020regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
      20:07:45,023 ERROR [STDERR] 22-Jul-2006 20:07:45 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-4.0.4/server/default/tmp/deploy/tmp12020regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
      20:07:45,073 ERROR [STDERR] 22-Jul-2006 20:07:45 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-4.0.4/server/default/tmp/deploy/tmp12020regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
      20:07:45,083 ERROR [STDERR] 22-Jul-2006 20:07:45 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-4.0.4/server/default/tmp/deploy/tmp12020regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/seam.taglib.xml
      20:07:45,453 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
      20:07:45,453 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
      20:07:45,453 INFO [MyfacesConfig] Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.

        • 1. Re:  Error during model data update
          jason_rency

          any idea?

          thanks

          • 2. Re:  Error during model data update
            bfo81

            Please post your code, that would be helpful :)

            • 3. Re:  Error during model data update
              jason_rency

              the register.xhtml

              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              <html xmlns="http://www.w3.org/1999/xhtml"
               xmlns:ui="http://java.sun.com/jsf/facelets"
               xmlns:h="http://java.sun.com/jsf/html"
               xmlns:s="http://jboss.com/products/seam/taglib">
              <head>
               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
               <title>OTP REG SERVER</title>
               <link href="css/screen.css" rel="stylesheet" type="text/css" />
              </head>
              <body id="pgHome">
              <h:form>
              <div id="document">
               <div id="header">
               <div id="title"><img src="img/hdr.title.gif" /></div>
               </div>
               <div id="container">
               <div id="sidebar">
               <h1>to register</h1>
               <p>
              
               here is to register a new user
               </p>
               </div>
               <div id="content">
               <div class="section">
               <h1>Register</h1>
               </div>
               <div class="section">
               <fieldset>
              
               <s:validateAll>
               <div class="entry">
               <div class="label"><h:outputLabel for="UId">Username:</h:outputLabel></div>
               <div class="input">
               <h:inputText id="UId" value="#{user.UId}" required="true"/><br/>
               <span class="errors"><h:message for="UId" /></span>
               </div>
               </div>
               <div class="entry">
               <div class="label"><h:outputLabel for="PIN">Password:</h:outputLabel></div>
               <div class="input">
               <h:inputSecret id="PIN" value="#{register.PIN}" required="true"/><br/>
               <span class="errors"><h:message for="PIN" /></span>
               </div>
               </div>
               <div class="entry">
               <div class="label"><h:outputLabel for="verify">Confirm PIN:</h:outputLabel></div>
               <div class="input">
               <h:inputSecret id="verify" value="#{register.verify}" required="true"/><br/>
               <span class="errors"><h:message for="verify" /></span>
               </div>
               </div>
               <div class="entry">
               <div class="label"><h:outputLabel for="EMail">EMail:</h:outputLabel></div>
               <div class="input">
               <h:inputText id="EMail" value="#{user.EMail}" required="true"/><br/>
               <span class="errors"><h:message for="EMail" /></span>
               </div>
               </div>
               <div class="entry">
               <div class="label"><h:outputLabel for="phoneNumber">Phone Number:</h:outputLabel></div>
               <div class="input">
               <h:inputText id="phoneNumber" value="#{user.phoneNumber}" required="false"/><br/>
               <span class="errors"><h:message for="phoneNumber" /></span>
               </div>
               </div>
               </s:validateAll>
              
               <div class="entry errors"><h:messages globalOnly="true" /></div>
               <div class="entry">
               <div class="label"> </div>
               <div class="input">
               <h:commandButton value="Register" action="#{register.register}" class="button"/>
               <s:link value="Cancel" action="login" linkStyle="button" buttonClass="button"/>
               </div>
               </div>
              
               </fieldset>
               </div>
               </div>
               </div>
               <div id="footer">OTP registeration Server</div>
              </div>
              </h:form>
              </body>
              </html>



              • 4. Re:  Error during model data update
                jason_rency

                the registerAction.java

                package src.reg.server;
                
                import static org.jboss.seam.ScopeType.EVENT;
                
                import java.util.List;
                
                import javax.ejb.Remove;
                import javax.ejb.Stateful;
                import javax.persistence.EntityManager;
                import javax.persistence.PersistenceContext;
                
                import org.jboss.seam.annotations.Destroy;
                import org.jboss.seam.annotations.In;
                import org.jboss.seam.annotations.Name;
                import org.jboss.seam.annotations.Scope;
                import org.jboss.seam.core.FacesMessages;
                
                @Stateful
                @Scope(EVENT)
                @Name("register")
                public class RegisterAction implements Register
                {
                
                 @In
                 private RegUser user;
                
                 @PersistenceContext
                 private EntityManager em;
                
                 @In(create=true)
                 private transient FacesMessages facesMessages;
                
                 private String PIN;
                 private String verify;
                
                 public String register()
                 {
                 System.out.println(PIN);
                 System.out.println(user.getUId());
                
                 if ( PIN.equals(verify) )
                 {
                 List existing = em.createQuery("select U_ID from RegUser where U_ID=:UId")
                 .setParameter("UId", user.getUId())
                 .getResultList();
                 if (existing.size()==0)
                 {
                 //set hashcode of the pin
                 user.setPinHash(PIN.hashCode());
                 em.persist(user);
                 facesMessages.add("Successfully registered as #{user.UId});
                 return "login";
                 }
                 else
                 {
                 facesMessages.add("Username #{user.UId} already exists");
                 return null;
                 }
                 }
                 else
                 {
                 facesMessages.add("verify", "Re-enter your password");
                 verify=null;
                 return null;
                 }
                 }
                
                 public String getVerify()
                 {
                 return verify;
                 }
                
                 public void setPIN(String PIN)
                 {
                 this.PIN = PIN;
                 }
                
                 public String getPIN()
                 {
                 return PIN;
                 }
                
                 public void setVerify(String verify)
                 {
                 this.verify = verify;
                 }
                
                 @Destroy @Remove
                 public void destroy() {}
                }


                • 5. Re:  Error during model data update
                  jason_rency

                  the faces-config.xml

                  <?xml version="1.0" encoding="UTF-8"?>
                  <!DOCTYPE faces-config
                   PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
                   "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
                  
                  <faces-config>
                  
                   <!-- Navigation rules for the OTP reg Server -->
                  
                   <navigation-rule>
                  
                   <navigation-case>
                   <from-outcome>login</from-outcome>
                   <to-view-id>/home.xhtml</to-view-id>
                   <redirect />
                   </navigation-case>
                  
                   <navigation-case>
                   <from-outcome>register</from-outcome>
                   <to-view-id>/register.xhtml</to-view-id>
                   <redirect />
                   </navigation-case>
                   </navigation-rule>
                  
                  
                   <!-- Facelets support -->
                  
                   <application>
                   <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                   </application>
                  
                   <!-- Select one of the two standard persistence lifecycle models for the Seam application -->
                  
                   <lifecycle>
                   <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
                   </lifecycle>
                  
                  </faces-config>


                  • 6. Re:  Error during model data update
                    jason_rency

                    there is nothing in the pages.xml, because I don't know what's this for. not sure if this is correct leaving it blank.

                    <pages>
                    
                    </pages>



                    thanks a lot

                    • 7. Re:  Error during model data update
                      jason_rency

                      my entity bean: RegUser.java

                      package src.reg.server;
                      
                      // Generated 17-Jul-2006 10:43:29 by Hibernate Tools 3.1.0.beta5
                      
                      import static org.jboss.seam.ScopeType.SESSION;
                      
                      import javax.persistence.Column;
                      import javax.persistence.Entity;
                      import javax.persistence.Id;
                      import javax.persistence.Table;
                      
                      import org.jboss.seam.annotations.Name;
                      import org.jboss.seam.annotations.Scope;
                      
                      /**
                       * RegUser generated by hbm2java
                       */
                      @Entity
                      @Name("reguser")
                      @Scope(SESSION)
                      @Table(name = "REG_USER", schema = "PUBLIC", uniqueConstraints = {})
                      public class RegUser implements java.io.Serializable {
                      
                       private static final long serialVersionUID = -595498938312392108L;
                      
                       private String UId;
                      
                       private int pinHash;
                      
                       private String EMail;
                      
                       private String phoneNumber;
                      
                      
                       // Constructors
                      
                       /** default constructor */
                       public RegUser() {
                       }
                      
                       /** minimal constructor */
                       public RegUser(String UId, int pinHash, String tokenKey, int tokenSta,
                       String EMail) {
                       this.UId = UId;
                       this.pinHash = pinHash;
                       this.EMail = EMail;
                       }
                      
                       /** full constructor */
                       public RegUser(String UId, int pinHash, String tokenKey, int tokenSta,
                       String EMail, String phoneNumber) {
                       this.UId = UId;
                       this.pinHash = pinHash;
                       this.EMail = EMail;
                       this.phoneNumber = phoneNumber;
                       }
                      
                       // Property accessors
                       @Id
                       @Column(name = "U_ID", unique = true, nullable = false, insertable = true, updatable = false, length = 10)
                       public String getUId() {
                       return this.UId;
                       }
                      
                       public void setUId(String UId) {
                       this.UId = UId;
                       }
                      
                       @Column(name = "PIN_HASH", unique = false, nullable = false, insertable = true, updatable = true)
                       public int getPinHash() {
                       return this.pinHash;
                       }
                      
                       public void setPinHash(int pinHash) {
                       this.pinHash = pinHash;
                       }
                      
                      
                       @Column(name = "E_MAIL", unique = false, nullable = false, insertable = true, updatable = false, length = 20)
                       public String getEMail() {
                       return this.EMail;
                       }
                      
                       public void setEMail(String EMail) {
                       this.EMail = EMail;
                       }
                      
                       @Column(name = "PHONE_NUMBER", unique = false, nullable = true, insertable = true, updatable = false, length = 15)
                       public String getPhoneNumber() {
                       return this.phoneNumber;
                       }
                      
                       public void setPhoneNumber(String phoneNumber) {
                       this.phoneNumber = phoneNumber;
                       }
                      
                       }
                      
                      }


                      • 8. Re:  Error during model data update
                        jason_rency

                        just get more detailes for ERROR:

                        when I click on cancle (which redirects to the login page) or register new user (which directs to the registration page).I got the following exceptions:

                        0:51:23,097 INFO [Pages] reading pages.xml
                        10:51:23,137 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
                        java.lang.IllegalStateException: No active application scope
                         at org.jboss.seam.core.Init.instance(Init.java:48)
                         at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:87)
                         at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
                         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
                         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                         at java.lang.Thread.run(Thread.java:595)
                        10:51:38,138 ERROR [STDERR] 24-Jul-2006 10:51:38 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
                        INFO: Added Library from: jar:file:/C:/Program%20Files/jboss-4.0.4.GA/server/default/tmp/deploy/tmp45461regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
                        10:51:38,168 ERROR [STDERR] 24-Jul-2006 10:51:38 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
                        INFO: Added Library from: jar:file:/C:/Program%20Files/jboss-4.0.4.GA/server/default/tmp/deploy/tmp45461regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/seam.taglib.xml
                        10:51:38,188 ERROR [STDERR] 24-Jul-2006 10:51:38 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
                        INFO: Added Library from: jar:file:/C:/Program%20Files/jboss-4.0.4.GA/server/default/tmp/deploy/tmp45461regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
                        10:51:38,248 ERROR [STDERR] 24-Jul-2006 10:51:38 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
                        INFO: Added Library from: jar:file:/C:/Program%20Files/jboss-4.0.4.GA/server/default/tmp/deploy/tmp45461regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
                        10:51:38,278 ERROR [STDERR] 24-Jul-2006 10:51:38 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
                        INFO: Added Library from: jar:file:/C:/Program%20Files/jboss-4.0.4.GA/server/default/tmp/deploy/tmp45461regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
                        10:51:38,288 ERROR [STDERR] 24-Jul-2006 10:51:38 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
                        INFO: Added Library from: jar:file:/C:/Program%20Files/jboss-4.0.4.GA/server/default/tmp/deploy/tmp45461regserver.ear-contents/regserver-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
                        10:51:38,919 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
                        10:51:38,919 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
                        10:51:38,919 INFO [MyfacesConfig] Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.


                        I think this might be some problem with my faces-config.xml or pages.xml.

                        when I click on login button or register button, which invoke the loginAction or registerAction, the following error will appear:
                        Error during model data update.


                        • 9. Re:  Error during model data update
                          pmuir

                           


                          "UId": Error during model data update.
                          "EMail": Error during model data update.
                          "phoneNumber": Error during model data update.


                          Looks to me as though user is null.

                          • 10. Re:  Error during model data update
                            jason_rency

                             

                            "petemuir" wrote:

                            "UId": Error during model data update.
                            "EMail": Error during model data update.
                            "phoneNumber": Error during model data update.


                            Looks to me as though user is null.


                            I tried to print out the value and some debug informaton in the registerAction.java:

                            System.out.println(PIN);
                             System.out.println(user.getUId());


                            seems the register method hasn't been invoked yet, or at least there should be null pointer exception if the user is Null or PIN is NULL.

                            • 11. Re:  Error during model data update
                              pmuir

                              I take it you mean you put the debug information in your register() method in RegisterAction? If the model update phase fails the invoke application phase won't occur (which is when the register() method would be called). Try setting a breakpoint on one of the setter methods of the entity and see if it gets called.

                              • 12. Re:  Error during model data update
                                jason_rency

                                I set a break point at the setUId method of the entity bean, it seems the setter method hasn't been called.

                                • 13. Re:  Error during model data update
                                  jason_rency

                                  I have four properies for the entity bean:
                                  UId
                                  pinHASH
                                  EMail
                                  PhoneNumber.

                                  among those the pinHash is not set directly from the registration page. it is set in the regiser() method (registeration.java) where the hashcode of the PIN(get this from the registration page) is caculated.

                                  should this be a problem because I haven't got all the properties from the registeration page?

                                  • 14. Re:  Error during model data update
                                    pmuir

                                    No.

                                    http://www-128.ibm.com/developerworks/library/j-jsf2

                                    This is a good introduction to the JSF lifecycle and should help you understand what the error message 'error during model update' means.

                                    As I mentioned above it looks like you never create an instance of user (either via new User() or create=true) so user is null (which I find a common cause of model update errors).

                                    1 2 Previous Next