背景:本网站使用oracle和spring.net。
Oracle.DataAccess 版本:4.112.2.0
Spring 版本:1.3.2.40943
网络配置文件
<db:provider id="SDDbProvider" provider="Oracle.DataAccess.Client"
connectionString="User Id=****; Password = *****; Data Source = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=****)(PORT=****))(CONNECT_DATA=(SERVER=dedicated)(SERVICE_NAME=*****)))" />
这在调试模式下工作正常。我在本地 IIS (7.5) 上发布了这个网站,它也运行良好。但是当我将发布的文件夹复制到远程服务器(也运行 IIS 7.5)时,它会出现以下错误。
注意:我检查了已发布文件夹中的 bin,它具有 Oracle 所需的所有 DLL
oci
ociw32
Oracle.DataAccess
orannzsbb11
oraocci11
oraociei11
OraOps11w
Error thrown by a dependency of object 'Oracle.DataAccess.Client' defined in 'assembly [Spring.Data, Version=1.3.2.40943, Culture=neutral, PublicKeyToken=65e474d141e25e07], resource [Spring.Data.Common.dbproviders.xml] line 400' : Unsatisfied dependency expressed through constructor argument with index 2 of type [System.Type] : Could not convert constructor argument value [Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342] to required type [System.Type] : Cannot convert property value of type [System.String] to required type [System.Type] for property ''.
while resolving 'constructor argument with name dbmetadata' to 'Spring.Data.Common.DbMetadata#195EA5D' defined in 'assembly [Spring.Data, Version=1.3.2.40943, Culture=neutral, PublicKeyToken=65e474d141e25e07], resource [Spring.Data.Common.dbproviders.xml] line 400'
[UnsatisfiedDependencyException: Error thrown by a dependency of object 'Oracle.DataAccess.Client' defined in 'assembly [Spring.Data, Version=1.3.2.40943, Culture=neutral, PublicKeyToken=65e474d141e25e07], resource [Spring.Data.Common.dbproviders.xml] line 400' : Unsatisfied dependency expressed through constructor argument with index 2 of type [System.Type] : Could not convert constructor argument value [Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342] to required type [System.Type] : Cannot convert property value of type [System.String] to required type [System.Type] for property ''.
while resolving 'constructor argument with name dbmetadata' to 'Spring.Data.Common.DbMetadata#25C456C' defined in 'assembly [Spring.Data, Version=1.3.2.40943, Culture=neutral, PublicKeyToken=65e474d141e25e07], resource [Spring.Data.Common.dbproviders.xml] line 400']
Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolveInnerObjectDefinition(String name, String innerObjectName, String argumentName, IObjectDefinition definition, Boolean singletonOwner) +385
Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolvePropertyValue(String name, IObjectDefinition definition, String argumentName, Object argumentValue) +278
Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolveValueIfNecessary(String name, IObjectDefinition definition, String argumentName, Object argumentValue) +19
Spring.Objects.Factory.Support.ConstructorResolver.ResolveConstructorArguments(String objectName, RootObjectDefinition definition, ObjectWrapper wrapper, ConstructorArgumentValues cargs, ConstructorArgumentValues resolvedValues) +1385
Spring.Objects.Factory.Support.ConstructorResolver.GetConstructorInstantiationInfo(String objectName, RootObjectDefinition rod, ConstructorInfo[] chosenCtors, Object[] explicitArgs) +218
Spring.Objects.Factory.Support.ConstructorResolver.AutowireConstructor(String objectName, RootObjectDefinition rod, ConstructorInfo[] chosenCtors, Object[] explicitArgs) +79
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.CreateObjectInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +278
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) +1204
Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure) +2216
Spring.Objects.Factory.Support.AbstractObjectFactory.GetObject(String name, Type requiredType) +21
Spring.Data.Common.DbProviderFactory.GetDbProvider(String providerInvariantName) +81
Spring.Data.Common.DbProviderFactoryObject.CreateProviderInstance() +18
Spring.Data.Common.DbProviderFactoryObject.GetObject() +205
Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectFromFactoryObject(IFactoryObject factory, String objectName, RootObjectDefinition rod) +98
[ObjectCreationException: Error creating object with name 'SDDbProvider' : FactoryObject threw exception on object creation.]
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +4649821
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375
[HttpException (0x80004005): Error creating object with name 'SDDbProvider' : FactoryObject threw exception on object creation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11529072
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4784373
知道为什么会这样吗?它与远程服务器中的 GAC 有关吗?谢谢