PDA

View Full Version : Error creating context 'spring.root': The 'http://www.springframework.net/tx:attribut



exp2000
06-11-2008, 05:36 PM
Error creating context 'spring.root': The 'http://www.springframework.net/tx:attribute-driven' element is not declared.

What does this message mean. I have added everything to config files as it is the documentation.

In web.config

<!-- Spring.Net -->
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web" />
<section name="parsers" type="Spring.Context.Support.NamespaceParsersSectionHand ler, Spring.Core" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>

In config file


<objects xmlns="http://www.springframework.net" xmlns:db="http://www.springframework.net/database" xmlns:tx="http://www.springframework.net/tx">

Mark Pollack
06-12-2008, 11:49 AM
Hi,

When using the namespaces one need to do two things, declare the namespace (you already did) and register the namespace parser.

To register the namespace parser add the the following to your application config file.



<configuration>

<configSections>
<sectionGroup name="spring">
<!-- other Spring config sections handler like context, typeAliases, etc not shown for brevity -->
<section name="parsers" type="Spring.Context.Support.NamespaceParsersSectionHand ler, Spring.Core"/>
</sectionGroup>
</configSections>

<spring>
<parsers>
<parser type="Spring.Transaction.Config.TxNamespaceParser, Spring.Data" />
</parsers>
</spring>

</configuration>
An similar for other namespaces.

I've updated the documentation to better reflect this need. Refer to this chapter (http://www.springframework.net/doc-latest/reference/html/xsd-config.html#xsd-config-body) for more information.

We plan to eliminate the 2nd step in the next release.

Cheers,
Mark