Spring 3.0: Unable to locate Spring NamespaceHandler for XML schema namespace

后端 未结 11 1866
鱼传尺愫
鱼传尺愫 2020-12-05 10:01

My setup is fairly simple: I have a web front-end, back-end is spring-wired.

I am using AOP to add a layer of security on my rpc services.

It\'s all good, ex

相关标签:
11条回答
  • 2020-12-05 10:28

    If using mvn, check that you have the correct scope (if you have that defined) in your pom.xml. I once had it incorrectly set to test but needed it for runtime.

    0 讨论(0)
  • 2020-12-05 10:31

    This trick worked for me too: In Eclipse right-click on the project and then Maven > Update Dependencies.

    0 讨论(0)
  • 2020-12-05 10:32

    Make sure you have all dependencies solved

    I run into this problem in my first attempt at AOP, following a spring tutorial. My problem was not having spring-aop.jar in my classpath. The tutorial listed all other dependencies I had to add, namely:

    • aspectjrt.jar
    • aspectjweaver.jar
    • aspectj.jar
    • aopalliance.jar

    But the one was missing. Just one more problem that can contribute to that symptom in the original question.

    I am using Eclipse (neon), Java SE 8, beans 3.0, spring AOP 3.0, Spring 4.3.4. The problem showed in the Java view --not JEE--, and while trying to just run the application with Right button menu -> Run As -> Java Application.

    0 讨论(0)
  • 2020-12-05 10:37

    I have the same problem with spring 3.0.2 and spring-beans-3.0.xsd.

    My solution:

    Create a file META-INF/spring.schemas in the source folder and copy all necesary definitions. Create spring.handlers too.

    I think that the class PluggableSchemaResolver is not working correctly.

    http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/xml/PluggableSchemaResolver.html

    from the javadoc:

    "By default, this class will look for mapping files in the classpath using the pattern: META-INF/spring.schemas allowing for multiple files to exist on the classpath at any one time."

    but in my case, this class only read the first spring.schemas finded.

    Grettings. pacovr

    0 讨论(0)
  • 2020-12-05 10:38

    In case someone else runs into this problem, I just did using Eclipse; running the project via the right click action. This error occurred in the J2EE view, but did NOT occur in the Java view. Not sure - assuming something with adding libraries to the correct 'lib' directory.

    I am also using a Maven project, allowing m2eclipse to manage dependancies.

    0 讨论(0)
提交回复
热议问题