[jboss-user] [JBoss Seam] - create method not found + @Factory

Basel do-not-reply at jboss.com
Fri Jul 14 13:26:56 EDT 2006


Hello,

I am trying to cerate a new entry, entity bean, using three pages with the help of jBPM similar to the example illustrated  in jbossworld-seam-lab.zip file. These three pages are going to be used in a RESTful application that follows the blog example.

So, I have a data entry page called newentry.jsf, similar to the bolg example, that has a reference to a variable created with the help of the @Factory annotation. In that page the variable is referenced just like any bean:

  | <h:inputText id="title" value="#{newEntry.title}"
  |     size="70" maxlength="70" required="true"/>
  | 

The method that creates the variable is in a stateful session bean, to take advantage of jBPM pageflow:

  | @Stateful
  | @Name("postAction")
  | public class PostAction implements PostActionInterface{
  | 	
  | 	@In(create=true)
  | 	private Category category;
  | 	
  | 	//@In(create=false, value="newEntry")
  | 	@In(create=false)
  | 	private Entry entry;
  | 	
  | 	@Factory("newEntry")
  | 	public void createNewEntry(){
  | 		entry = new Entry(category);
  | 	}
  | 	
  | 	@Logger
  | 	private Log log;
  | 	
  | 	//@Begin(pageflow="new-entry", join=true)
  | 	@Begin(pageflow="new-entry")
  | 	public void startPost(){
  | 		log.info("Starting to create a new post");
  | 	}
  | 	
  | 	@Remove @Destroy
  | 	public void destroy(){}
  | }
  | 

As you might have noticed, there is a page event in pages.xml that is supposed to call startPost() method in order to start a new conversation:

  | <page view-id="/newentry.jsf" action="#{postAction.startPost}"/>
  | 

Unfortunately, when I try to access the newentry.jsf page I get the following stacktrace:

  | SEVERE: Error Rendering View[/newentry.xhtml]
  | java.lang.IllegalArgumentException: create method not found
  |         at org.jboss.seam.Component.callComponentMethod(Component.java:1342)
  |         at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1293)
  |         at org.jboss.seam.Component.getInstance(Component.java:1260)
  |         at org.jboss.seam.Component.getInstance(Component.java:1246)
  |         at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
  |         at com.sun.faces.el.VariableResolverChainWrapper.getValue(VariableResolverChainWrapper.java:71)
  |         at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:135)
  |         at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:58)
  |         at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
  |         at com.sun.el.parser.AstValue.getValue(AstValue.java:106)
  |         at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
  |         at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
  |         at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
  |         at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:100)
  |         at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:282)
  |         at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:208)
  |         at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:847)
  |         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:893)
  |         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:889)
  |         at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
  |         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:827)
  |         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:883)
  |         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:889)
  |         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:552)
  |         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
  |         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
  |         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
  |         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
  |         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:45)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  |         at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  |         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  |         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.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  |         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
  |         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
  |         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:664)
  |         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  |         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  |         at java.lang.Thread.run(Thread.java:595)
  | Caused by: java.lang.NoSuchMethodException: $Proxy275.createNewEntry()
  |         at java.lang.Class.getMethod(Class.java:1581)
  |         at org.jboss.seam.Component.callComponentMethod(Component.java:1331)
  |         ... 52 more
  | 19:54:41,948 INFO  [SeamExceptionFilter] killing transaction
  | 

I forgot to mention that the entity bean entry is only annotated with @Entity. What did I do worng?

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

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



More information about the jboss-user mailing list