Not able to login to leadApp after deploying to tomcat | Selenium Forum
M
Posted on 17/03/2016
Hi Asish ,

As per Module 33 , i have completed all the necessary steps as shown in video. But after deploying the leapapp to tomcat server when i try to login to tomcat application with
url -http://localhost:8080/leadapp/
Username:user@javachap.com
Password: javachap

Error :HTTP Status 500 - com.javachap.service.impl.ServiceException: org.hibernate.exception.GenericJDBCException: Cannot open connection appears on the pages.
type Exception report

message com.javachap.service.impl.ServiceException: org.hibernate.exception.GenericJDBCException: Cannot open connection

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: com.javachap.service.impl.ServiceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

com.javachap.service.impl.ServiceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
com.javachap.service.impl.UserServiceImpl.authenticate(UserServiceImpl.java:53)
com.javachap.web.controller.LoginAction.execute(LoginAction.java:29)
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

org.hibernate.exception.GenericJDBCException: Cannot open connection
org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
org.hibernate.jdbc.AbstractBatcher.openConnection(AbstractBatcher.java:384)
org.hibernate.jdbc.JDBCContext.connect(JDBCContext.java:141)
org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:88)
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:85)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1090)
org.hibernate.loader.Loader.doQuery(Loader.java:362)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:203)
org.hibernate.loader.Loader.doList(Loader.java:1499)
org.hibernate.loader.Loader.list(Loader.java:1482)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:365)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:268)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:782)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
com.javachap.service.impl.UserServiceImpl.authenticate(UserServiceImpl.java:47)
com.javachap.web.controller.LoginAction.execute(LoginAction.java:29)
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:753)
com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3562)
com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1154)
com.mysql.jdbc.Connection.createNewIO(Connection.java:1702)
com.mysql.jdbc.Connection.<init>(Connection.java:405)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
org.hibernate.jdbc.AbstractBatcher.openConnection(AbstractBatcher.java:381)
org.hibernate.jdbc.JDBCContext.connect(JDBCContext.java:141)
org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:88)
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:85)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1090)
org.hibernate.loader.Loader.doQuery(Loader.java:362)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:203)
org.hibernate.loader.Loader.doList(Loader.java:1499)
org.hibernate.loader.Loader.list(Loader.java:1482)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:365)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:268)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:782)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
com.javachap.service.impl.UserServiceImpl.authenticate(UserServiceImpl.java:47)
com.javachap.web.controller.LoginAction.execute(LoginAction.java:29)
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.68 logs.

...............................................................................................................................................................
can you please help me to get out of this?

M
Replied on 17/03/2016

Please reply ASAP as i m stuck into this step and not able to move further before resolving this error.

Thanks.


M
Replied on 17/03/2016

is username and password correct?


M
Replied on 17/03/2016

yes i m using the given credentials

Username:user@javachap.com
Password :javachap


M
Replied on 18/03/2016

[quote:3pupe1l6]java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
[/quote:3pupe1l6]

user is "root". fix that.


M
Replied on 02/05/2016

Hi Ashish,

Could you please let me know where should this be fixed?


M
Replied on 03/05/2016

hi,

change the mysql password for root user from NULL to 'root'

http://askubuntu.com/questions/118772/how-to-change-root-password-for-mysql-and-phpmyadmin

Username = root
Password = root


M
Replied on 03/05/2016

Hi Ashish.

Earlier I was using some other password for root user for which I was not able to login to leadapp.
Now I have changed the root password to "root" and I'm able to login now.

Thanks you so much for the help.

Thanks,
Vamshi M