.net - Oracle.DataAccess.Client Error -
background: website use oracle , spring.net.
version of oracle.dataaccess: 4.112.2.0
version of spring: 1.3.2.40943
webconfig file
<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=*****)))" />
this working fine in debug mode. , publish website on local iis (7.5) & working fine. when copy published folder remote server (also runs iis 7.5) gives folowing errror.
note: checked bin in published folder , has necessary dll oracle
oci
ociw32
oracle.dataaccess
orannzsbb11
oraocci11
oraociei11
oraops11w
error thrown 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 index 2 of type [system.type] : not convert constructor argument value [oracle.dataaccess.client.oracleconnection, oracle.dataaccess, version=2.102.2.20, culture=neutral, publickeytoken=89b483f429c47342] required type [system.type] : cannot convert property value of type [system.string] required type [system.type] property ''. while resolving 'constructor argument name dbmetadata' '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 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 index 2 of type [system.type] : not convert constructor argument value [oracle.dataaccess.client.oracleconnection, oracle.dataaccess, version=2.102.2.20, culture=neutral, publickeytoken=89b483f429c47342] required type [system.type] : cannot convert property value of type [system.string] required type [system.type] property ''. while resolving 'constructor argument name dbmetadata' '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 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 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
any idea why happening? has gac in remote server? thanks
i fixed issue after week guess. thought share experience.
first, error message related spring framework. based on dbprovider specify on our config file (in case it's oracle.dataaccess.client), spring.data dll tries resolve database provider. (more spring dbproviders)
it uses resource file (spring.data.common.dbproviders.xml) resolve this. error thrown following line in dbproviders.xml file. (file location: spring.net/src/spring/spring.data/data/common/dbproviders.xml)
<constructor-arg name="connectiontype" value="oracle.dataaccess.client.oracleconnection, oracle.dataaccess, version=2.102.2.20, culture=neutral, publickeytoken=89b483f429c47342"/>
for reason dbproviders.xml try find oracle.dataaccess dll in gac (windows/assembly/gac). according experience doesn't in bin folder. if can't find dll in gac, throws above error message. installed oracle.dataaccess (version 2.102.4.0) dll in gac using gacutil. think looks version specified in dbproviders.xml. (if i'm wrong please feel free comment here)
that's spring framework. in order work nhibernate should have oracle.dataaccess dll in bin folder(else throws "the provider not compatible version of oracle client" error) , related oracle instant client in same location (else throws "could not load file or assembly 'oracle.dataaccess' or 1 of dependencies. attempt made load program incorrect format." error).
you don't have install oracle client in machine if use oracle instant client (pretty sure knows it). in bin folder put oracle.dataaccess (version 4.112.2.0) , instant client dlls (as mentioned in question). used version 4.112.2.0 because couldn't find instant client dlls version 2.102.4.0. (i know it's mess, that's how works)
so works fine.
small tip: if wants use gacutil in remote server , don't want install .net framework sdk, copy gacutil.exe , gacutil.exe.config file remote server , run form there. make sure use version="v2.0.50727". if use version="v4.0.30319" add dll c:\windows\microsoft.net\assembly instead of c:\windows\assembly.
Comments
Post a Comment