#
desmat
I've just installed cuyahoga and I'm using MySQL. I'm now at step 4. of the install.txt wich says
"Open a web browser and go to the web site administration with user 'admin' and password 'hyena'"
I'm getting the following error after clicking on the [Login] button... What can be wrong ? my connection string ?
-----------
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 496: crit.Add(Expression.Eq("UserName", username));
Line 497: crit.Add(Expression.Eq("Password", password));
Line 498: IList results = crit.List();
Line 499: if (results.Count == 1)
Line 500: {
Source File: C:\Inetpub\wwwroot\Cuyahoga\Core\Service\CoreRepository.cs Line: 498
Stack Trace:
[InvalidCastException: Specified cast is not valid.]
System.Convert.ToInt64(Object value) +16
MySql.Data.MySqlClient.NativeDriver.Configure(MySqlConnection connection) +52
MySql.Data.MySqlClient.MySqlConnection.Open() +195
NHibernate.Connection.DriverConnectionProvider.GetConnection() +112
[ADOException: Could not create connection from Driver]
NHibernate.Connection.DriverConnectionProvider.GetConnection() +150
NHibernate.Impl.SessionFactoryImpl.OpenConnection() +37
[ADOException: cannot open connection]
NHibernate.Impl.SessionFactoryImpl.OpenConnection() +80
NHibernate.Impl.SessionImpl.get_Connection() +28
NHibernate.Impl.BatcherImpl.Prepare(IDbCommand command) +245
NHibernate.Impl.BatcherImpl.ExecuteReader(IDbCommand cmd) +25
NHibernate.Loader.Loader.GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session) +244
NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) +300
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) +75
NHibernate.Loader.CriteriaLoader.List(ISessionImplementor session) +503
NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) +349
[ADOException: problem in find]
NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) +409
NHibernate.Impl.CriteriaImpl.List() +12
Cuyahoga.Core.Service.CoreRepository.GetUserByUsernameAndPassword(String username, String password) in C:\Inetpub\wwwroot\Cuyahoga\Core\Service\CoreRepository.cs:498
Cuyahoga.Web.HttpModules.AuthenticationModule.AuthenticateUser(String username, String password, Boolean persistLogin) in C:\Inetpub\wwwroot\Cuyahoga\Web\HttpModules\AuthenticationModule.cs:49
[Exception: Unable to log in user 'admin': problem in find]
Cuyahoga.Web.HttpModules.AuthenticationModule.AuthenticateUser(String username, String password, Boolean persistLogin) in C:\Inetpub\wwwroot\Cuyahoga\Web\HttpModules\AuthenticationModule.cs:78
Cuyahoga.Web.Admin.Login.btnLogin_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\Cuyahoga\Web\Login.aspx.cs:57
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
------------
Here's what is in my web.config for the mysql part:
add key="hibernate.dialect" value="NHibernate.Dialect.MySQLDialect" />
add key="hibernate.connection.driver_class" value="NHibernate.Driver.MySqlDataDriver" />
add key="hibernate.connection.connection_string" value="server=127.0.0.1; user id=root; password=*******; database=cuyahoga; pooling=false;" />
"Open a web browser and go to the web site administration with user 'admin' and password 'hyena'"
I'm getting the following error after clicking on the [Login] button... What can be wrong ? my connection string ?
-----------
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 496: crit.Add(Expression.Eq("UserName", username));
Line 497: crit.Add(Expression.Eq("Password", password));
Line 498: IList results = crit.List();
Line 499: if (results.Count == 1)
Line 500: {
Source File: C:\Inetpub\wwwroot\Cuyahoga\Core\Service\CoreRepository.cs Line: 498
Stack Trace:
[InvalidCastException: Specified cast is not valid.]
System.Convert.ToInt64(Object value) +16
MySql.Data.MySqlClient.NativeDriver.Configure(MySqlConnection connection) +52
MySql.Data.MySqlClient.MySqlConnection.Open() +195
NHibernate.Connection.DriverConnectionProvider.GetConnection() +112
[ADOException: Could not create connection from Driver]
NHibernate.Connection.DriverConnectionProvider.GetConnection() +150
NHibernate.Impl.SessionFactoryImpl.OpenConnection() +37
[ADOException: cannot open connection]
NHibernate.Impl.SessionFactoryImpl.OpenConnection() +80
NHibernate.Impl.SessionImpl.get_Connection() +28
NHibernate.Impl.BatcherImpl.Prepare(IDbCommand command) +245
NHibernate.Impl.BatcherImpl.ExecuteReader(IDbCommand cmd) +25
NHibernate.Loader.Loader.GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session) +244
NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) +300
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) +75
NHibernate.Loader.CriteriaLoader.List(ISessionImplementor session) +503
NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) +349
[ADOException: problem in find]
NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) +409
NHibernate.Impl.CriteriaImpl.List() +12
Cuyahoga.Core.Service.CoreRepository.GetUserByUsernameAndPassword(String username, String password) in C:\Inetpub\wwwroot\Cuyahoga\Core\Service\CoreRepository.cs:498
Cuyahoga.Web.HttpModules.AuthenticationModule.AuthenticateUser(String username, String password, Boolean persistLogin) in C:\Inetpub\wwwroot\Cuyahoga\Web\HttpModules\AuthenticationModule.cs:49
[Exception: Unable to log in user 'admin': problem in find]
Cuyahoga.Web.HttpModules.AuthenticationModule.AuthenticateUser(String username, String password, Boolean persistLogin) in C:\Inetpub\wwwroot\Cuyahoga\Web\HttpModules\AuthenticationModule.cs:78
Cuyahoga.Web.Admin.Login.btnLogin_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\Cuyahoga\Web\Login.aspx.cs:57
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
------------
Here's what is in my web.config for the mysql part:
add key="hibernate.dialect" value="NHibernate.Dialect.MySQLDialect" />
add key="hibernate.connection.driver_class" value="NHibernate.Driver.MySqlDataDriver" />
add key="hibernate.connection.connection_string" value="server=127.0.0.1; user id=root; password=*******; database=cuyahoga; pooling=false;" />