Hi,
I got my WCF service with MySQL-Database (developed with your Designer) running on my local machine.
Now I wanted to test the installation (a Visual Studio Setup project) of this service on two other machines, which fails ;-) The service is installed, the service itself starts but as soon as I try to use the database (which is installed and configured correctly), I get an exception - I don't get the exception if I run the setup and install the service on my developer machine.
So I guess something is missing within my installation package, which is relevant for the database to work.
Besides the .NET Framework my setup consists of the following files (database and O/R related):
05.05.2012 20:54 <DIR> .
05.05.2012 20:54 <DIR> ..
05.05.2012 01:44 125.440 AutoMapper.dll
05.05.2012 01:45 <DIR> bin
05.05.2012 01:46 <DIR> config
05.05.2012 01:45 <DIR> data
05.05.2012 01:45 <DIR> documentation
05.05.2012 01:44 32.768 Iesi.Collections.dll
05.05.2012 01:44 126.976 Service.Enterprise.dll
05.05.2012 01:44 8.192 EnterpriseService.exe
05.05.2012 01:45 7.465 EnterpriseService.InstallState
05.05.2012 01:45 <DIR> license
05.05.2012 01:44 21.504 LinFu.DynamicProxy.DLL
05.05.2012 20:41 8.821 log.txt
05.05.2012 01:44 7.168 NHibernate.ByteCode.LinFu.dll
05.05.2012 01:44 3.016.192 NHibernate.dll
05.05.2012 01:44 212.992 NHibernate.Validator.dll
24.04.2012 22:45 523 NLog.config
05.05.2012 01:44 388.096 NLog.dll
I added "MySql.Data.dll" too manually but still no success.
Because the error only occurs on my non-development machines, I am not able to debug the code, but the error raises within the creation of the sesssion factory:
internal static ISessionFactory SessionFactory
{
get
{
if (_sessionFactory == null)
{
var configuration = ConfigurationHelper.CreateConfiguration();
Enterprise.logger.Debug("Build Sessionfactory"); // till here is fine
_sessionFactory = configuration.BuildSessionFactory();
Enterprise.logger.Debug(_sessionFactory.ToString()); // no log output anymore from here
Enterprise.logger.Debug("Build Sessenfactory Done");
}
return _sessionFactory;
}
}
The session configuration is done via a configuration file (it's the standard CreateConfiguration method):
public static Configuration CreateConfiguration()
{
var configuration = new Configuration();
//configuration.Configure();
Enterprise.logger.Debug(Enterprise.myConfig.DatabaseHost);
Enterprise.logger.Debug(Enterprise.myConfig.DatabasePort);
Enterprise.logger.Debug(Enterprise.myConfig.DatabaseName);
Enterprise.logger.Debug(Enterprise.myConfig.DatabaseUsername);
Enterprise.logger.Debug(Enterprise.myConfig.DatabasePassword);
Enterprise.logger.Debug(Enterprise.myConfig.DatabaseDialect);
if (Enterprise.myConfig.DatabaseDialect == DatabaseDialect.MySQL5Dialect)
{
Enterprise.logger.Debug("Start Database Configuration");
string connection = "Server=" + Enterprise.myConfig.DatabaseHost + ";Port=" + Enterprise.myConfig.DatabasePort + ";Database=" + Enterprise.myConfig.DatabaseName + ";Uid=" + Enterprise.myConfig.DatabaseUsername + ";Pwd=" + Enterprise.myConfig.DatabasePassword + ";";
Enterprise.logger.Debug("Connection String: " + connection);
configuration.SetProperty(NHibernate.Cfg.Environment.Dialect, typeof(NHibernate.Dialect.MySQL5Dialect).AssemblyQualifiedName);
configuration.SetProperty(NHibernate.Cfg.Environment.ConnectionDriver, typeof(NHibernate.Driver.MySqlDataDriver).FullName);
configuration.SetProperty(NHibernate.Cfg.Environment.ConnectionString, connection);
}
else if (Enterprise.myConfig.DatabaseDialect == DatabaseDialect.MsSql2005Dialect)
{
// MS SQL
}
configuration.SetProperty(NHibernate.Cfg.Environment.ProxyFactoryFactoryClass, "NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu");
configuration.SetProperty(NHibernate.Cfg.Environment.ConnectionProvider, typeof(NHibernate.Connection.DriverConnectionProvider).FullName);
Enterprise.logger.Debug("End of Database Configuration");
ApplyConfiguration(configuration);
Enterprise.logger.Debug("Apply Database Configuration");
return configuration;
}
THis is the log from the working service on my developer machine:
2012-05-05 22:41:22.0300|DEBUG|komBAS.Service.Enterprise.EnterpriseWindowsService|Main()
2012-05-05 22:41:22.0300|DEBUG|komBAS.Service.Enterprise.EnterpriseWindowsService|EnterpriseWindowsService()
2012-05-05 22:41:22.0501|DEBUG|komBAS.Service.Enterprise.EnterpriseWindowsService|OnStart()
2012-05-05 22:41:22.2521|DEBUG|komBAS.Service.Enterprise.EnterpriseWindowsService|Service Binding Done
2012-05-05 22:41:35.2528|DEBUG|komBAS.Service.Enterprise.Enterprise|Lade XML File...
2012-05-05 22:41:35.2528|DEBUG|komBAS.Service.Enterprise.Enterprise|XML Single: E:\ASW2EnterpriseServer\config\config.xml
2012-05-05 22:41:35.3768|DEBUG|komBAS.Service.Enterprise.Enterprise|Service Configuration Done.
2012-05-05 22:41:35.3848|DEBUG|komBAS.Service.Enterprise.Enterprise|Login Start
2012-05-05 22:41:35.8158|DEBUG|komBAS.Service.Enterprise.Enterprise|worker
2012-05-05 22:41:35.8158|DEBUG|komBAS.Service.Enterprise.Enterprise|3307
2012-05-05 22:41:35.8158|DEBUG|komBAS.Service.Enterprise.Enterprise|kombas_enterprise
2012-05-05 22:41:35.8158|DEBUG|komBAS.Service.Enterprise.Enterprise|kombas
2012-05-05 22:41:35.8158|DEBUG|komBAS.Service.Enterprise.Enterprise|PASSWORD
2012-05-05 22:41:35.8158|DEBUG|komBAS.Service.Enterprise.Enterprise|MySQL5Dialect
2012-05-05 22:41:35.8158|DEBUG|komBAS.Service.Enterprise.Enterprise|Start Database Configuration
2012-05-05 22:41:35.8158|DEBUG|komBAS.Service.Enterprise.Enterprise|Connection String: Server=worker;Port=3307;Database=kombas_enterprise;Uid=kombas;Pwd=u83uke94%;
2012-05-05 22:41:35.8158|DEBUG|komBAS.Service.Enterprise.Enterprise|End of Database Configuration
2012-05-05 22:41:36.0489|DEBUG|komBAS.Service.Enterprise.Enterprise|Apply Database Configuration
2012-05-05 22:41:36.0489|DEBUG|komBAS.Service.Enterprise.Enterprise|Build Sessionfactory
2012-05-05 22:41:36.4809|DEBUG|komBAS.Service.Enterprise.Enterprise|Build Sessionfactory Done
2012-05-05 22:41:36.4999|DEBUG|komBAS.Service.Enterprise.Enterprise|server=worker;port=3307;database=kombas_enterprise;User Id=kombas
2012-05-05 22:41:36.9279|DEBUG|komBAS.Service.Enterprise.Enterprise|Login:SuperAdmin||a1a5b3b4-2d1b-42fc-a0e0-a07be27941de
And this is the log from my test installation machine (see the error entry 3rd line from below):
=> Column 'ReservedWord' does not belong to table ReservedWords
2012-05-05 22:51:07.0664|DEBUG|komBAS.Service.Enterprise.EnterpriseWindowsService|OnStop()
2012-05-05 22:51:13.2421|DEBUG|komBAS.Service.Enterprise.EnterpriseWindowsService|Main()
2012-05-05 22:51:13.2861|DEBUG|komBAS.Service.Enterprise.EnterpriseWindowsService|EnterpriseWindowsService()
2012-05-05 22:51:13.3232|DEBUG|komBAS.Service.Enterprise.EnterpriseWindowsService|OnStart()
2012-05-05 22:51:13.6611|DEBUG|komBAS.Service.Enterprise.EnterpriseWindowsService|Service Binding Done
2012-05-05 22:51:28.6572|DEBUG|komBAS.Service.Enterprise.Enterprise|Lade XML File...
2012-05-05 22:51:28.6572|DEBUG|komBAS.Service.Enterprise.Enterprise|XML Single: C:\ASW2EnterpriseServer\config\config.xml
2012-05-05 22:51:28.8359|DEBUG|komBAS.Service.Enterprise.Enterprise|Service Configuration Done.
2012-05-05 22:51:28.8486|DEBUG|komBAS.Service.Enterprise.Enterprise|Login Start
2012-05-05 22:51:30.3818|DEBUG|komBAS.Service.Enterprise.Enterprise|worker
2012-05-05 22:51:30.3818|DEBUG|komBAS.Service.Enterprise.Enterprise|3307
2012-05-05 22:51:30.3818|DEBUG|komBAS.Service.Enterprise.Enterprise|kombas_enterprise
2012-05-05 22:51:30.3818|DEBUG|komBAS.Service.Enterprise.Enterprise|kombas
2012-05-05 22:51:30.3818|DEBUG|komBAS.Service.Enterprise.Enterprise|PASSWORD
2012-05-05 22:51:30.3818|DEBUG|komBAS.Service.Enterprise.Enterprise|MySQL5Dialect
2012-05-05 22:51:30.3818|DEBUG|komBAS.Service.Enterprise.Enterprise|Start Database Configuration
2012-05-05 22:51:30.3818|DEBUG|komBAS.Service.Enterprise.Enterprise|Connection String: Server=worker;Port=3307;Database=kombas_enterprise;Uid=kombas;Pwd=u83uke94%;
2012-05-05 22:51:30.3818|DEBUG|komBAS.Service.Enterprise.Enterprise|End of Database Configuration
2012-05-05 22:51:30.8115|DEBUG|komBAS.Service.Enterprise.Enterprise|Apply Database Configuration
2012-05-05 22:51:30.8125|DEBUG|komBAS.Service.Enterprise.Enterprise|Build Sessionfactory
2012-05-05 22:51:31.6025|DEBUG|komBAS.Service.Enterprise.Enterprise|Spalte 'ReservedWord' geh??nicht zu Tabelle ReservedWords. // THis means "Column 'ReservedWord' doesn't belog to table ReservedWords
2012-05-05 22:51:31.6025|DEBUG|komBAS.Service.Enterprise.Enterprise|Build Sessenfactory Done
2012-05-05 22:51:31.6630|DEBUG|komBAS.Service.Enterprise.Enterprise|Loginerror
From my dev machine and the test machine I use the same database, so the error can not be based on the database itself.
Do you have any tips please?
Thanks,
Kay