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

  • FatalBeanException:TxNamespaceHandler does not implement the NamespaceHandle interfac

    Hi!

    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!):

    Code:
    <prefer-application-packages>
      <package-name>org.springframework.*</package-name>
    </prefer-application-packages>

    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:

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


    Code:
    Caused by: org.springframework.beans.FatalBeanException: Class [org.springframework.transaction.config.TxNamespaceHandler] for namespace [http://www.springframework.org/schema/tx] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
    	at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:126)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1414)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    	... 22 more
    the code that throws this error is:
    Code:
    				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:

    Code:
    [18:44] Compiled from "TxNamespaceHandler.java" 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 "NamespaceHandlerSupport.java" 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:

    Code:
    ....
    
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
        
     ...
    	<tx:annotation-driven/>
    	
        <!-- 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"/>
            </property>
        </bean>
    ...
    Any help greatly appreciated.
    Last edited by [email protected]; Feb 9th, 2012, 01:51 PM.
Working...
X