Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

invoking login method

 
Ranch Hand
Posts: 260
  • 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?
 
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: 260
  • 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...
 
A tiny monkey bit me and I got tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!