java.lang.NoSuchFieldError:标准\u编号\u类型

java.lang.NoSuchFieldError:标准\u编号\u类型,java,spring,spring-mvc,nosuchfieldexception,Java,Spring,Spring Mvc,Nosuchfieldexception,问题: 我得到了这个错误: java.lang.NoSuchFieldError:标准\u编号\u类型 情况: 我正在尝试为spring数据jpa添加spring jpa,并使用dispatcher-servlet.xml配置 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http:

问题: 我得到了这个错误:

java.lang.NoSuchFieldError:标准\u编号\u类型

情况: 我正在尝试为spring数据jpa添加spring jpa,并使用dispatcher-servlet.xml配置

 <?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:context="http://www.springframework.org/schema/context"
        xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:jpa="http://www.springframework.org/schema/data/jpa"
        xsi:schemaLocation="  
    http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
    http://www.springframework.org/schema/context  
    http://www.springframework.org/schema/context/spring-context-3.0.xsd  
    http://www.springframework.org/schema/tx  
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
    http://www.springframework.org/schema/data/jpa
    http://www.springframework.org/schema/data/jpa/spring-jpa-1.1.xsd">
...
<jpa:repositories base-package="pl.test.library.dao"/>

...
我得到了黄色的标记(在第:)


也就是说:

找不到元素的Spring NamespaceHandler 架构命名空间的“jpa:repositories” ''

因此,我打赌缺少一些依赖项。添加后:

<dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>1.8.1.RELEASE</version>
        </dependency>

org.springframework.data
spring数据jpa
1.8.1.1发布
在尝试启动apache(最新版本)时,我在服务器启动结束时遇到以下错误:

根本原因java.lang.NoSuchFieldError:标准\u编号\u类型 org.springframework.web.context.request.ServletRequestAttributes。(ServletRequestAttributes.java:55) org.springframework.web.servlet.FrameworkServlet.buildRequestAttributes(FrameworkServlet.java:1032) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:959) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) javaservlet.http.HttpServlet.service(HttpServlet.java:618) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) javaservlet.http.HttpServlet.service(HttpServlet.java:725) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

还尝试添加以下的不同组合,但也没有成功:

 <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons-core</artifactId>
            <version>1.4.1.RELEASE</version>
        </dependency>
 <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>4.1.7.RELEASE</version>
</dependency>

org.springframework.data
spring数据共享核心
1.4.1.1发布
org.springframework
春季aop
4.1.7.1发布

更改shcemaLocation,这里的问题似乎是架构位置


这可能是因为您的构建中有重复的spring库


如果你正在使用Intellj,你可以检查你的
out/artifacts/。\u war\u explodes/WEB-INF/lib
目录。

检查类号Tillsthanks Andy!检查这个类会让我想到我是否有spring核心依赖性。。。我没有,所以这就是解决办法。你确定吗?它似乎不是有效的XML。感谢您捕获它,我现在更正了它。我建议在xml中替换xsi:schemaLocation并尝试一下。
 <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons-core</artifactId>
            <version>1.4.1.RELEASE</version>
        </dependency>
 <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>4.1.7.RELEASE</version>
</dependency>
xsi:schemaLocation="  
    http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
    http://www.springframework.org/schema/context  
    http://www.springframework.org/schema/context/spring-context-3.0.xsd  
    http://www.springframework.org/schema/tx  
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
    http://www.springframework.org/schema/data/jpa
    http://www.springframework.org/schema/data/jpa/spring-jpa-1.1.xsd">
 xsi:schemaLocation="  
    http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
    http://www.springframework.org/schema/context  
    http://www.springframework.org/schema/context/spring-context-3.0.xsd  
    http://www.springframework.org/schema/tx  
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
    http://www.springframework.org/schema/data/jpa
    http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">