Hi I am getting
javax.el.ELException: /configure/basicSetup/groups.jsp @66,107 rendered="#{s:hasPermission('Configure','Edit')}": org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.sec.ezeeAdmin.User.roles, no session or session was closed
I am calling the s:hasPermission method in jsp like this-->>
<rich:column width="80" style="text-align: center;" rendered="#{s:hasPermission('Configure','Edit')}"> <a:commandLink action="#{admGroupsAction.editGroups(group) }" oncomplete="#{rich:component('groupsDlg')}.show()" ajaxSingle="true" reRender="groupsDlg"> <h:graphicImage value="/images/edit_green.gif" />
</a:commandLink>
inside s:hasPermission method i am using another method like this-->>>
@Transient public HashMap<String, List<Action>> getUserRights() { if(this.userRights == null) { System.out.println("Loading user rights"); userRights = new HashMap<String, List<Action>>(); for(Role role: getRoles()) { for(FunctionRight function: role.getFunctions()) { List<Action> possibleActions = new ArrayList<Action>(); for(Action action: function.getActions()) { possibleActions.add(action); } userRights.put(function.getFunction().getSymbol(), possibleActions); } } for(FunctionRight function: getFunctions()) { List<Action> possibleActions = new ArrayList<Action>(); for(Action action: function.getActions()) { possibleActions.add(action); } userRights.put(function.getFunction().getSymbol(), possibleActions); } } return userRights; }
In the above method iam getting no seesion pbm in this line-->>
for(Role role: getRoles())
(while calling the get role() )
I declared get role like this--->>>
@ManyToMany(targetEntity=Role.class, fetch = FetchType.LAZY) @JoinTable(name="um_user_role", joinColumns=@JoinColumn(name="user_id"), inverseJoinColumns=@JoinColumn(name="role_id")) public List<Role> getRoles() { return this.roles; } public void setRoles(List<Role> roles) { this.roles = roles; }
in this java class i declared session like this--->>
@Scope(SESSION)
but iam getting session not there pbm !!!!!!!!!
|