[JBoss Seam] - Re: seam s:link fetchs list multiple times. big error !
by bulloncito
Didn't wanted to bloat the post, but it happens with every dataTable I have, wheter they use query objects, my own custom beans, or even bean.property of type list, they all get queryed again for every s:link in every row (of a h:dataTable).
Here's a quick sample, the COMPLETE page list-regions.xhtml:
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:c="http://java.sun.com/jstl/core"
| 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:a="https://ajax4jsf.dev.java.net/ajax"
| template="/template.xhtml">
|
| <!-- content -->
| <ui:define name="content">
|
| <div class="section">
| <span class="errors">
| <h:messages globalOnly="true"/>
| </span>
| <h1>#{messages.list_regions_label}</h1>
| </div>
|
| <div class="section">
| <h:dataTable id="regions" value="#{regions.resultList}" var="region" rowClasses="row0,row1" >
| <h:column rendered="#{s:hasRole('Debug')}">
| <f:facet name="header">id</f:facet>
| #{region.id}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages.region_name_label}</f:facet>
| #{region.name}
| </h:column>
| <h:column>
| <f:facet name="header">#{messages.region_options_label}</f:facet>
|
| <s:link propagation="none" view="/register/register-region.xhtml" style="text-decoration: none">
| <h:graphicImage url="/img/status_bullet/pencil_blue.gif" onmouseover="return escape('#{messages.region_edit_label}');" styleClass="icon" />
| <f:param name="selectedRegionId" value="#{region.id}" />
| </s:link>
|
| <s:link propagation="join" view="/list/list-employees.xhtml" >
| <h:graphicImage url="/img/status_bullet/avatars_blue.gif" onmouseover="return escape('#{messages.view_region_employees}');" styleClass="icon" />
| <f:param name="selectedRegionId" value="#{region.id}" />
| </s:link>
|
| <s:link propagation="join" view="/list/list-complexes.xhtml" >
| <h:graphicImage url="/img/status_bullet/house_blue.gif" onmouseover="return escape('#{messages.view_region_complexes}');" styleClass="icon" />
| <f:param name="selectedRegionId" value="#{region.id}" />
| </s:link>
|
| </h:column>
| </h:dataTable>
| </div>
|
| </ui:define>
|
| <!-- sidebar -->
| <ui:define name="sidebar">
| <ui:include src="/menu-simple.xhtml" />
| </ui:define>
|
| </ui:composition>
|
and the actual full entityQuery that does the work (it is the COMPLETE source, that's all):
| @Name("regions")
| public class RegionList extends EntityQuery {
|
| @Logger Log log ;
|
| @Override
| public String getEjbql() {
| return "SELECT r FROM Region AS r WHERE r.active > 0 ORDER BY r.name " ;
| }
|
| @Override
| public List getResultList() {
| log.debug("fetchin' list") ;
| return super.getResultList() ;
| }
| }
|
there are 16 entries on the database, it prints in the logs:
| DEBUG [RegionList] fetchin' list
| X 49
|
exactly 49 times, one for the table, one for each s:link (16*3+1), if I remove 1, 2, or the 3 s:links, then it prints 33 (16*2+1), 17 (16+1) and 1 (1 :P) times respectively. So, it's fetching again for each s:link on the table.
... this HAS to be an error.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061539#4061539
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061539
18Â years, 9Â months
[JNDI/Naming/Network] - ClassCastException with iiop
by kathy90031
When I use jnp - everything is fine, no ClassCastException when accessing the eJB I deployed on Jboss 4.01. However, when I set up the bean to use iiop (updating the jboss.xml and deploying on the server config all), I get a ClassCastException on the PortableRemoteObject.narrow method.
I have my EJB deployed on JBoss 4.01.
I can a WEB Application running inside Jdeveloper on OC4J application server. I don't think that my remote EJB is deployed on the OC4J. I have read the wiki on ClassCastException. Here is my dump from the JMX console
com.infomanager.ejb.userindex.UserIndexBean Information
Repository cache version:
com.infomanager.ejb.userindex.UserIndexBean(1e84ff1).ClassLoader=org.jboss.mx.loading.UnifiedClassLoader3@945d2d{ url=file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43145UserIndexEAR.ear ,addedOrder=39}
..org.jboss.mx.loading.UnifiedClassLoader3@945d2d{ url=file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43145UserIndexEAR.ear ,addedOrder=39}
....file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43145UserIndexEAR.ear
....file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43145UserIndexEAR.ear-contents/UserIndexEJB.jar
....file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43145UserIndexEAR.ear-contents/RazorSourceCommon.jar
....file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43145UserIndexEAR.ear-contents/WebAdviser.jar
....file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43145UserIndexEAR.ear-contents/jt400.jar
..org.jboss.system.server.NoAnnotationURLClassLoader@1f6f296
..sun.misc.Launcher$AppClassLoader@a39137
....file:/C:/Development/jboss-4.0.2/bin/run.jar
..sun.misc.Launcher$ExtClassLoader@92e78c
....file:/C:/Program%20Files/Java/jre1.5.0_10/lib/ext/dnsns.jar
....file:/C:/Program%20Files/Java/jre1.5.0_10/lib/ext/sunjce_provider.jar
....file:/C:/Program%20Files/Java/jre1.5.0_10/lib/ext/sunpkcs11.jar
++++CodeSource: (file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43145UserIndexEAR.ear-contents/UserIndexEJB.jar )
Implemented Interfaces:
++interface javax.ejb.SessionBean(1464fee)
++++ClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@125d61e{ url=file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43073jboss-service.xml ,addedOrder=2}
++++CodeSource: (file:/C:/Development/jboss-4.0.2/server/all/lib/jboss-j2ee.jar )
### Instance0 found in UCL: org.jboss.mx.loading.UnifiedClassLoader3@945d2d{ url=file:/C:/Development/jboss-4.0.2/server/all/tmp/deploy/tmp43145UserIndexEAR.ear ,addedOrder=39}
Please advise
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061537#4061537
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061537
18Â years, 9Â months