Note that there are some explanatory texts on larger screens.

plurals
  1. POupdate data using jsf1.2 + jboss seam
    text
    copied!<p>I am using JSF1.2 + seam2.2.2.Final + hibernate + JPA for my project with maven.</p> <p>Everything going good except the update operation for list in tables. When click on the img for edit, it says </p> <p>Exception during request processing:</p> <pre><code>Caused by javax.el.ELException with message: "javax.ejb.EJBTransactionRolledbackException: No entity found for query" org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339) org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280) org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59) org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65) org.jboss.el.parser.AstValue.invoke(AstValue.java:96) org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) org.jboss.seam.core.Expressions$2.invoke(Expressions.java:221) org.jboss.seam.navigation.Pages.callAction(Pages.java:708) org.jboss.seam.navigation.Pages.preRender(Pages.java:331) org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:560) org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:471) org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:147) org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:117) com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53) org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) java.lang.Thread.run(Thread.java:619) </code></pre> <hr> <pre><code>My UI page showing userList is, </code></pre> <hr> <pre><code> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;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" xmlns:a4j="http://richfaces.org/a4j" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.prime.com.tr/ui"&gt; &lt;ui:composition&gt; &lt;div id="data_table_container" class="panel-data-content"&gt;&lt;h:form class="input-list"&gt; &lt;!-- {RowsPerPageDropdown}--&gt; &lt;p:dataTable id="dataTable" color="red" value='#{userListAction.usersList}' var='user' dynamic="false" width="99.9%" loadingMessage="List of users being loaded"&gt; &lt;p:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="First Name" /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{user.firstName}" /&gt; &lt;/p:column&gt; &lt;p:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Last Name" /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{user.lastName}" /&gt; &lt;/p:column&gt; &lt;p:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Email Id" /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{user.emailAddress}" /&gt; &lt;/p:column&gt; &lt;p:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Home Phone" /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{user.homeNumber}" /&gt; &lt;/p:column&gt; &lt;p:column&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Cell Phone" /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{user.cellNumber}" /&gt; &lt;/p:column&gt; &lt;p:column styleClass="user-table-action"&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Action" /&gt; &lt;/f:facet&gt; &lt;s:link id="editUser" action="# {userListAction.getUserById(user.getUserId)}" view="/secure/admin/update.xhtml"&gt; &lt;img id="edit-user-img" src="# {imagesPath}/edit-icon.png" alt="Edit user" title="Edit User" /&gt; &lt;/s:link&gt; &amp;nbsp; &lt;a class="delete-user {userId: #{user.userId}}" href="#"&gt; &lt;img id="delete-user-img" src="#{imagesPath}/delete-icon.png" alt="Add User" title="Delete User" /&gt; &lt;/a&gt; &amp;nbsp; &lt;a class="add-user" href="#{contextPath}/secure/admin/# {user.customer?'createCustomer.clrp':'createEmployee.clrp'}"&gt; &lt;img id="add-user-img" src="#{imagesPath}/add-icon.png" alt="Add #{user.customer?'Customer':'Employee'}" title="Add #{user.customer?'Customer':'Employee'}" /&gt; &lt;/a&gt; &amp;nbsp; &lt;/p:column&gt; &lt;/p:dataTable&gt; &lt;/h:form&gt; &lt;h:messages globalOnly="true" /&gt;&lt;/div&gt; &lt;/ui:composition&gt; &lt;/html&gt; </code></pre> <hr> <p>The js file used in userlist</p> <hr> <pre><code> $(function() { $("#data_table_container").delegate('.delete-user', 'click', function(event) { var userId = $(this).metadata().userId; $('#deleteUserId').val(userId); $('#delete-error-msg').html(''); $('#delete-user').jqmShow(); event.preventDefault(); }); deleteUser = function(buttonElement) { var userId = $('#deleteUserId').val(); var href = window.location.pathname; Seam.Component.getInstance("userListAction").deleteById(userId, function(message) { if (message == 'success') { // Close and reload the $('#delete-error-msg').html(''); // Close the modal $('#delete-user').jqmHide(); window.location = href; $('#deleteUserId').val(''); } else { // Show the error message in the modal $('#delete-error-msg').html(message); } }); event.preventDefault(); }; deleteUserCancel = function(buttonElement) { $('#delete-user').jqmHide(); $('#deleteUserId').val(''); }; }); </code></pre> <hr> <p>pages.xml is</p> <hr> <pre><code>&lt;page view-id="/secure/admin/update.xhtml" action="#{homePage.getUpdate()}"&gt; &lt;param name="conversationId" value="none" /&gt; &lt;/page&gt; </code></pre> <hr> <p>The interface is</p> <hr> <pre><code> @Local public interface HomePage extends Serializable { public static final String LOGON_PAGE = "/login.xhtml"; public static final String USER_HOME_PAGE = "/secure/user/home.xhtml"; public static final String CUSTOMER_HOME_PAGE = "/secure/customer/home.xhtml"; public static final String HOME_PAGE = "/secure/userhome.xhtml"; public static final String HOME = "/woodlux/homePage.xhtml"; public static final String UPDATE = "/secure/admin/user/updateUser.xhtml"; public String getHomePage(); public String getHome(); public String getUpdate(); } </code></pre> <hr> <p>updateUser file is:</p> <hr> <pre><code> &lt;!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:clrp="http://panorosys.com/products/clrp/taglib" template="/WEB-INF/templates/clrp-template.xhtml"&gt; &lt;ui:param name="currentArea" value="Customer List" /&gt; &lt;ui:define name="head"&gt; &lt;script src="#{scriptsPath}/clrpmenu/jquery.js" type="text/javascript" /&gt; &lt;/ui:define&gt; &lt;ui:define name="main-container"&gt; &lt;div class="data-panel"&gt; &lt;br&gt;&lt;/br&gt; &lt;br&gt;&lt;/br&gt; &lt;h:outputText rendered="#{currentUser.customer}"&gt; &lt;h1 class="panel-header"&gt;Update Customer&lt;/h1&gt; &lt;/h:outputText&gt; &lt;h:outputText rendered="#{!currentUser.customer}"&gt; &lt;h1 class="panel-header"&gt;Update Employee&lt;/h1&gt; &lt;/h:outputText&gt;&lt;ui:include src="userupdate.xhtml" /&gt;&lt;/div&gt; &lt;script&gt; Seam.Remoting.getContext().setConversationId("#{conversation.id}"); &lt;/script&gt; &lt;/ui:define&gt; &lt;/ui:composition&gt;` </code></pre> <p>Please assist anyone...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload