开发者

Spring Namespace Error

开发者 https://www.devze.com 2023-03-26 01:08 出处:网络
I am continually getting the following error during testing: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for na

I am continually getting the following error during testing:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.springframework.org/schema/context]

It is originating from my persistenceLayer.xml file. Here is it's code:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

    <bean id="persistenceManager" class="com.apollo.counterpartcontacts.service.PersistenceManager">
    </bean>

    <tx:annotation-driven transaction-manager="txManager"/>
    <context:annotation-config /> 

    <bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>

    <bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="CounterpartContactDataSource" /> 
        <property name="persistenceUnitName" value="CounterpartContacts" />
        <property name="loadTimeWeaver">
        <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
        </property>
    </bean>

</beans>

Also, here is my application.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">

    <!-- 
        This file can be included into other file which already has PropertyPlaceholderConfigurers. 
        Spring requires different syntax for them. 
        For scanning the properties from this PropertyPlaceholderConfigurer, use @[]. Make sure 
        other set of configuration files not use @[] to scan properties.
    -->
    <bean id="credentialConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="placeholderPrefix" value="@["/>
        <property name="placeholderSuffix" value="]"/>

        <property name="location" value="file:c:/ACM/private/credentials.properties"/>
    </bean>

    <import resource="persistenceLayer.xml" />

    <bean id="CounterpartContactDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
        <property name="url" value="${CounterpartContact.url}" />
        <property name="username" value="@[mdMsSqlCounterpartContact_Login=login]"/>
        <property name="password" value="@[mdMsSqlCounterpartContact_Password=password]"/>
        <property name="defaultCatalog" value="${CounterpartContact.Catalog}" />
    </bean>
</beans>

Additionally, here is a list of all my .jar files:

C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\ant-contrib-0.6.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\antlr.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\aopalliance开发者_运维问答.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\asm-attrs.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\asm.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\aspectjrt.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\aspectjweaver.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\cfgatewayadapter.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\cglib-nodep-2.2.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\clear-runtime-blazeds.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\clear-runtime-core.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\clear.cdb.annotations.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\com.farata.dto2fx.annotations.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\commons-beanutils-1.6.1.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\commons-codec-1.3.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\commons-collections-3.1.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\commons-dbcp-1.2.2.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\commons-httpclient-3.0.1.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\commons-logging.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\commons-pool-1.5.4.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\concurrent.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\connector-1_5.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\dom4j-1.6.1.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\flex-messaging-common.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\flex-messaging-core.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\flex-messaging-opt.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\flex-messaging-proxy.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\flex-messaging-remoting.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\flex-rds-server.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.0.Final.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\hibernate3.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\howl.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\hsqldb.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\javassist-3.9.0.GA.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\jotm.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\jotm_iiop_stubs.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\jotm_jrmp_stubs.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\jta-1.1.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\jta-spec1_0_1.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\jts1_0.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\log4j-1.2.14.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\objectweb-datasource.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.aop-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.asm-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.aspects-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.beans-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.context-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.context.support-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.core-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.expression-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.flex.roo.addon-1.0.0.M1.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.flex.roo.annotations-1.0.0.M1.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.instrument-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.instrument.tomcat-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.jdbc-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.jms-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.orm-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.oxm-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.test-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.transaction-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.web-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.web.portlet-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.web.servlet-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\org.springframework.web.struts-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\ow_carol.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\serializer.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\slf4j-api-1.6.0.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\slf4j-log4j12-1.6.0.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-flex-core-1.5.0.M2.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-security-acl-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-security-aspects-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-security-cas-client-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-security-config-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-security-core-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-security-ldap-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-security-openid-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-security-taglibs-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\spring-security-web-3.0.5.RELEASE.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\sqljdbc-3.0.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\testng-6.1.1.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\xalan.jar
C:\dev\grailsflex\CounterpartContacts\WebContent\WEB-INF\lib\xapool.jar

And here is the classpath:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_26">
        <attributes>
            <attribute name="owner.project.facets" value="java"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0">
        <attributes>
            <attribute name="owner.project.facets" value="jst.web"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
    <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
    <classpathentry kind="src" path="flex_src">
        <attributes>
            <attribute name="optional" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="lib" path="C:/sqljdbc_3.0/enu/sqljdbc4.jar"/>
    <classpathentry kind="output" path="build/classes"/>
</classpath>

Anyone have any ideas as to what's going wrong here?


You appear to be trying to use the Spring 2.5 namespace declarations with the Spring 3.0.5 JARs. Use one or the other; don't mix.

For the record, I use this sort of thing in my code (with 3.0.5-RELEASE JARs, so it should be comparable to your situation) and it works for me:

http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd


This might help: http://forum.springsource.org/showthread.php?52256-Unable-to-locate-NamespaceHandler-for-namespace-..-context

0

精彩评论

暂无评论...
验证码 换一张
取 消