[jboss-user] [JBoss Seam] - Re: Multiple DataModels in an SFSB

fernando_jmt do-not-reply at jboss.com
Wed Feb 7 22:02:21 EST 2007


"gavin.king at jboss.com" wrote : @Factory(scope=EVENT|STATELESS)

Related to this I have some troubles, maybe you can help me.

I have this code:

  | @Statefull
  | @Name("userList")
  | @Scope(ScopeType.SESSION)
  | public class UserList {
  | 
  | @DataModel
  | private List<User> users;
  | 
  | @Factory("users")
  |     public void findUsers() {
  |       users = em.createQuery..........
  |     }
  | 
  | }
  | 

The above code works fine, but the problem  I have is that the user list is only fill up the first time.

Then I change the @Factory code (according your comment) as follows:


  | @Factory(value="users", scope=ScopeType.EVENT)
  |     public void findUsers() {
  |       users = em.createQuery..........
  |     }
  | 
  | 

But, doing this change I always get this exception:


  | 22:46:29,203 ERROR [D2DFaceletViewHandler] Problem in renderResponse: factory method with defined scope outjected a value:
  | users
  | java.lang.IllegalArgumentException: factory method with defined scope outjected a value: users
  |         at org.jboss.seam.Component.handleFactoryMethodResult(Component.java:1745)
  |         at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1719)
  |         at org.jboss.seam.Component.getInstance(Component.java:1655)
  |         at org.jboss.seam.Component.getInstance(Component.java:1632)
  |         at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:105)
  |         at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
  |         at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
  |         at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
  |         at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183)
  |         at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
  |         at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
  |         at javax.faces.component.UIData.getValue(UIData.java:1019)
  |         at com.icesoft.faces.component.panelseries.UISeries.getDataModel(UISeries.java:304)
  |         at com.icesoft.faces.component.panelseries.UISeries.processCurrentRowData(UISeries.java:132)
  |         at com.icesoft.faces.component.panelseries.UISeries.setRowIndex(UISeries.java:124)
  |         at javax.faces.component.html.HtmlDataTable.encodeBegin(HtmlDataTable.java:43)
  |         at com.icesoft.faces.component.panelseries.UISeries.encodeBegin(UISeries.java:245)
  |         at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:579)
  |         at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
  |         at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
  |         at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
  |         at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
  |         at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
  |         at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
  |         at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
  |         at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:586)
  |         at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:276)
  |         at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:149)
  |         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
  |         at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:406)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  |         at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:85)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  |         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  |         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  |         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
  |         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  |         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  |         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  |         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  |         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
  |         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:66
  | 4)
  |         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  |         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
  |         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
  |         at java.lang.Thread.run(Thread.java:595)
  | 
  | 


I also tried using an Stateless component:


  | @Stateless
  | @Name("userList")
  | @Scope(ScopeType.STATELESS)
  | public class UserList {
  | 
  | @DataModel
  | private List<User> users;
  | 
  | @Factory(value="users", scope=ScopeType.STATELESS)
  |     public void findUsers() {
  |       users = em.createQuery..........
  |     }
  | 
  | }
  | 

But trying that I get the same exception.

Is there something I'm doing wrong?

Is there some bug there?


I hope you can help me.

Thanks in advance.

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

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



More information about the jboss-user mailing list