11 Replies Latest reply on Jun 24, 2007 2:51 PM by dkane

    javax.el.ELException , unable to localize the error

    dkane

      Hello

      I would like to know how to deal with such Exception stack trace in Seam application (no information about errorneous line number)

      Thank you

      javax.el.ELException: /main.xhtml: Bean: org.javassist.tmp.java.lang.Object_$$_javassist_48, property: find
       at com.sun.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:53)
       at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       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.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       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:799)


        • 1. Re: javax.el.ELException , unable to localize the error
          pmuir

          Is that the whole exception? Use your debugger and break on ELException.

          • 2. Re: javax.el.ELException , unable to localize the error
            dkane

             

            "petemuir" wrote:
            Is that the whole exception? Use your debugger and break on ELException.


            Yes, that's the whole exception.

            I am not yet experienced enough with Eclipse IDE to use debugger with JBoss. I will try to master it ASAP, but exception trace must be more informative. The good style of programming is when top-message of stack trace explains what is wrong, exactly.

            "find" is a method of SFSB annotated as Seam component. Other methods of this component are successfully invokable from web-page (I checked that by commenting calls to "find"), so component itself is visible.
            And it seems weird to me that "find" is called "property" in error message .

            • 3. Re: javax.el.ELException , unable to localize the error
              pmuir

              Ah, thats the clue :) Post the bean and the xhtml.

              • 4. Re: javax.el.ELException , unable to localize the error
                dkane

                The bean (quite similar to "HotelSearchAction in booking example"):

                import java.util.List;
                import javax.ejb.Remove;
                import javax.ejb.Stateful;
                import javax.persistence.EntityManager;
                import javax.persistence.PersistenceContext;
                import org.jboss.seam.ScopeType;
                import org.jboss.seam.annotations.Destroy;
                import org.jboss.seam.annotations.Factory;
                import org.jboss.seam.annotations.Name;
                import org.jboss.seam.annotations.Scope;
                import org.jboss.seam.annotations.datamodel.DataModel;
                import org.jboss.seam.annotations.security.Restrict;
                
                @Stateful
                @Name("partSearch")
                @Scope(ScopeType.SESSION)
                //@Restrict("#{identity.loggedIn}")
                public class PartSearchAction implements PartSearch
                {
                
                 @PersistenceContext
                 private EntityManager em;
                
                 private String searchString;
                 private int pageSize = 10;
                 private int page;
                
                 @DataModel
                 private List<PartCMP> parts;
                
                 //-------------------------------------------------------------------------------------
                 //
                
                 private void doSearch()
                 {
                 parts = em.createQuery("select p from PartCMP p where partnumber like #{pattern}")
                 .setMaxResults(pageSize)
                 .setFirstResult( page * pageSize )
                 .getResultList();
                 }
                
                 //-------------------------------------------------------------------------------------
                 //
                 public void findParts()
                 {
                 page = 0;
                 doSearch();
                 //return("main");
                 }
                
                 //-------------------------------------------------------------------------------------
                 //
                 public int getPageSize()
                 {
                 return(pageSize);
                 }
                
                 //-------------------------------------------------------------------------------------
                 //
                 public String getSearchString()
                 {
                 return(searchString);
                 }
                
                 //-------------------------------------------------------------------------------------
                 //
                 public boolean isNextPageAvailable()
                 {
                 return(parts!=null && parts.size()==pageSize);
                 }
                 //-------------------------------------------------------------------------------------
                 //
                 public void nextPage()
                 {
                 page++;
                 doSearch();
                 }
                 //-------------------------------------------------------------------------------------
                 //
                 public void setPageSize(int pageSize)
                 {
                 this.pageSize = pageSize;
                 }
                
                 //-------------------------------------------------------------------------------------
                 //
                 public void setSearchString(String searchString)
                 {
                 this.searchString = searchString;
                 }
                
                 //-------------------------------------------------------------------------------------
                 //
                 @Factory(value="pattern", scope=ScopeType.EVENT)
                 public String getSearchPattern()
                 {
                 return(searchString==null ? "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%');
                 }
                
                 //-------------------------------------------------------------------------------------
                 //
                 @Destroy @Remove
                 public void destroy()
                 {}
                
                }
                




                xhtml form :

                <h:form id="searchCriteria">
                 <fieldset>
                 <h:inputText id="searchString" value="#{partSearch.searchString}" style="width: 165px;">
                 </h:inputText>
                
                 <a:commandButton id="findPartsBtn" value="Find part" action="#{partSearch.findParts}" reRender="searchResults"/>
                 <a:status>
                 <f:facet name="start">
                 <h:graphicImage value="/img/spinner.gif"/>
                 </f:facet>
                 </a:status>
                 <br/>
                 <h:outputLabel for="pageSize">Maximum results:</h:outputLabel>
                 <h:selectOneMenu value="#{partSearch.pageSize}" id="pageSize">
                 <f:selectItem itemLabel="5" itemValue="5"/>
                 <f:selectItem itemLabel="10" itemValue="10"/>
                 <f:selectItem itemLabel="20" itemValue="20"/>
                 </h:selectOneMenu>
                 </fieldset>
                 </h:form>
                



                When I comment the link to #{partSearch.findParts} (command button code), page is displayed fine , although calls to other partSearch methods exist in this page.







                • 5. Re: javax.el.ELException , unable to localize the error
                  dkane

                  P.S. I renamed method name to findParts, so the Exception message is now

                  javax.el.ELException: /main.xhtml: Bean: org.javassist.tmp.java.lang.Object_$$_javassist_48, propert
                  y: findParts


                  • 6. Re: javax.el.ELException , unable to localize the error
                    pmuir

                    It looks to me like the ajax4jsf namespace isn't being resolved correctly. Does it work as a h:commandButton?

                    • 7. Re: javax.el.ELException , unable to localize the error
                      dkane

                       

                      "petemuir" wrote:
                      It looks to me like the ajax4jsf namespace isn't being resolved correctly. Does it work as a h:commandButton?


                      Unfortunately, not.
                      Thank you for trying to help.


                      • 8. Re: javax.el.ELException , unable to localize the error
                        christophea

                        Is your findPart method declared in the PartSearch interface ?

                        • 9. Re: javax.el.ELException , unable to localize the error
                          dkane

                           

                          "ChristopheA" wrote:
                          Is your findPart method declared in the PartSearch interface ?


                          Yes

                          @Local
                          public interface PartSearch
                          {
                           public int getPageSize();
                           public void setPageSize(int pageSize);
                          
                           public String getSearchString();
                           public void setSearchString(String searchString);
                           public String getSearchPattern();
                          
                           public void findParts();
                           public void nextPage();
                           public boolean isNextPageAvailable();
                          
                           public void destroy();
                          
                          
                          }
                          



                          I've just played a bit with (un)commenting references to partSearch component in xhtml page.
                          Interesting results :

                          action="#{partSearch.findParts}" - throws Exception
                          actionListener="#{partSearch.findParts}" - throws Exception
                          value="#{partSearch.pageSize} - works
                          action="#{partSearch.nextPage}" - throws Exception
                          rendered="#{partSearch.nextPageAvailable}" - works

                          Looks like property-invoking methods works but action-methods of type void does not work.
                          Any ideas ?


                          • 10. Re: javax.el.ELException , unable to localize the error
                            gena777

                            Hi,
                            is it possible, you are getting some where an uncaught exception (i would say null pointer) and seam interceptor rolls back the transaction? In the next step your page will rerender and touch a really null (or corrupt) objects.


                            Gena

                            • 11. Re: javax.el.ELException , unable to localize the error
                              dkane

                              I must say, finally, that petemuir's version was correct :

                              ajax4jsf namespace isn't being resolved correctly


                              The problem is solved now, thanks.