Getting error message with spring “cvc-elt.1: Cannot find the declaration of element 'beans'.”

后端 未结 5 1440
心在旅途
心在旅途 2020-12-19 01:50

I\'m trying to set up a simple spring application and I\'m getting the below exception. This is being run standalone in eclipse indigo.

Exception in thread \         


        
相关标签:
5条回答
  • 2020-12-19 02:28

    the maven shade plugin seems to replace the spring.schemas file in the jars,so creating one of our own with all the individual spring.schema contents from each of the jar should solve the issue.

    0 讨论(0)
  • 2020-12-19 02:31

    There could be possibility of mismatch of Spring Bean version and xsd definition.

    For Example beans xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd

    While in spring version is 3.0.5-Release

    Check classpath version and keep them same. Shoul

    0 讨论(0)
  • 2020-12-19 02:36

    Are you sure you have spring-beans on the classpath?

    This error normally means that it can't find a spring.schemas (which is in spring-beans.jar) explaining to it what that namespace means.

    Other options are that the Maven Shade plugin has damaged spring.schemas, but that's unlikely to be the case as you haven't mentioned Maven.

    0 讨论(0)
  • 2020-12-19 02:40

    Maybe this post can help you:

    Cannot find the declaration of element 'beans' in internet offline mode

    It seems like being a problem of Schema configuration.

    0 讨论(0)
  • 2020-12-19 02:41

    When I had this issue in STS I just cleaned the project and it worked.

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