last day (14 days later) » 

4:55 AM
@rembo
hi
 
hi
 
not error
but values are null
 
and?
 
@Repository(value="loginDao")
@Transactional(propagation=Propagation.REQUIRED)

public class LoginDaoImpl extends BaseDao implements LoginDao
{
private static final Logger logger = Logger.getLogger(LoginDaoImpl.class);

@Autowired
private SessionFactory sessionFactory;

public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}


/* (non-Javadoc)
* @see com.boxco.blip.dao.LoginDao#getUserDetailsByLoginId(java.lang.String)
*/
@Transactional
@Override
public User getUserDetailsByLoginId(String loginId) {
 
like: SessionFactory?
 
4:56 AM
this is my Dao
 
k
 
in log file
userId::admin@eanda.co.in
passwordblip@3rp
user3:
user4:null
 
get session by getCurrentSession() instead of Session session = sessionFactory.openSession();
 
nope ...it should be always openSession();
u can google for it
 
@AditiK why? any specific reason?
 
5:01 AM
for dao call it will be always open session bcz bean init for the first time
this issue is regarding my SessionFactory creation or call
i am nt getting exact error
thts my problem
 
@AditiK the error is not SessionFactory at all, if sessionFactory issue, then SessionFactory will be null, So the problem is in somewhere else..
check use is exists in DB..
but you reffering blog is about pure hibernate application,,,
in spring mvc app am always using Session like:
@Autowired
	private SessionFactory sessionFactory;

	private Session getCurrentSession(){
		return sessionFactory.getCurrentSession();
	}
 
ok..
 
but this is not a issue..
 
my base dao is
@Repository
public abstract class BaseDao {

@Autowired
@Qualifier("sessionFactory")
protected SessionFactory sessionFactory;

public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}

public Session getSession() {
return sessionFactory.getCurrentSession();
}
which m extending to login
At login screen i get error bcz of null ser details
here is my service
 
i get error bcz of null ser details..
can you post complete message..
 
5:14 AM
/* (non-Javadoc)
* @see com.boxco.blip.service.LoginService#authenticateUser(java.lang.String, java.lang.String)
*/
@Override
public UserVo authenticateUser(String userName, String password) throws BLIPException {
logger.info("Entering authenticateUser");
logger.debug("user name trimmed .." + userName.trim());
User user = loginDao.getUserDetailsByLoginId(userName.trim());
if (user == null) {
throw new BLIPException("Invalid User Credentials", ErrorCodes.ERROR_CODE_AUTHENTICATION_FAILED);
}
if (!user.getPassword().equals(password)) {
at login screen I get error
The username or password entered is incorrect.
which is "Invalid User Credentials", ErrorCodes.ERROR_CODE_AUTHENTICATION_FAILED
in above code
table is already in DB
with correct fields
 
ok, then problem might be in:
Criteria criteria = session.createCriteria(User.class);

criteria.add(Restrictions.eq("loginId", loginId).ignoreCase());
check by using createQuery()
or check by using session.get() method if it returns anything?
 

last day (14 days later) »