c# - System.Configuration.ConfigurationErrorsException occurred Error creating context 'spring.root' -- InnerException: Client.OracleException -


presently, attempting debug web application connects oracle database. when run application, receive following error:

system.configuration.configurationerrorsexception occurred   hresult=-2146232062   message=error creating context 'spring.root':    source=system.configuration   baremessage=error creating context 'spring.root':    line=0   stacktrace:      @ system.configuration.baseconfigurationrecord.evaluateone(string[] keys, sectioninput input, boolean istrusted, factoryrecord factoryrecord, sectionrecord sectionrecord, object parentresult)      @ system.configuration.baseconfigurationrecord.evaluate(factoryrecord factoryrecord, sectionrecord sectionrecord, object parentresult, boolean getlkg, boolean getruntimeobject, object& result, object& resultruntimeobject)      @ system.configuration.baseconfigurationrecord.getsectionrecursive(string configkey, boolean getlkg, boolean checkpermission, boolean getruntimeobject, boolean requestishere, object& result, object& resultruntimeobject)      @ system.configuration.baseconfigurationrecord.getsection(string configkey)      @ system.web.httpcontext.getsection(string sectionname)      @ system.web.configuration.httpconfigurationsystem.getsection(string sectionname)      @ system.web.configuration.httpconfigurationsystem.system.configuration.internal.iinternalconfigsystem.getsection(string configkey)      @ system.configuration.configurationmanager.getsection(string sectionname)      @ spring.util.configurationutils.getsection(string sectionname)      @ spring.context.support.contextregistry.initializecontextifneeded()      @ spring.context.support.contextregistry.getcontext()      @ middleware.data.services.servicefactory.get_wellservice() in c:\dev\trunk\middleware\data\services\servicefactory.cs:line 25 innerexception: spring.objects.factory.objectcreationexception      hresult=-2146232832      message=error creating object name 'nhibernatesessionfactory' defined in 'assembly [middleware.data.domainrepository, version=1.0.0.0, culture=neutral, publickeytoken=5c61376b85e43767], resource [middleware.data.domainrepository.persistence.xml] line 15' : initialization of object failed :       source=spring.core      objectname=nhibernatesessionfactory      resourcedescription=assembly [middleware.data.domainrepository, version=1.0.0.0, culture=neutral, publickeytoken=5c61376b85e43767], resource [middleware.data.domainrepository.persistence.xml] line 15      stacktrace:           @ spring.objects.factory.support.abstractautowirecapableobjectfactory.instantiateobject(string name, rootobjectdefinition definition, object[] arguments, boolean alloweagercaching, boolean suppressconfigure)           @ spring.objects.factory.support.abstractobjectfactory.createandcachesingletoninstance(string objectname, rootobjectdefinition objectdefinition, object[] arguments)           @ spring.objects.factory.support.abstractobjectfactory.getobjectinternal(string name, type requiredtype, object[] arguments, boolean suppressconfigure)           @ spring.objects.factory.support.abstractobjectfactory.getobject(string name)           @ spring.objects.factory.support.defaultlistableobjectfactory.getobjectsoftype(type type, boolean includeprototypes, boolean includefactoryobjects)           @ spring.objects.factory.objectfactoryutils.objectsoftypeincludingancestors(ilistableobjectfactory factory, type type, boolean includeprototypes, boolean includefactoryobjects)           @ spring.dao.support.persistenceexceptiontranslationinterceptor.detectpersistenceexceptiontranslators(ilistableobjectfactory objectfactory)           @ spring.dao.support.persistenceexceptiontranslationinterceptor..ctor(ilistableobjectfactory objectfactory)           @ spring.dao.attributes.persistenceexceptiontranslationadvisor..ctor(ilistableobjectfactory objectfactory, type repositoryattributetype)           @ spring.dao.attributes.persistenceexceptiontranslationpostprocessor.set_objectfactory(iobjectfactory value)           @ spring.objects.factory.support.abstractautowirecapableobjectfactory.configureobject(string name, rootobjectdefinition definition, iobjectwrapper wrapper)           @ spring.objects.factory.support.abstractautowirecapableobjectfactory.instantiateobject(string name, rootobjectdefinition definition, object[] arguments, boolean alloweagercaching, boolean suppressconfigure)           @ spring.objects.factory.support.abstractobjectfactory.createandcachesingletoninstance(string objectname, rootobjectdefinition objectdefinition, object[] arguments)           @ spring.objects.factory.support.abstractobjectfactory.getobjectinternal(string name, type requiredtype, object[] arguments, boolean suppressconfigure)           @ spring.objects.factory.support.abstractobjectfactory.getobject(string name)           @ spring.objects.factory.support.defaultlistableobjectfactory.getobjectsoftype(type type, boolean includeprototypes, boolean includefactoryobjects)           @ spring.context.support.abstractapplicationcontext.getobjectsoftype(type type, boolean includeprototypes, boolean includefactoryobjects)           @ spring.context.support.abstractapplicationcontext.registerobjectpostprocessors(iconfigurablelistableobjectfactory objectfactory)           @ spring.context.support.abstractapplicationcontext.refresh()           @ spring.context.support.xmlapplicationcontext..ctor(xmlapplicationcontextargs args)           @ spring.context.support.xmlapplicationcontext..ctor(string name, boolean casesensitive, string[] configurationlocations)           @ _dynamic_spring.context.support.xmlapplicationcontext..ctor(object[] )           @ spring.reflection.dynamic.safeconstructor.invoke(object[] arguments)           @ spring.context.support.contexthandler.rootcontextinstantiator.invokecontextconstructor(constructorinfo ctor)           @ spring.context.support.contexthandler.contextinstantiator.instantiatecontext()           @ spring.context.support.contexthandler.instantiatecontext(iapplicationcontext parentcontext, object configcontext, string contextname, type contexttype, boolean casesensitive, string[] resources)           @ spring.context.support.contexthandler.create(object parent, object configcontext, xmlnode section)      innerexception: oracle.dataaccess.client.oracleexception           hresult=-2147467259           message=""           errorcode=-2147467259           stacktrace:                @ oracle.dataaccess.client.oracleexception.handleerrorhelper(int32 errcode, oracleconnection conn, intptr opserrctx, oposqlvalctx* poposqlvalctx, object src, string procedure, boolean bcheck, int32 isrecoverable)                @ oracle.dataaccess.client.oracleexception.handleerror(int32 errcode, oracleconnection conn, intptr opserrctx, object src)                @ oracle.dataaccess.client.oracleconnection.open()                @ spring.data.nhibernate.localsessionfactoryobject.dbproviderwrapper.getconnection()                @ nhibernate.tool.hbm2ddl.suppliedconnectionproviderconnectionhelper.prepare()                @ nhibernate.tool.hbm2ddl.schemametadataupdater.getreservedwords(dialect dialect, iconnectionhelper connectionhelper)                @ nhibernate.tool.hbm2ddl.schemametadataupdater.update(isessionfactory sessionfactory)                @ nhibernate.impl.sessionfactoryimpl..ctor(configuration cfg, imapping mapping, settings settings, eventlisteners listeners)                @ nhibernate.cfg.configuration.buildsessionfactory()                @ spring.data.nhibernate.localsessionfactoryobject.newsessionfactory(configuration config)                @ spring.data.nhibernate.localsessionfactoryobject.afterpropertiesset()                @ spring.objects.factory.support.abstractautowirecapableobjectfactory.invokeinitmethods(object target, string name, iconfigurableobjectdefinition definition)                @ spring.objects.factory.support.abstractautowirecapableobjectfactory.configureobject(string name, rootobjectdefinition definition, iobjectwrapper wrapper)                @ spring.objects.factory.support.abstractautowirecapableobjectfactory.instantiateobject(string name, rootobjectdefinition definition, object[] arguments, boolean alloweagercaching, boolean suppressconfigure)           innerexception:  

from looking @ innermost inner exception, looks app having difficulty connecting oracle. here connection strings, have manually verified work using sqlplus.

  <add name="myapp"    connectionstring="data source=(description=(address=(protocol=tcp)(host=localhost)(port=1521))(connect_data=(server=dedicated)(sid=orcl)));user id=myid;password=mypassword;"    providername="oracleodp-11-2.0" />  <add name="blenderconnection"     connectionstring="data source=(description=(address=(protocol=tcp)(host=localhost)(port=1521))(connect_data=(server=dedicated)(sid=orcl)));user id=ppdid;password=ppdpassword;"     providername="oracle.manageddataaccess.client"/>  <add name="oracle"      connectionstring="data source=(description=(address=(protocol=tcp)(host=localhost)(port=1521))(connect_data=(server=dedicated)(sid=orcl)));user id=myid;password=mypassword;"      providername="oracle.manageddataaccess.client"/> 

does have suggestions? tia.

the way stopped getting above exception uninstall teamcity , remove application's website iis manager.

to clear, don't think problem teamcity--the problem ran build deploy application, added website iis , caused sort of conflict produce error in question when tried debug website.

also, part of problem was receiving exception:

exception details: system.badimageformatexception: not load file or assembly 'oracle.dataaccess' or 1 of dependencies. attempt made load program incorrect format.  badimageformatexception: not load file or assembly 'oracle.dataaccess' or 1 of dependencies. attempt made load program incorrect format.]  [badimageformatexception: not load file or assembly 'oracle.dataaccess, version=2.112.3.0, culture=neutral, publickeytoken=89b483f429c47342' or 1 of dependencies. attempt made load program incorrect format.]    system.reflection.runtimeassembly._nload(assemblyname filename, string codebase, evidence assemblysecurity, runtimeassembly locationhint, stackcrawlmark& stackmark, intptr pprivhostbinder, boolean throwonfilenotfound, boolean forintrospection, boolean suppresssecuritychecks) +0 

to resolve above problem, installed 32-bit client, mistakenly installed 1 oracle 12, in fact needed oracle 11g 32-bit client:

odac121021xcopy_32bit.zip 

to fix problem, uninstalled above, , made sure explicitly uninstall oracle.dataaccess.dll 2.121 items c:\windows\assembly. installed proper oracle 11g 32-bit client:

 odtwithodac1120320_32bit.zip 

next, updated file , ran it:

c:\app\oracle\product\11.2.0\dbhome_1\bin\selecthome.bat 

then opened file:

c:\oracle\configure.bat 

to make sure had values of 2.121.2.0 changed 2.112.3, , ran file this:

c:\oracle>configure.bat oracle_home true 

once file has executed, of machine.config files found in places c:\windows\microsoft.net\framework\v2.0.50727\config\machine.config should have version number oracle.dataaccess set properly.

but rather messing around above, instead highly recommend working managed .net client has been released if can:

http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

unfortunately, right have work unmanaged client.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -