aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes invoking login method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "invoking login method" Watch "invoking login method" New topic
Author

invoking login method

mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 250
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

Joined: Oct 17, 2001
Posts: 153
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.


Shailesh Kini.
mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 250
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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: invoking login method