問題: 我得到這個錯誤:java.lang.NoSuchFieldError的:STANDARD_NUMBER_TYPES
java.lang.NoSuchFieldError: STANDARD_NUMBER_TYPES
情況: 我嘗試添加彈簧JPA春季數據JPA和與此配置調度員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"/>
我越來越黃exlamation標誌(在線路:)
<jpa:repositories base-package="pl.test.library.dao"/>
,上面寫着:
Unable to locate Spring NamespaceHandler for element 'jpa:repositories' of schema namespace ' http://www.springframework.org/schema/data/jpa '
所以我打賭有一些依賴失蹤。
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.8.1.RELEASE</version>
</dependency>
,並試圖啓動Apache(上最新版本),我只是在服務器啓動時結束收到此錯誤:
root cause java.lang.NoSuchFieldError: STANDARD_NUMBER_TYPES 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) javax.servlet.http.HttpServlet.service(HttpServlet.java:618) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) javax.servlet.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>
檢查班NumberUtils – andy
謝謝安迪!檢查這個類讓我去https://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/util/NumberUtils.java這讓我想到了我有** spring-core **依賴...我沒有,所以這是解決方案。 – efem