[jboss-user] [JBoss Seam] - Seam, problem with EntityManager

grdzeli_kaci do-not-reply at jboss.com
Mon Jul 2 03:08:57 EDT 2007


hi all,
i have template using  facelets, i have left menu and body pages, both of them has session beans, in the left menu bean i have generated richfaces HtmlPanelBarItem component, for  leftmenu, in the body page i have richfaces tree componet generated from it's bean. all works fine i see  PanelBar components in the left menu page and tree component on the body page, but then i tried to expand tree i got an exception, that in the left menu bean entitymanager is null :(, here is my example: 
1.faces-config.xml

  |     <managed-bean>
  |         <managed-bean-name>library</managed-bean-name>        <managed-bean-class>com.liliko.billing.businesslayer.beans.common.Library</managed-bean-class>
  |         <managed-bean-scope>request</managed-bean-scope>
  |     </managed-bean>    
  | 
  |     <managed-bean>
  |         <managed-bean-name>menu</managed-bean-name>        <managed-bean-class>com.liliko.billing.businesslayer.beans.common.MenuBean</managed-bean-class>
  |         <managed-bean-scope>session</managed-bean-scope>
  |     </managed-bean>
  | 
2. MenuBean.java

  | @Name("menu")
  | @Scope(ScopeType.SESSION)
  | public class MenuBean {
  |     
  |     @In(value="#{entityManager}")
  |     private EntityManager entityManager;
  |     ............................................
  | 
3. Library.java (body)

  | @Name("library")
  | @Scope(ScopeType.PAGE)
  | public class Library implements TreeNode {
  |     
  |     @In(value="#{entityManager}")
  |     private EntityManager entityManager;
  | ..................................
  | 
exception occured when i tried to expand tree :(, why is the entitymanager null on this time ?
error trace:


  | Caused by: org.jboss.seam.RequiredException: In attribute requires non-null value: menu.#{entityManager}
  |         at org.jboss.seam.Component.getValueToInject(Component.java:1923)
  |         at org.jboss.seam.Component.injectAttributes(Component.java:1372)
  |         at org.jboss.seam.Component.inject(Component.java:1203)
  | 


_________________
Regards,
Paata

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059507#4059507

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059507



More information about the jboss-user mailing list