[EJB 3.0 Users] - SessionBean and the case of RESTRICTIONS for entitquery
by nmatrix9
Hello EJB 3.0 Users
I've just noticed that creates class that extends EntityQuery, some generated classes do NOT have any restrictsion set in the RESTRICTIONS array. I tried to find out why but so far I have not found any useful information on this. Anyways I have a class called ExoshellUsersRolesList that extends EntityQuery (originally generated by Seam-Gen) to which it did not have it's RESTRICTIONS array set. So I decided I would manually set the array myself like so.
package com.domain.exoshellcms.session;
import com.domain.exoshellcms.entity.*;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.framework.EntityQuery;
import java.util.List;
import java.util.Arrays;
@Name("exoshellUserRolesList")
@Scope(ScopeType.SESSION)
public class ExoshellUserRolesList extends EntityQuery {
/* UNABLE TO GET RESTRICTIONS TO WORK WITHOUT POINTING TO NULL PARENT OBJECT I.E. exoshellUsers, exoshellRoles or exoshellModules */
private static final String[] RESTRICTIONS = {
"lower(users.username) like concat(lower(#{exoshellUserRolesList.exoshellUserRoles.exoshellUsers.username}),'%')",
"lower(exoshellUserRoles.exoshellRoles.roleName) like concat(lower(#{exoshellUserRolesList.exoshellUserRoles.exoshellRoles.roleName}),'%')",
"lower(exoshellUserRoles.exoshellModules.moduleName) like concat(lower(#{exoshellUserRolesList.exoshellUserRoles.exoshellModules.moduleName}),'%')"
};
private ExoshellUserRoles exoshellUserRoles = new ExoshellUserRoles();
private String queryString = new String("select exoshellUserRoles, users from ExoshellUserRoles exoshellUserRoles join fetch exoshellUserRoles.exoshellUsers users");
@Override
public String getEjbql() {
return queryString;
}
public ExoshellUserRoles getExoshellUserRoles() {
return exoshellUserRoles;
}
@Override
public List getRestrictions() {
return Arrays.asList(RESTRICTIONS);
}
@Override
public String getOrder() {
return new String("exoshellUserRoles.userRolesId asc");
}
}
I then created a corresponding interface form to search through a datable using the ExoshellUsersList like so:
<rich:simpleTogglePanel label="User Roles search parameters" switchType="ajax" opened="false" ignoreDupResponses="true" eventsQueue="userSearchQueue" requestDelay="2000" immediate="true" rendered="false">
<s:decorate template="/layout/display.xhtml">
<ui:define name="label">User Name</ui:define>
<h:inputText id="userRoleName" value="#{exoshellUserRolesList.exoshellUserRoles.exoshellUsers.username}">
<a:support event="onblur" reRender="panelusers,userRolesPaginator" ignoreDupResponses="true"/>
</h:inputText>
</s:decorate>
<s:decorate template="/layout/display.xhtml">
<ui:define name="label">Role Name</ui:define>
<h:inputText id="userRoleRolename" value="#{exoshellUserRolesList.exoshellUserRoles.exoshellRoles.roleName}">
<a:support event="onblur"/>
</h:inputText>
</s:decorate>
<s:decorate template="/layout/display.xhtml">
<ui:define name="label">Module</ui:define>
<h:inputText id="userRoleModule" value="#{exoshellUserRolesList.exoshellUserRoles.exoshellModules.moduleName}">
<a:support event="onblur"/>
</h:inputText>
</s:decorate>
</rich:simpleTogglePanel>
Unfortunately this was not enough as when I try to input text into one of the search fields (like User Name) upon ajax update I get the error:
Exception during request processing:
Caused by javax.servlet.ServletException with message: "/admin/ExoshellUserRolesEdit.xhtml @339,122 value="#{exoshellUserRolesList.exoshellUserRoles.exoshellUsers.username}": Target Unreachable, 'exoshellUsers' returned null on 'com.domain.exoshellcms.entity.ExoshellUserRoles'"
Any insight, documentation or solutions to the exception above would be greatly appreciated. I've include the relied upon EJB entities below after this post.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262077#4262077
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262077
16 years, 6 months
[JBoss Cache Users] - Re: Buddy location issue
by thogha
Sorry, I wiped out my original post in the preview.
I'm trying to get buddy replication working. I'm running two servers, each with one instance of 3.1.0 inside Tomcat. Here is the error (from catalina.out):
| Oct 25, 2009 7:26:45 PM org.jgroups.JChannel init
| INFO: JGroups version: 2.6.7.GA
|
| -------------------------------------------------------
| GMS: address is 127.0.1.1:7800
| -------------------------------------------------------
| Oct 25, 2009 7:26:48 PM org.jboss.cache.RPCManagerImpl$MembershipListenerAdaptor viewAccepted
| INFO: Received new cluster view: [127.0.1.1:7800|0] [127.0.1.1:7800]
| Oct 25, 2009 7:26:48 PM org.jboss.cache.RPCManagerImpl start
| INFO: Cache local address is 127.0.1.1:7800
| Oct 25, 2009 7:26:48 PM org.jboss.cache.buddyreplication.NextMemberBuddyLocator locateBuddies
| INFO: Expected to look for 1 buddies but could only find 0 suitable candidates - trying with colocated buddies as well.
| Oct 25, 2009 7:26:48 PM org.jboss.cache.buddyreplication.NextMemberBuddyLocator locateBuddies
| INFO: Expected to look for 1 buddies but could only find 0 suitable candidates - trying again, ignoring buddy pool hints.
| Oct 25, 2009 7:26:48 PM org.jboss.cache.buddyreplication.NextMemberBuddyLocator locateBuddies
| INFO: Expected to look for 1 buddies but could only find 0 suitable candidates - trying with colocated buddies as well.
| Oct 25, 2009 7:26:48 PM org.jboss.cache.buddyreplication.NextMemberBuddyLocator locateBuddies
| INFO: Expected to look for 1 buddies but could only find 0 suitable candidates!
|
And here is JBossCacheConfiguration.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
| <eviction wakeUpInterval="500">
| <default algorithmClass="org.jboss.cache.eviction.LFUAlgorithm" eventQueueSize="1000000">
| <property name="minNodes" value="1000000" />
| <property name="maxNodes" value="2000000" />
| </default>
| </eviction>
|
| <clustering mode="invalidation" clusterName="cluster1">
| <sync />
|
| <buddy enabled="true" poolName="buddyPool1" communicationTimeout="2000">
| <dataGravitation auto="false" removeOnFind="false" searchBackupTrees="false" />
| <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
| <properties>
| numBuddies = 1
| ignoreColocatedBuddies = true
| </properties>
| </locator>
| </buddy>
|
| <jgroupsConfig>
| <TCP
| start_port="7800"
| discard_incompatible_packets="true"
| enable_bundling="false"
| enable_diagnostics="true"
| enable_unicast_bundling="false"
| loopback="false"
| max_bundle_size="64000"
| max_bundle_timeout="30"
| oob_thread_pool.enabled="true"
| oob_thread_pool.keep_alive_time="10000"
| oob_thread_pool.max_threads="8"
| oob_thread_pool.min_threads="2"
| oob_thread_pool.queue_enabled="false"
| oob_thread_pool.queue_max_size="10"
| oob_thread_pool.rejection_policy="Run"
| recv_buf_size="20000000"
| thread_naming_pattern="pl"
| thread_pool.enabled="true"
| thread_pool.keep_alive_time="30000"
| thread_pool.max_threads="4"
| thread_pool.min_threads="1"
| thread_pool.queue_enabled="true"
| thread_pool.queue_max_size="10000"
| thread_pool.rejection_policy="discard"
| use_concurrent_stack="true"
| use_send_queues="false" />
| <MPING mcast_addr="232.1.2.3" num_initial_members="3" timeout="2000" />
| <MERGE2 max_interval="30000" min_interval="10000" />
| <FD_SOCK />
| <FD max_tries="5" shun="true" timeout="10000" />
| <VERIFY_SUSPECT timeout="1500" />
| <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false" />
| <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000" />
| <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000" view_bundling="true" />
| <FC max_credits="1000000" min_threshold="0.20" />
| <FRAG2 frag_size="60000" />
| <pbcast.STREAMING_STATE_TRANSFER />
| <pbcast.FLUSH timeout="0" />
| </jgroupsConfig>
| </clustering>
| </jbosscache>
|
How does one diagnose and solve this problem?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262060#4262060
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262060
16 years, 6 months