0 Replies Latest reply on Apr 24, 2009 3:49 PM by Sylvain Catudal

    Error resolving EL in QueryEntity RESTRICTIONS when using SFSB

    Sylvain Catudal Newbie

      A simple call like #{authenticationList.resultList} will cause a ConcurrentAccessException in   TestNG tests while it works perfectly in the runtime environment.

      Here is how it can be reproduced:

      public class AuthenticationListBean extends EntityQuery<Authentication>
                implements AuthenticationList {
           private static final long serialVersionUID = 3302243104496804256L;
           private static final String EJBQL = "select authentication "
                     + "from Authentication authentication inner join fetch "
                     + "authentication.user";
           private static final String[] RESTRICTIONS = 
                { "authentication.user.userId = #{authenticationList.userId}" };
           private Long userId;
           public AuthenticationListBean() {
           public void setUserId(Long userId) {
                this.userId = userId;
           public Long getUserId() {
                return userId;
           public void destroy() {

      Here is a simple TestNG test:

      public void failingTest() throws Exception {
           long countBefore;
           new FacesRequest("/user/authenticationList.xhtml") {
                protected void invokeApplication() throws Exception {
                     countBefore = 
                          (Long) getValue("#{authenticationList.resultCount}");

      If I remove the restriction from the SFSB, everything works like a charm in the test.  Here is the replacing line :

              private static final String[] RESTRICTIONS = {};

      It would be very handy to be able to test EntityQuery objects in TestNG.  I know that it works if I transform my object into a pojo.  But we have decided to use EJBs.

      Thanks for any comments