spring mvc项目启动报错,该怎么处理
阅读
spring mvc 项目启动时候报这个错误
java.lang.NoSuchMethodError: org.springframework.web.context.support.XmlWebApplicationContext.getEnvironment()
web.xml的部分代码如下
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:config/beans.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextCleanupListener</listener-class>
</listener>
<servlet>
<servlet-name>spring-mvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring-mvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
beans.xml代码如下
<configuration>
<typeAliases>
<!-- 给实体类起一个别名 user -->
<typeAlias type="com.domain.User" alias="User"/>
<typeAlias type="com.domain.Article" alias="Article"/>
</typeAliases>
<!-- 对数据库的配置, -->
<environments default="development">
<environment id="development">
<transactionManager type="jdbc"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf8"/>
<property name="username" value="root"/>
<property name="password" value="root"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="com/domain/userMapper.xml"/>
</mappers>
</configuration>
具体使用的jar包截图
不知道是我引用的哪个包版本有问题,还是相关的xml文件配置写错了,求正解
------解决方案--------------------
1. classpath* 这个没遇到过,应该这个有点问题。
2. spring mvc的配置没有显示的给出来,你可以试试给出来看看结果。
阅读
上一篇:socket建立连接+返回结果 的时间设置解决方案 下一篇:返回列表