.net - Spring.Net (& NHibernate?), missing Exception Translators -
i porting asp.net webform application runs spring.net , nhibernate asp.net mvc3. after creating new project , verifying spring.net can inject dependencies across projects in same solution, went on import of service , persistence layer projects in new solution.
my mappings ok (more @ end of post) when start application, following error:
no persistence exception translators found in container. cannot perform exception translation.
[configurationerrorsexception: error creating context 'spring.root': no persistence exception translators found in container. cannot perform exception translation.]
if understand well, means exception raised , spring.net not know how map / handle it... correct?
assuming came nhibernate, , explained in section 44.3.3 springframework documentation related nhibernate integration, added exceptiontranslationprocessor mapping...
<object type="spring.dao.attributes.persistenceexceptiontranslationpostprocessor, spring.data"/> ... not seem , don't know further. brilliant idea or hint around?
thanks in advance!
here's data reference purpose:
to web.config file added spring section group , references xml definition files:
<configuration> <!-- snip --> <configsections> <sectiongroup name="spring"> <section name="context" type="spring.context.support.mvccontexthandler, spring.web.mvc3"/> <section name="objects" type="spring.context.support.defaultsectionhandler, spring.core"/> <section name="parsers" type="spring.context.support.namespaceparserssectionhandler, spring.core"/> </sectiongroup> </configsections> <spring> <context> <resource uri="file://~/config/controllers.xml"/> <resource uri="assembly://service/service.config/service.xml"/> <resource uri="assembly://persistence.hibernate/persistence.hibernate.config/persistence.xml"/> </context> </spring> <!-- snip --> </configuration> the persistenceexceptiontranslationpostprocessor added in persistence.xml file. out of ideas, tried adding other xml did not anything.
in addition @marijn s post, depending on configuration exception no persistence exception translators found in container. covers real cause. attaching process start , catching spring.net exceptions (ctrl+alt+e / clr exceptions) usally reveals root cause.
for instance misconfigured sessionfactory if proper persistenceexceptiontranslationpostprocessor setup , registered context.
i usally remove repository attribute daos (which adds exception translation via aop , covers error) eliminate need persistenceexceptiontranslationpostprocessor resulting in underlying error show up.
in addition can post relevant parts of web.config , persistence.xml.
Comments
Post a Comment