These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: same code, different computer: assembly loading exception
PostPosted: Wed Aug 06, 2008 2:49 pm 
Newbie

Joined: Wed Aug 06, 2008 2:29 pm
Posts: 5
Hello,

I am able to run my NHibernate program on another computer. On my second computer, however, I am getting an odd Exception:

Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The data present in the reparse point buffer is invalid. (Exception from HRESULT: 0x80071128)

I have tried explicitly adding System.EnterpriseServices and System.Transactions to References, but I get the same result. I am getting this exception when doing ICriteria.List<T>(). Here is all the relevant code - the exception is thrown on the last line.


IConfigurableApplicationContext contextRegistry = (IConfigurableApplicationContext)Spring.Context.Support.ContextRegistry.GetContext();
ISessionFactory sessionFactory = (ISessionFactory)contextRegistry.GetObject("SessionFactory");
session = sessionFactory.OpenSession();
ICriteria criteria;
criteria = session.CreateCriteria(typeof(Edfx.MomConf.ChannelConf));
IList<Edfx.MomConf.ChannelConf> result = criteria.List<Edfx.MomConf.ChannelConf>();



NHibernate version:
1.2.0.4000

Both computers have Studio 2005.

Full stack trace of any exception that occurs:

2008-08-06 14:31:54,071 [12] INFO NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.Oracle9Dialect
2008-08-06 14:31:54,071 [12] INFO NHibernate.Connection.ConnectionProviderFactory - Initializing connection provider: NHibernate.Connection.DriverConnectionProvider
2008-08-06 14:31:54,071 [12] INFO NHibernate.Connection.ConnectionProvider - Configuring ConnectionProvider
2008-08-06 14:31:54,086 [12] INFO NHibernate.Cfg.SettingsFactory - Optimize cache for minimal puts: False
2008-08-06 14:31:54,086 [12] INFO NHibernate.Cfg.SettingsFactory - Connection release mode: auto
2008-08-06 14:31:54,086 [12] INFO NHibernate.Cfg.SettingsFactory - Query translator: NHibernate.Hql.Classic.ClassicQueryTranslatorFactory
2008-08-06 14:31:54,086 [12] INFO NHibernate.Cfg.SettingsFactory - Query language substitutions: {}
2008-08-06 14:31:54,086 [12] INFO NHibernate.Cfg.SettingsFactory - cache provider: NHibernate.Cache.NoCacheProvider, NHibernate, Version=1.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
2008-08-06 14:31:54,086 [12] INFO NHibernate.Impl.SessionFactoryImpl - building session factory
2008-08-06 14:31:54,180 [12] INFO NHibernate.Impl.SessionFactoryObjectFactory - no name configured
2008-08-06 14:31:54,305 [12] INFO NHibernate.Loader.Loader - SELECT this_.CHAN_ID as CHAN1_3_0_, this_.CHAN_NAME as CHAN2_3_0_, this_.CHAN_TOPIC as CHAN3_3_0_ FROM TMOM_CHAN this_
2008-08-06 14:31:54,352 [12] WARN NHibernate.Util.ADOExceptionReporter - NHibernate.ADOException: cannot open connection ---> System.IO.FileLoadException: Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The data present in the reparse point buffer is invalid. (Exception from HRESULT: 0x80071128)
File name: 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.Runtime.InteropServices.COMException (0x80071128): The data present in the reparse point buffer is invalid. (Exception from HRESULT: 0x80071128)
at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Transactions.Transaction.get_EnterpriseServicesOk()
at System.Transactions.Transaction.FastGetTransaction(TransactionScope currentScope, ContextData contextData, Transaction& contextTransaction)
at System.Transactions.Transaction.get_Current()
at System.Data.Common.ADP.GetCurrentTransaction()
at System.Data.ProviderBase.DbConnectionPool.GetFromTransactedPool(Transaction& transaction)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OracleClient.OracleConnection.Open()
at NHibernate.Connection.DriverConnectionProvider.GetConnection()
at NHibernate.Impl.SessionFactoryImpl.OpenConnection()


--- End of inner exception stack trace ---
at NHibernate.Impl.SessionFactoryImpl.OpenConnection()
at NHibernate.Impl.ConnectionManager.GetConnection()
at NHibernate.Impl.BatcherImpl.Prepare(IDbCommand cmd)
at NHibernate.Impl.BatcherImpl.ExecuteReader(IDbCommand cmd)
at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session)
2008-08-06 14:31:54,352 [12] ERROR NHibernate.Util.ADOExceptionReporter - cannot open connection
2008-08-06 14:31:54,352 [12] WARN NHibernate.Util.ADOExceptionReporter - System.IO.FileLoadException: Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The data present in the reparse point buffer is invalid. (Exception from HRESULT: 0x80071128)
File name: 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.Runtime.InteropServices.COMException (0x80071128): The data present in the reparse point buffer is invalid. (Exception from HRESULT: 0x80071128)
at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Transactions.Transaction.get_EnterpriseServicesOk()
at System.Transactions.Transaction.FastGetTransaction(TransactionScope currentScope, ContextData contextData, Transaction& contextTransaction)
at System.Transactions.Transaction.get_Current()
at System.Data.Common.ADP.GetCurrentTransaction()
at System.Data.ProviderBase.DbConnectionPool.GetFromTransactedPool(Transaction& transaction)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OracleClient.OracleConnection.Open()
at NHibernate.Connection.DriverConnectionProvider.GetConnection()
at NHibernate.Impl.SessionFactoryImpl.OpenConnection()


2008-08-06 14:31:54,352 [12] ERROR NHibernate.Util.ADOExceptionReporter - Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The data present in the reparse point buffer is invalid. (Exception from HRESULT: 0x80071128)
2008-08-06 14:31:54,352 [12] WARN NHibernate.Util.ADOExceptionReporter - System.Runtime.InteropServices.COMException (0x80071128): The data present in the reparse point buffer is invalid. (Exception from HRESULT: 0x80071128)
2008-08-06 14:31:54,352 [12] ERROR NHibernate.Util.ADOExceptionReporter - The data present in the reparse point buffer is invalid. (Exception from HRESULT: 0x80071128)


Name and version of the database you are using:

Oracle (unsure of version)

The generated SQL (show_sql=true):

SELECT this_.CHAN_ID as CHAN1_3_0_, this_.CHAN_NAME as CHAN2_3_0_, this_.CHAN_TOPIC as CHAN3_3_0_ FROM TMOM_CHAN this_

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 07, 2008 2:40 am 
Newbie

Joined: Thu Aug 07, 2008 2:08 am
Posts: 3
One thing I would check is if on both computers the same version of the .NET Framework is installed, because to me, it seems that your Application is trying to load the System.EnterpriseServices of version 2.0.0.0.

If you may not have installed .NET Framework 2.0 on your second computer, your Application won't find the correct Assembly and therefore you get the "Could not load"-Error.

Otherwise if you don't have installed the correct .NET Framework, the Application should not start at all.

Maybe try to do a repair-install of the .NET Framework :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 07, 2008 3:46 pm 
Newbie

Joined: Wed Aug 06, 2008 2:29 pm
Posts: 5
Thanks Doc, I am able to get the exception with the following program:

static void Main(string[] args)
{
System.EnterpriseServices.Activity a;
}

So this clearly has nothing to do with NHibernate.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.