我收到 java.lang.ClassNotFoundException:missing org.springframework.util.MimeType
I am getting java.lang.ClassNotFoundException:missing org.springframework.util.MimeType
我遇到 NetBeans 问题 IDE。我是这个 IDE 的新手,现在正在研究使用 Spring MVC + Hibernate 的项目,服务器端在 Oracle Weblogic 12c 上。
一切都很好,但今天我在部署项目时遇到此错误:Deployment failed. The message was: java.lang.ClassNotFoundException: org.springframework.util.MimeType
我的 pom.xml 文件:
<properties>
<jdk.version>1.6</jdk.version>
<spring.version>3.2.13.RELEASE</spring.version>
<jstl.version>1.2</jstl.version>
</properties>
<dependencies>
<dependency>
<!-- Spring -->
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.2.18.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>3.2.18.RELEASE</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.2.21.Final</version>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.2.5.RELEASE</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
应该删除 spring 核心排除项。
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
并且 spring-core
依赖项应该添加到 pom。
我遇到 NetBeans 问题 IDE。我是这个 IDE 的新手,现在正在研究使用 Spring MVC + Hibernate 的项目,服务器端在 Oracle Weblogic 12c 上。
一切都很好,但今天我在部署项目时遇到此错误:Deployment failed. The message was: java.lang.ClassNotFoundException: org.springframework.util.MimeType
我的 pom.xml 文件:
<properties>
<jdk.version>1.6</jdk.version>
<spring.version>3.2.13.RELEASE</spring.version>
<jstl.version>1.2</jstl.version>
</properties>
<dependencies>
<dependency>
<!-- Spring -->
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.2.18.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>3.2.18.RELEASE</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.2.21.Final</version>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.2.5.RELEASE</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
应该删除 spring 核心排除项。
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
并且 spring-core
依赖项应该添加到 pom。