• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

invoking login method

 
mark smith
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i use HSQLD, jboss 4.2 and seam 2

my user class


the login action



my persistence.xml




in the database i done



if i enter the wrong information, i can't login

and i get this message




if i enter the correct information i get


so i would like to know how to avoid theses error when the information entered by the user is bad

any idea?
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,

You are maintaining the State "User" in a stateless session bean. You cannot guarantee that you would get the same instance of the stateless session bean everytime. If you plan to maintain state please switch to Stateful session bean. That should fix your issue. But you have to be very careful to remove the Stateful session bean once you are done.

Alternately you could just return the User from one of the methods in your stateless session bean.

Hope this helps.
 
mark smith
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shailesh Kini:
Hi Mark,

You are maintaining the State "User" in a stateless session bean. You cannot guarantee that you would get the same instance of the stateless session bean everytime. If you plan to maintain state please switch to Stateful session bean. That should fix your issue. But you have to be very careful to remove the Stateful session bean once you are done.

Alternately you could just return the User from one of the methods in your stateless session bean.

Hope this helps.


thank i will try...

i use this technic because Michael Yuan use it in its book... i tried the example in its book and i get the same problem...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic