[jboss-user] [JBoss Seam] - Problem with Stateful SessionBean

jrosskopf do-not-reply at jboss.com
Wed Dec 13 14:20:35 EST 2006


Hello,

I have a stateful SessionBean which should be a facade to my Entities, etc.
It is declared as following:

  | @Stateful
  | 
  | @Name("currentUser")
  | @Scope(ScopeType.CONVERSATION)
  | public class UserFacadeBean implements UserFacade {
  | 	public static final String LOGIN_SUCCESS = "login_success";
  | 	public static final  String LOGIN_FAILED = "login_failed";
  | 	
  | 	@Logger
  | 	Log log;
  | 	
  | 	String username = new String("");
  | 	String password = new String ("");
  | 	
  | 	public String getPassword() {
  | 		return password;
  | 	}
  | 	public void setPassword(String password) {
  | 		this.password = password;
  | 	}
  | 	public String getUsername() {
  | 		return username;
  | 	}
  | 	public void setUsername(String username) {
  | 		this.username = username;
  | 	}
  | 	
  | 	public String login() {
  | 		log.info("Trying to log in \"" + username + "\" with password \"" + password + "\";");
  | 		
  | 		return LOGIN_SUCCESS;
  | 	}
  | 	
  | 	@Destroy @Remove 
  | 	public void destroy() {
  | 		log.info("Destroying ...");
  | 	}
  | }
  | 

I tried to deploy the application (faclets and ICEFaces), but the component was´t recognized by seam.

So I tried to declare the component in components.xml. Now I get the confusing error:

  | 20:10:50,062 INFO  [Component] Component: currentUser, scope: SESSION, type: STATEFUL_SESSION_BEAN, class: de.yourule.facade.UserFacadeBean,
  |  JNDI: yourule/UserFacadeBean/local
  | 20:10:50,062 ERROR [[/yourule]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListene
  | r
  | java.lang.IllegalArgumentException: Stateful session bean component should have a method marked @Remove @Destroy: currentUser
  |         at org.jboss.seam.Component.checkDestroyMethod(Component.java:322)
  |         at org.jboss.seam.Component.<init>(Component.java:254)
  | .
  | .
  | .
  | 

And I really don´t understand, whats going wrong.
Any help appreciated! Thank you in advance.

Regards
---
Joachim

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

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




More information about the jboss-user mailing list