6 Replies Latest reply on Aug 17, 2007 11:56 AM by Tim

    how many layer can EL go down?

    Tim Newbie

      Well, I got a JSF code like this

       <h:selectOneMenu id="application_Test_limit" value="#{applicationHome.instance.test.limit.value}">
       <f:selectItem itemValue="$100000"/>
       <f:selectItem itemValue="$1000000"/>
       </h:selectOneMenu>
      

      but I keep getting the error said it can't set value
      sourceId=application:application_Test_limit[severity=(ERROR 2), summary=(/policy/ApplicationEdit2.xhtml @58,123 value="#{applicationHome.instance.test.limit.value}": Error writing 'value' on type Limit), detail
      =(/policy/ApplicationEdit2.xhtml @58,123 value="#{applicationHome.instance.test.limit.value}": Error writing 'value' on type Limit)]
      


      It's just a String value in Limit object.


        • 1. Re: how many layer can EL go down?
          Nicklas Karlsson Master

          and Limit.setValue(String) exists?

          • 2. Re: how many layer can EL go down?
            Tim Newbie

            Sure does.

            • 3. Re: how many layer can EL go down?
              Pete Muir Master

              You'll need to use your debugger to find out some more info.

              • 4. Re: how many layer can EL go down?
                Tim Newbie

                I should have provided more context info on this.

                This happens on page 2 of a long-running conversation. After user finished page 1, they hit next to go to page two to select value from drop-down list. Boolean value select has no problem.

                On page 1, ApplicationEdit.page.xhtml is

                <?xml version="1.0" encoding="UTF-8"?>
                <page xmlns="http://jboss.com/products/seam/pages"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
                 no-conversation-view-id="/home.xhtml"
                 login-required="true"
                >
                
                 <param name="applicationFrom"/>
                 <param name="applicationId" value="#{applicationHome.applicationId}"/>
                
                 <begin-conversation join="true" flush-mode="manual"/>
                
                 <action execute="#{applicationHome.wire}"/>
                
                 <navigation from-action="#{applicationHome.save}">
                 <end-conversation/>
                 <redirect view-id="/Application.xhtml"/>
                 </navigation>
                
                 <navigation from-action="#{applicationHome.update}">
                 <end-conversation/>
                 <redirect view-id="/Application.xhtml"/>
                 </navigation>
                
                 <navigation from-action="#{applicationHome.remove}">
                 <end-conversation/>
                 <redirect view-id="/ApplicationList.xhtml"/>
                 </navigation>
                
                </page>
                


                On page 2, ApplicationEdit2.page.xhtml is
                <?xml version="1.0" encoding="UTF-8"?>
                <page xmlns="http://jboss.com/products/seam/pages"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
                 no-conversation-view-id="/home.xhtml"
                 login-required="true"
                >
                
                 <param name="applicationFrom"/>
                
                 <begin-conversation join="true" flush-mode="manual"/>
                
                 <navigation from-action="#{applicationHome.save}">
                 <end-conversation/>
                 <redirect view-id="/Application.xhtml"/>
                 </navigation>
                
                 <navigation from-action="#{applicationHome.update}">
                 <end-conversation/>
                 <redirect view-id="/Application.xhtml"/>
                 </navigation>
                
                 <navigation from-action="#{applicationHome.remove}">
                 <end-conversation/>
                 <redirect view-id="/ApplicationList.xhtml"/>
                 </navigation>
                
                </page>
                


                public class Limit {
                ...
                 public void setValue(String values)
                 {
                 log.info("set value string " + values);
                 super.setValues(values);
                 value = values;
                 }
                }
                


                Here's the exception in the server.log. Notice how it did go into setValue(val) the first time.

                ,225 INFO [Limit] set value string $100000
                ,256 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,256 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,256 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,256 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,256 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,256 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,256 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,256 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,256 DEBUG [jsf.SeamPhaseListener] committing transaction after phase: UPDATE_MODEL_VALUES 4
                ,256 DEBUG [jsf.SeamPhaseListener] beginning transaction prior to phase: RENDER_RESPONSE 6
                ,272 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,272 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
                ,272 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,272 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,288 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,288 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,288 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,288 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,288 WARN [javax.enterprise.resource.webcontainer.jsf.renderkit] 'for' attribute cannot be null
                ,319 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,319 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,319 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,319 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,319 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,319 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,319 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
                ,319 DEBUG [AbstractEntityManagerImpl] Transaction already joined
                ,350 INFO [javax.enterprise.resource.webcontainer.jsf.lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
                sourceId=application:application_test_deductible[severity=(ERROR 2), summary=(/policy/ApplicationEdit2.xhtml @66,139 value="#{applicationHome.instance.coverage.deductible.value}": Error writing 'value' on type Deductible), detail=(/policy/ApplicationEdit2.xhtml @66,139 value="#{applicationHome.instance.coverage.deductible.value}": Error writing 'value' on type Deductible)]
                sourceId=application:application_test_limit[severity=(ERROR 2), summary=(/policy/ApplicationEdit2.xhtml @58,123 value="#{applicationHome.instance.coverage.limit.value}": Error writing 'value' on type Limit), detail=(/policy/ApplicationEdit2.xhtml @58,123 value="#{applicationHome.instance.coverage.limit.value}": Error writing 'value' on type Limit)]
                ,366 DEBUG [jsf.SeamPhaseListener] committing transaction after phase: RENDER_RESPONSE 6
                ,366 DEBUG [core.Manager] Storing conversation state: 3
                ,366 DEBUG [contexts.FacesLifecycle] After render response, destroying contexts
                ,366 DEBUG [contexts.FacesLifecycle] <<< End JSF request
                


                It does the same thing for Deductible.setValue() that's why you see double ERROR in there. From the log, it does seem to be something with transaction.
                Am I doing it right with transaction join there? Let me try conversation-required="true" to see.

                • 5. Re: how many layer can EL go down?
                  Tim Newbie

                  Never mind. I found something else in my underlying code that might cause the trouble. Why i didn't throw exception or log that out is still a mystery.

                  • 6. Re: how many layer can EL go down?
                    Tim Newbie

                    This is the problem with Common StringUtils.remove() call that I warned people. I remove it from example code because I thought that simple call can be trusted.