Announcement Announcement Module
No announcement yet.
FatalBeanException:TxNamespaceHandler does not implement the NamespaceHandle interfac Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • FatalBeanException:TxNamespaceHandler does not implement the NamespaceHandle interfac


    I am dead stuck in tracks with this one to the point where i might have to drop spring . I am using weblogic. There is a big war deployed to it (it's a J2EE server like app). This war is capable of custom java extensions. It is multithreaded (it used to be a stand alone java server now it's an app inside weblogic). Using the CAT tool (classpath analyser) i made sure that the only spring "org.springframework.transaction.config.TxNamespac eHandler" is coming from spring-beans-3.1.0.RELEASE.jar. Weblogic has class loader hierarchy, but i made sure that the spring2.5.jar that is loaded by weblogic is not visible to this war app by adding to the wars weblogic-application.xml (as well as removing it from the file system!):


    However i still get the error message below when i do this in the java hook-in place of the war that sits in weblogic:

        String[] paths = {"applicationContext.xml"};
        ctx = new ClassPathXmlApplicationContext(paths);

    Caused by: org.springframework.beans.FatalBeanException: Class [org.springframework.transaction.config.TxNamespaceHandler] for namespace [] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
    	at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(
    	... 22 more
    the code that throws this error is:
    				Class<?> handlerClass = ClassUtils.forName(className, this.classLoader);
    				if (!NamespaceHandler.class.isAssignableFrom(handlerClass)) {
    					throw new FatalBeanException("Class [" + className + "] for namespace [" + namespaceUri +
    							"] does not implement the [" + NamespaceHandler.class.getName() + "] interface");
    However the CAT tool that analyzes the runtime classes is saying:

    [18:44] Compiled from "" public class org.springframework.transaction.config.TxNamespaceHandler extends org.springframework.beans.factory.xml.NamespaceHandlerSupport{     static final java.lang.String TRANSACTION_MANAGER_ATTRIBUTE;     static final java.lang.String DEFAULT_TRANSACTION_MANAGER_BEAN_NAME;     public org.springframework.transaction.config.TxNamespaceHandler();     static java.lang.String getTransactionManagerName(org.w3c.dom.Element);  
    [18:45]  and to double check NamespaceHandlerSupport? :)
    [18:45] Compiled from "" public abstract class org.springframework.beans.factory.xml.NamespaceHandlerSupport extends java.lang.Object implements org.springframework.beans.factory.xml.NamespaceHandler{     public org.springframework.beans.factory.xml.NamespaceHandlerSupport();     public org.springframework.beans.factory.config.BeanDefinition parse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext);     public org.springfram
    Why would this "!NamespaceHandler.class.isAssignableFrom(handlerC lass)" be failing when the CAT tool shows that this class is implementing the interface? Again, the Classpath analyzer tool does not see any other version of this class in it's classpath other than my spring3.1.jar one.

    Also i am using hibernate 4 and spring hibernate 4 support and here is the possible interesting part of the applicationConfiguration.xml:

    <beans xmlns=""
        <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
        <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
            <property name="sessionFactory">
            	<ref local="sessionFactory"/>
    Any help greatly appreciated.
    Last edited by [email protected]; Feb 9th, 2012, 12:51 PM.