HTTP404,我用的是vs2015,MVC版本是5,具体情况如下

图片说明

就是这个问题,我用的是vs2015,在view文件夹中添加的视图只能是Razor视图,所以我添加了web窗体,因为我发现这个是aspx的后缀

图片说明

就是图片中的Main.aspx
RouteConfig中的参数我也改了,代码如下
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Calculator", action = "Index", id = UrlParameter.Optional }
);

控制器代码如下
public ActionResult Index()
{
return View("Main");
}
public ActionResult GetSummary()
{
//【1】接收数据
int number1 = Convert.ToInt32(Request.Params["number1"]);
int number2 = Convert.ToInt32(Request.Params["number2"]);
//【2】调用模型来处理数据
Calculate objCal = new Calculate();
int result = objCal.Summary(number1, number2);
//【3】保存数据
ViewData["result"] = "结果为:" + result;
//【4】返回视图
return View();
}

然后一运行就出现了图中的404问题,是MVC5不支持aspx了吗?还是哪里忘记改东西了?求大神指导

1个回答

dcy652701
dcy652701 谢谢,已经知道错在哪了,vs2015不支持aspx视图了
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
asp.net mvc 如何area独立到类库中,结构关系新建问题,先提前感谢指点的大神!!!

问题描述:我新建了一个mvc项目,项目中需要体现前台以及后台,为此我新建了一个(web application )Shop.Web以及一个类库项目Shop.Web.Admin,通过查阅资料得知,需要使用Area,网上有一篇文章说的比较详细,http://www.th7.cn/Program/net/201602/761513.shtml,这篇讲的是如何将area独立成一个项目,我需要的正是这种效果,但是不知道每一步的建立流程,不知道怎么做才能建立出这样的效果,大神们给看看这个怎么做,最好就是每一步都给截图加说明, 越详细越好。 注:我不需要大家说怎么去实现他的具体功能,我只需要知道**如何新建才能达到这种结构效果**。 具体效果以及问题如下: 第一张图问题是:**如何设置图中所说的目录结构和编译设置,如何将后台工具集中到这个类库中,大神们指点的时候请截图,小弟看得懂些**。 ![图片说明](https://img-ask.csdn.net/upload/201607/29/1469732181_503151.jpg) 2、**第二张图的问题是HealthDemo.Web.Admin这个类库的文件夹如何设置在administration文件夹下面,**并且并且并且**在解决方案中看得见HealthDemo.Web.Admin,但是在本地物理路径下面只有administration这个文件夹。** ![图片说明](https://img-ask.csdn.net/upload/201607/29/1469732230_599390.jpg) 感谢各位大神指点,提前谢谢大家。

spring MVC注解 + hibernate +jpa配置 出错 具体如下

这个是错误 No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0 下面为XML配置文件 web.xml 导入hibernate <!-- Open Entity Manager in View filter --> <filter> <filter-name>openEntityManagerInViewFilter</filter-name> <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class> </filter> <filter-mapping> <filter-name>openEntityManagerInViewFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> applicationContext.xml如下 <!-- production/local development环境 --> <beans profile="production,development"> <context:property-placeholder ignore-unresolvable="true" location="classpath*:properties/application.properties, classpath*:properties/application.local.properties" /> <!-- 数据源配置, 使用DBCP数据库连接池 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <!-- Connection Info --> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /> <property name="url" value="jdbc:oracle:thin:@172.16.80.40:1521:ydRIS4T" /> <property name="username" value="rim_uat" /> <property name="password" value="password" /> <!-- Connection Pooling Info --> <property name="maxActive" value="100" /> <property name="maxIdle" value="20" /> <property name="defaultAutoCommit" value="false" /> <!-- 连接Idle一个小时后超时 --> <property name="timeBetweenEvictionRunsMillis" value="3600000" /> <property name="minEvictableIdleTimeMillis" value="3600000" /> </bean> </beans> <!-- Jpa Entity Manager 配置 --> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter" /> <property name="packagesToScan" value="com.rsxiao.test.entity"/> <property name="jpaProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop> <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop> <prop key="net.sf.ehcache.configurationResourceName">config/ehcache-hibernate-local.xml</prop> <prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop> </props> </property> </bean> <bean id="hibernateJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" /> <!-- Spring Data Jpa配置 --> <jpa:repositories base-package="com.rsxiao.test" transaction-manager-ref="transactionManager" entity-manager-factory-ref="entityManagerFactory" /> <!-- Jpa 事务配置 --> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> Servlet.service() for servlet springServlet threw exception org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0 at org.springframework.beans.factory.BeanFactoryUtils.beanOfType(BeanFactoryUtils.java:394) at org.springframework.orm.jpa.EntityManagerFactoryUtils.findEntityManagerFactory(EntityManagerFactoryUtils.java:111) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.lookupEntityManagerFactory(OpenEntityManagerInViewFilter.java:194) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.lookupEntityManagerFactory(OpenEntityManagerInViewFilter.java:170) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:128) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619)

用Spring MVC 提交表单信息为什么报400的错误

具体情况如下,我有一个实体类user已声明getset方法,而且表单里面的name写的也和实体类的成员变量一样,在controller里面的参数是User user,当我提交的时候页面 出现400错误。 网上查了好久,我也测试了,用requestMapping(value="user" ,required=false)测试了,这样就包的500错误,后来有改为requestMapping(value="user" required=true)这次又包400错误了, 求助啊!谢谢各位大神!!

ASP MVC Html.BeginForm前台传递整个复杂对象至后台问题

我从后台传递了一个强类型Model到前台显示,然后前台建立一个Html.BeginForm表单,并通过object routeValues将整个Model传回后台,但后台接收不到该对象里面的复杂类型数据,具体代码如下: Model: ``` public class FooterViewModel { public string CompanyName { get; set; } public string Year { get; set; } } public class BaseViewModel { public string UserName { get; set; } public FooterViewModel FooterData { get; set; } } public class OperateEmployeeViewModel : BaseViewModel { public int ID { get; set; } ....... ....... } ``` View: ``` @model MVCExample.ViewModels.OperateEmployeeViewModel @{ ViewBag.Title = "DeleteEmployee"; } <h2>Delete Confirmation</h2> @using (Html.BeginForm("DeleteEmployee", "Employee", Model, FormMethod.Post)) { <table> <tr> <td> First Name: </td> <td> @Html.DisplayFor(x => x.FirstName) </td> </tr> ...... } ``` Controller: ``` public ActionResult DeleteEmployee(OperateEmployeeViewModel operateEmployee, string BtnSubmit) { switch (BtnSubmit) { case "Delete": Employee e = new Employee(); ......... ......... return RedirectToAction("Index"); case "Cancel": return RedirectToAction("Index"); } return new EmptyResult(); } ``` ![图片说明](https://img-ask.csdn.net/upload/202004/01/1585727273_777979.png) ![图片说明](https://img-ask.csdn.net/upload/202004/01/1585727406_517627.png) 打了断点,可以看到从后台其他action传递到前台的强类型Model中,FooterData数据不是null的,但从前台beginform传递到后台,action接收到的FooterData却是null,请问这是怎么回事,要怎么解决?

spring mvc 事务失效问题

<div class="iteye-blog-content-contain" style="font-size: 14px;"> <p><span style="color: #000000;"><strong>同时向两个表插入数据,第一条成功,第二条数据插入失败,第一条未回滚,具体配置如下</strong></span></p> <p> </p> <p><span style="color: #000000; font-size: 18px;"><strong>applicationContext.xml 代码</strong></span></p> <p><span style="color: #000000;">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span><br><span style="color: #000000;">&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans"><span style="color: #000000;">http://www.springframework.org/schema/beans</span></a>"</span><br><span style="color: #000000;"> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance"><span style="color: #000000;">http://www.w3.org/2001/XMLSchema-instance</span></a>" xmlns:tx="<a href="http://www.springframework.org/schema/tx"><span style="color: #000000;">http://www.springframework.org/schema/tx</span></a>"</span><br><span style="color: #000000;"> xmlns:context="<a href="http://www.springframework.org/schema/context"><span style="color: #000000;">http://www.springframework.org/schema/context</span></a>"</span><br><span style="color: #000000;"> xmlns:mvc="<a href="http://www.springframework.org/schema/mvc"><span style="color: #000000;">http://www.springframework.org/schema/mvc</span></a>" xmlns:util="<a href="http://www.springframework.org/schema/util"><span style="color: #000000;">http://www.springframework.org/schema/util</span></a>"</span><br><span style="color: #000000;"> xmlns:aop="<a href="http://www.springframework.org/schema/aop"><span style="color: #000000;">http://www.springframework.org/schema/aop</span></a>"</span><br><span style="color: #000000;"> xsi:schemaLocation="<a href="http://www.springframework.org/schema/aop"><span style="color: #000000;">http://www.springframework.org/schema/aop</span></a> <a href="http://www.springframework.org/schema/aop/spring-aop-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/aop/spring-aop-3.1.xsd</span></a></span><br><span style="color: #000000;">  <a href="http://www.springframework.org/schema/mvc"><span style="color: #000000;">http://www.springframework.org/schema/mvc</span></a> <a href="http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd</span></a></span><br><span style="color: #000000;">  <a href="http://www.springframework.org/schema/beans"><span style="color: #000000;">http://www.springframework.org/schema/beans</span></a> <a href="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/beans/spring-beans-3.1.xsd</span></a></span><br><span style="color: #000000;">  <a href="http://www.springframework.org/schema/util"><span style="color: #000000;">http://www.springframework.org/schema/util</span></a> <a href="http://www.springframework.org/schema/util/spring-util-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/util/spring-util-3.1.xsd</span></a></span><br><span style="color: #000000;">  <a href="http://www.springframework.org/schema/tx"><span style="color: #000000;">http://www.springframework.org/schema/tx</span></a> <a href="http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/tx/spring-tx-3.1.xsd</span></a></span><br><span style="color: #000000;">  <a href="http://www.springframework.org/schema/context"><span style="color: #000000;">http://www.springframework.org/schema/context</span></a> <a href="http://www.springframework.org/schema/context/spring-context-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/context/spring-context-3.1.xsd</span></a>"&gt;</span></p> <p><span style="color: #000000;"> &lt;!--将@Controller的注解排除掉 --&gt;</span><br><span style="color: #000000;"> &lt;context:component-scan base-package="com"&gt;</span><br><span style="color: #000000;">  &lt;context:exclude-filter type="annotation"</span><br><span style="color: #000000;">   expression="org.springframework.stereotype.Controller" /&gt;</span><br><span style="color: #000000;"> &lt;/context:component-scan&gt;</span></p> <p><span style="color: #000000;"> &lt;!-- 读取配置文件 --&gt;</span><br><span style="color: #000000;"> &lt;util:properties id="settings"</span><br><span style="color: #000000;">  location="classpath:config/global.properties" /&gt;</span></p> <p><span style="color: #000000;"> &lt;!-- 读取数据库配置文件 --&gt;</span><br><span style="color: #000000;"> &lt;bean id="configProperties"</span><br><span style="color: #000000;">  class="org.springframework.beans.factory.config.PropertiesFactoryBean"&gt;</span><br><span style="color: #000000;">  &lt;property name="locations"&gt;</span><br><span style="color: #000000;">   &lt;list&gt;</span><br><span style="color: #000000;">    &lt;value&gt;classpath:config/jdbc.properties&lt;/value&gt;</span><br><span style="color: #000000;">   &lt;/list&gt;</span><br><span style="color: #000000;">  &lt;/property&gt;</span><br><span style="color: #000000;"> &lt;/bean&gt;</span><br><span style="color: #000000;"> &lt;bean id="propertyConfigurer"</span><br><span style="color: #000000;">  class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"&gt;</span><br><span style="color: #000000;">  &lt;property name="properties" ref="configProperties" /&gt;</span><br><span style="color: #000000;"> &lt;/bean&gt;</span><br><span style="color: #000000;"> &lt;mvc:annotation-driven /&gt;</span></p> <p><span style="color: #000000;"> &lt;!-- 数据源 --&gt;</span><br><span style="color: #000000;"> &lt;bean id="dataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource"&gt;</span><br><span style="color: #000000;">  &lt;property name="driver" value="${driver}" /&gt;</span><br><span style="color: #000000;">  &lt;property name="driverUrl" value="${driverUrl}" /&gt;</span><br><span style="color: #000000;">  &lt;property name="user" value="${user}" /&gt;</span><br><span style="color: #000000;">  &lt;property name="password" value="${password}" /&gt;</span><br><span style="color: #000000;">  &lt;property name="alias" value="proxool.aidecenter" /&gt;</span><br><span style="color: #000000;">  &lt;property name="maximumActiveTime" value="300000" /&gt;</span><br><span style="color: #000000;">  &lt;property name="prototypeCount" value="0" /&gt;</span><br><span style="color: #000000;">  &lt;property name="maximumConnectionCount" value="${maximumConnectionCount}" /&gt;</span><br><span style="color: #000000;">  &lt;property name="minimumConnectionCount" value="${minimumConnectionCount}" /&gt;</span><br><span style="color: #000000;">  &lt;property name="simultaneousBuildThrottle" value="50" /&gt;</span><br><span style="color: #000000;">  &lt;property name="houseKeepingTestSql" value="select form CURRENT_DATE" /&gt;</span><br><span style="color: #000000;"> &lt;/bean&gt;</span><br><span style="color: #000000;"> &lt;!-- JDBC模版 --&gt;</span><br><span style="color: #000000;"> &lt;bean id="jdbc" class="org.springframework.jdbc.core.JdbcTemplate"&gt;</span><br><span style="color: #000000;">  &lt;property name="dataSource" ref="dataSource" /&gt;</span><br><span style="color: #000000;"> &lt;/bean&gt;</span><br><span style="color: #000000;"> &lt;bean</span><br><span style="color: #000000;">  class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"&gt;</span><br><span style="color: #000000;">  &lt;property name="staticMethod" value="com.common.database.SpringDB.setJdbcTemplate" /&gt;</span><br><span style="color: #000000;">  &lt;property name="arguments" ref="jdbc" /&gt;</span><br><span style="color: #000000;"> &lt;/bean&gt;</span><br><span style="color: #000000;"> &lt;!-- 事务管理器 --&gt;</span><br><span style="color: #000000;"> &lt;bean id="transactionManager"</span><br><span style="color: #000000;">  class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;</span><br><span style="color: #000000;">  &lt;property name="dataSource"&gt;</span><br><span style="color: #000000;">   &lt;ref local="dataSource" /&gt;</span><br><span style="color: #000000;">  &lt;/property&gt;</span><br><span style="color: #000000;"> &lt;/bean&gt;</span><br><span style="color: #000000;"> &lt;!-- 事务模板 --&gt;</span><br><span style="color: #000000;"> &lt;bean id="transactionTemplate"</span><br><span style="color: #000000;">  class="org.springframework.transaction.support.TransactionTemplate"&gt;</span><br><span style="color: #000000;">  &lt;property name="transactionManager"&gt;</span><br><span style="color: #000000;">   &lt;ref local="transactionManager" /&gt;</span><br><span style="color: #000000;">  &lt;/property&gt;</span><br><span style="color: #000000;"> &lt;/bean&gt;</span><br><span style="color: #000000;"> &lt;aop:config&gt;</span><br><span style="color: #000000;">  &lt;aop:pointcut id="transactionPointcut"</span><br><span style="color: #000000;">   expression="execution(* com.service..*.*(..))" /&gt;</span><br><span style="color: #000000;">  &lt;aop:advisor pointcut-ref="transactionPointcut"</span><br><span style="color: #000000;">   advice-ref="advice" /&gt;</span><br><span style="color: #000000;"> &lt;/aop:config&gt;</span><br><span style="color: #000000;"> &lt;tx:advice id="advice" transaction-manager="transactionManager"&gt;</span><br><span style="color: #000000;">  &lt;tx:attributes&gt;</span><br><span style="color: #000000;">   &lt;!-- 读取数据方法,一般采用只读事务 --&gt;</span><br><span style="color: #000000;">   &lt;tx:method name="find*" read-only="true" /&gt;</span><br><span style="color: #000000;">   &lt;!--以下方法,如save,update,delete等对数据库进行写入操作的方法,当产生Exception时进行回滚 --&gt;</span><br><span style="color: #000000;">   &lt;tx:method name="save*" propagation="REQUIRED" /&gt;</span><br><span style="color: #000000;">   &lt;tx:method name="update*" /&gt;</span><br><span style="color: #000000;">   &lt;tx:method name="delete*" /&gt;</span><br><span style="color: #000000;">  &lt;/tx:attributes&gt;</span><br><span style="color: #000000;"> &lt;/tx:advice&gt;</span><br><span style="color: #000000;"> &lt;tx:annotation-driven transaction-manager="transactionManager"</span><br><span style="color: #000000;">  proxy-target-class="true" /&gt;</span><br><span style="color: #000000;">&lt;/beans&gt;</span></p> <p> </p> <p><span style="color: #000000; font-size: 18px;"><strong>dispatcher-servlet.xml</strong></span></p> <p><span style="color: #000000;">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans"><span style="color: #000000;">http://www.springframework.org/schema/beans</span></a>"<br> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance"><span style="color: #000000;">http://www.w3.org/2001/XMLSchema-instance</span></a>" xmlns:context="<a href="http://www.springframework.org/schema/context"><span style="color: #000000;">http://www.springframework.org/schema/context</span></a>"<br> xmlns:cache="<a href="http://www.springframework.org/schema/cache"><span style="color: #000000;">http://www.springframework.org/schema/cache</span></a>" xmlns:aop="<a href="http://www.springframework.org/schema/aop"><span style="color: #000000;">http://www.springframework.org/schema/aop</span></a>"<br> xmlns:tx="<a href="http://www.springframework.org/schema/tx"><span style="color: #000000;">http://www.springframework.org/schema/tx</span></a>" xmlns:jdbc="<a href="http://www.springframework.org/schema/jdbc"><span style="color: #000000;">http://www.springframework.org/schema/jdbc</span></a>"<br> xmlns:mvc="<a href="http://www.springframework.org/schema/mvc"><span style="color: #000000;">http://www.springframework.org/schema/mvc</span></a>"<br> xsi:schemaLocation="<br>      <a href="http://www.springframework.org/schema/beans"><span style="color: #000000;">http://www.springframework.org/schema/beans</span></a>  <br>            <a href="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/beans/spring-beans-3.1.xsd</span></a>  <br>            <a href="http://www.springframework.org/schema/context"><span style="color: #000000;">http://www.springframework.org/schema/context</span></a>  <br>            <a href="http://www.springframework.org/schema/context/spring-context-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/context/spring-context-3.1.xsd</span></a>  <br>            <a href="http://www.springframework.org/schema/tx"><span style="color: #000000;">http://www.springframework.org/schema/tx</span></a>  <br>            <a href="http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/tx/spring-tx-3.1.xsd</span></a>  <br>            <a href="http://www.springframework.org/schema/jdbc"><span style="color: #000000;">http://www.springframework.org/schema/jdbc</span></a>  <br>            <a href="http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd</span></a><br>            <a href="http://www.springframework.org/schema/cache"><span style="color: #000000;">http://www.springframework.org/schema/cache</span></a> <br>            <a href="http://www.springframework.org/schema/cache/spring-cache-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/cache/spring-cache-3.1.xsd</span></a><br>            <a href="http://www.springframework.org/schema/mvc"><span style="color: #000000;">http://www.springframework.org/schema/mvc</span></a> <br>      <a href="http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"><span style="color: #000000;">http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd</span></a>"<br> default-autowire="byName"&gt;</span></p> <p><span style="color: #000000;"> &lt;!-- 将@Service注解给去掉 --&gt;<br> &lt;context:component-scan base-package="com.controller"&gt;<br>  &lt;context:include-filter type="annotation"<br>   expression="org.springframework.stereotype.Controller" /&gt;<br>  &lt;context:exclude-filter type="annotation"<br>   expression="org.springframework.stereotype.Service" /&gt;<br> &lt;/context:component-scan&gt;</span></p> <p><span style="color: #000000;"> &lt;bean<br>  class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"&gt;<br>  &lt;property name="useSuffixPatternMatch" value="true" /&gt;<br>  &lt;property name="interceptors"&gt;<br>   &lt;list&gt;<br>    &lt;ref bean="sessionInterceptor"&gt;&lt;/ref&gt;<br>   &lt;/list&gt;<br>  &lt;/property&gt;<br> &lt;/bean&gt;</span></p> <p><span style="color: #000000;"> &lt;!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 --&gt;<br> &lt;bean<br>  class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt;<br>  &lt;property name="messageConverters"&gt;<br>   &lt;list&gt;<br>    &lt;ref bean="mappingJacksonHttpMessageConverter" /&gt;<br>    &lt;ref bean="stringHttpMessageConverter" /&gt;<br>   &lt;/list&gt;<br>  &lt;/property&gt;<br> &lt;/bean&gt;<br> &lt;!-- 负责读写字符串格式的数据 --&gt;<br> &lt;bean id="stringHttpMessageConverter"<br>  class="org.springframework.http.converter.StringHttpMessageConverter"&gt;<br>  &lt;property name="supportedMediaTypes"&gt;<br>   &lt;list&gt;<br>    &lt;value&gt;text/plain;charset=UTF-8&lt;/value&gt;<br>   &lt;/list&gt;<br>  &lt;/property&gt;<br> &lt;/bean&gt;<br> &lt;!-- 负责读写入json格式的数据 --&gt;<br> &lt;bean id="mappingJacksonHttpMessageConverter"<br>  class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"&gt;<br>  &lt;property name="supportedMediaTypes"&gt;<br>   &lt;list&gt;<br>    &lt;value&gt;application/json;charset=UTF-8&lt;/value&gt;<br>   &lt;/list&gt;<br>  &lt;/property&gt;<br> &lt;/bean&gt;</span></p> <p><span style="color: #000000;"> &lt;!-- 拦截器 --&gt;<br> &lt;bean id="sessionInterceptor" class="com.interceptor.SessionInterceptor"&gt;&lt;/bean&gt;</span></p> <p><span style="color: #000000;"> &lt;!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 --&gt;<br> &lt;bean id="viewResolver"<br>  class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;<br>  &lt;property name="viewClass"<br>   value="org.springframework.web.servlet.view.JstlView" /&gt;<br>  &lt;property name="prefix" value="" /&gt;<br>  &lt;property name="suffix" value=".jsp" /&gt;<br> &lt;/bean&gt;</span></p> <p><span style="color: #000000;"> &lt;!-- 启用缓存注解功能,该注解一定要声明在Spring主配置文件中才会生效 --&gt;<br> &lt;cache:annotation-driven cache-manager="cacheManager" /&gt;<br> &lt;bean id="cacheManager"<br>  class="org.springframework.cache.concurrent.ConcurrentMapCacheManager" /&gt;</span></p> <p><span style="color: #000000;"> &lt;!-- 资源文件加载 --&gt;<br> &lt;mvc:resources mapping="/upload/**" location="/upload/"<br>  cache-period="31556926" /&gt;<br> &lt;mvc:resources mapping="/libs/**" location="/libs/"<br>  cache-period="31556926" /&gt;<br>&lt;/beans&gt;<strong><br>上传的图片为包结构</strong></span></p> <p> </p> <p><span style="color: #000000;"><strong>Service的注解在接口实现类中</strong></span></p> <p><span style="color: #000000;"><strong>@Service<br>@Transactional<br>public class SiteServiceImpl implements SiteService {</strong></span></p> <p><span style="color: #000000;"><strong>.......</strong></span></p> <p><span style="color: #000000;"><strong>}</strong></span></p> <p> </p> <p><span style="color: #000000;">请问是哪里配置错了么</span></p> </div>

基于Struts的MVC模式研究与应用

以上是我的毕业设计题目,想听听大家对这个题目的看法与其思路指导! 具体的内容及要求如下: 内容要求: (1)、研究MVC设计模式、struts工作原理和组件。 (2)、 应用Struts技术开发一个《XX大学毕业生就业网站》,主要功能有: 用户注册功能、用户登陆功能、人发才招聘功能、求职、留言板等功能。 (3)、在校园网上能正常运行、访问。 (4)、提交文件:毕业设计(论文)+源程序文件+数据库文件+安装使用指南。 主要技术: struts技术、Hibenate技术、mysql数据库、Myeclipse8.0开发工具 我想听听大家如果拿到这个题目后会怎么样着手准备,具体点更好!如数据库设计,各个功能的实现要求,如何做需求分析更好一些,等等...本人基础不是很好哦。所以恳请大家不要厌恶反感而没耐心! 谢谢各位指点! :) 与其开题报告我应该如何阐述好呢? 一、选题的目的、意义及相关研究动态和自己的见解: 二、课题的主要内容: 三、研究方法、设计方案或论文撰写提纲:

spring mvc 400 Required String parameter 'quizId' is not present 前端参数找不到

<div class="iteye-blog-content-contain" style="font-size: 14px;"> <p>如下图所展示, 前端发起一个异步请求,传递了一个json对象</p> <pre name="code" class="js">$scope.addQuestionToTest = function(qid){ var sendData={"quizId":$scope.tid,"questionId":qid}; $http({ url: WEBROOT+"/test/addquestion", method: 'POST', headers: { "Authorization": Data.token() }, data: sendData }).success(function (data) {...</pre> <p> <br>firebug中的前端数据如下 <br><img src="http://dl2.iteye.com/upload/attachment/0103/2962/d34f0bbc-ff2f-3ebc-890b-b71ece1759c9.png" alt=""><br>头信息</p> <p><br><br><img src="http://dl2.iteye.com/upload/attachment/0103/2964/5eee1a0f-0b3d-3192-a9d4-c2ef4a947288.png" alt=""><br> <br> <br>以下服务端的代码</p> <pre name="code" class="java"> @RequestMapping(value = "/addquestion",method=RequestMethod.POST) @ResponseBody public ResponseBase addQuestion( @RequestParam(value="quizId", required=true) String quizId, @RequestParam(value="questionId", required=true) Integer questionId ) { </pre> <p class="annotation">  <br>spring mvc中报错400, debug跟到spring web的DispatchServlet,发现抛出的具体异常是请求的quizId找不到</p> <div id="" class="dp-highlighter"> <div class="bar"> <div class="tools"> <pre name="code" class="java"> org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'quizId' is not present </pre>  </div> </div> </div> <p>奇了个怪了,为什么会找不到前端的参数,明明再firebug中都有的,请各位指教</p> <p> </p> </div>

Spring MVC中ResponseBody, ResponseEntity和异常返回的问题

先看代码: ``` @RestController public class SampleController { @RequestMapping("/resp") public String sampleResp(){ System.out.println(1/0); return "Hello"; } } ``` 此时使用postman或者httprequester请求,响应状态码500,但是response中如下: ``` { "timestamp": 1489320286710, "status": 500, "error": "Internal Server Error", "exception": "java.lang.ArithmeticException", "message": "/ by zero", "path": "/resp" } ``` 第一个问题: 目前项目中没有做统一异常处理和添加ExceptionnReslovers, 有没有能帮忙找出具体源码,就是这些信息从哪里取出来的。 第二个问题: ResponseEntity中存在于HttpStatus和HttpHeader,可以通过ResponseEntity来返回Http的头和状态, 我想知道源码中具体的response.setStatus和addHeader在哪里? 刚刚使用CSDN,没多少金币,求大神帮忙。

java web ssm项目,点击页面一直在响应,前端后端都不报错,停止tomcat后,后端报错,新手求解答。具体情况如下:

下面是停止tomcat后的报错信息: 08-Mar-2020 19:21:22.961 ���� [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Stack trace of request processing thread:[ org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:191) org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:134) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:409) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) org.springframework.web.servlet.FrameworkServlet.publishRequestHandledEvent(FrameworkServlet.java:1141) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1023) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) javax.servlet.http.HttpServlet.service(HttpServlet.java:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)] 08-Mar-2020 19:21:22.963 ���� [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Stack trace of request processing thread:[ java.io.WinNTFileSystem.canonicalize0(Native Method) java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428) java.io.File.getCanonicalPath(File.java:618) org.apache.catalina.webresources.AbstractFileResourceSet.file(AbstractFileResourceSet.java:90) org.apache.catalina.webresources.DirResourceSet.getResource(DirResourceSet.java:101) org.apache.catalina.webresources.StandardRoot.getResourceInternal(StandardRoot.java:281) org.apache.catalina.webresources.Cache.getResource(Cache.java:62) org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:216) org.apache.catalina.webresources.StandardRoot.getClassLoaderResource(StandardRoot.java:225) org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2241) org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:833) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1278) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1138) java.lang.Class.forName0(Native Method) java.lang.Class.forName(Class.java:348) com.sun.beans.finder.ClassFinder.findClass(ClassFinder.java:103) com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:93) com.sun.beans.finder.InstanceFinder.find(InstanceFinder.java:66) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)] 08-Mar-2020 19:21:22.969 ���� [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Stack trace of request processing thread:[ org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:191) org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:134) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:409) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) org.springframework.web.servlet.FrameworkServlet.publishRequestHandledEvent(FrameworkServlet.java:1141) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1023) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) javax.servlet.http.HttpServlet.service(HttpServlet.java:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)] 08-Mar-2020 19:21:22.984 ���� [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Stack trace of request processing thread:[ org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:191) org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:134) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:409) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) org.springframework.web.servlet.FrameworkServlet.publishRequestHandledEvent(FrameworkServlet.java:1141) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1023) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) javax.servlet.http.HttpServlet.service(HttpServlet.java:634) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)] 08-Mar-2020 19:21:22.987 ���� [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Stack trace of request processing thread:[ org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:191) org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:134) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:409) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) org.springframework.web.servlet.FrameworkServlet.publishRequestHandledEvent(FrameworkServlet.java:1141) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1023) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) javax.servlet.http.HttpServlet.service(HttpServlet.java:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)] 08-Mar-2020 19:21:22.995 ���� [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Stack trace of request processing thread:[ org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:191) org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:134) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:409) org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) org.springframework.web.servlet.FrameworkServlet.publishRequestHandledEvent(FrameworkServlet.java:1141) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1023) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) javax.servlet.http.HttpServlet.service(HttpServlet.java:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)] 08-Mar-2020 19:21:22.998 ���� [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Object.wait(Native Method) java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144) com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:85) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) 08-Mar-2020 19:21:23.018 ��Ϣ [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcess![图片说明](https://img-ask.csdn.net/upload/202003/08/1583673409_243459.png) orBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) ![图片说明](https://img-ask.csdn.net/upload/202003/08/1583673431_759386.png) 之前都好好的,莫名其妙就不行了。白色部分用ajax请求查询数据,统计人数,绿色和蓝色部分是几个统计图,之前都没问题,突然就报错了。下面是页面转换的代码和统计人数的代码(白色部分): ![图片说明](https://img-ask.csdn.net/upload/202003/08/1583673520_970977.png)![图片说明](https://img-ask.csdn.net/upload/202003/08/1583673530_529970.png) ``` 下面附上配置文件的代码:applicationContext.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" xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd"> <!-- 配置扫描包 --> <context:component-scan base-package="com.clgc.service"></context:component-scan> <!-- 加载配置文件 --> <bean id = "dbConfig" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> <property name="locations"> <array> <value>classpath:db.properties</value> </array> </property> </bean> <!-- 配置数据库连接池 --> <bean id = "dataSource" class = "com.alibaba.druid.pool.DruidDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}"></property> <property name="url" value="${jdbc.url}"></property> <property name="username" value = "${jdbc.username}"></property> <property name="password" value="${jdbc.password}"></property> </bean> <!-- spring整合mybatis(将mybatis的核心sqlSessionFactory交给spring管理) --> <!-- 1,配置sqlSessionFactory --> <bean id = "sqlSessionFactory" class = "org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <!-- 自动扫描mapping.xml文件 --> <property name="mapperLocations" value ="classpath:mapper/*.xml"></property> </bean> <!--2,将sqlSessionFactory交给spring mapperScanner --> <bean class = "org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property> ``` ``` <!-- 指定批量生产那个包中的mapper ,DAO接口所在包名,Spring会自动查找其下的类 --> <property name="basePackage" value="com.clgc.dao"></property> </bean> <!-- 配置事务管理器 --> <bean id = "txManager" class = "org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref = "dataSource"></property> </bean> <!-- 增加spring对事务的支持 --> <tx:annotation-driven transaction-manager="txManager"/> <!--启动注解--> <context:annotation-config/> </beans> ``` ``` applicationContext-Controller.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:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"> <!-- 将控制器所在包加入容器 --> <context:component-scan base-package="com.clgc.controller"></context:component-scan> <!-- 配置试图解析器 --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/views/"></property> <!--前缀: --> <property name="suffix" value=".jsp"></property> <!-- 后缀: --> <!--Controller中的方法中,返回值是/views/xxx.jsp 如Controller中的welcome,会返回/views/success.jsp --> </bean> <!-- mvc基础配置,标配 --> <mvc:annotation-driven></mvc:annotation-driven> <mvc:default-servlet-handler /> </beans> ``` ``` web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> ``` ``` <welcome-file-list> <welcome-file>/views/index.jsp</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.jsp</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <display-name>PersonManager</display-name> <!-- Spring和mybatis的配置文件 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <!--Spring监听器--> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 编码过滤器 --> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <async-supported>true</async-supported> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 防止Spring内存溢出监听器 --> <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> </listener> <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/resources/*</url-pattern> </servlet-mapping> ``` ``` ``` ``` <!--Spring MVC servlet--> <servlet> <servlet-name>SpringMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext-Controller.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> </servlet> <servlet-mapping> <servlet-name>SpringMVC</servlet-name> <!-- 此处可以可以配置成*.do,对应struts的后缀习惯 --> <url-pattern>/</url-pattern> </servlet-mapping> </web-app> ``` 求求各位大神帮帮忙,百度了好久了,找到问题所在。 好像是数据库查询的问题,今天我把主页的js代码全部注释了 ,新建了一个ajax,当自己设置一组值返回的时候没问题,但是一涉及到数据库查询,就不行了 ![图片说明](https://img-ask.csdn.net/upload/202003/09/1583724656_836612.jpg) ![图片说明](https://img-ask.csdn.net/upload/202003/09/1583724724_674167.png)

spring3.0.5MVC 获取不到@RequestMapping定义的Action类

在部署spring3.0.5 mvc时碰到获取不到自定义的actin类的问题,请帮忙看看,谢谢! 项目环境: spring3.0.5 release + hibernate3 配置文件web.xml: <servlet> <servlet-name>dss</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/META-INF/dss-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dss</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> dss-servlet.xml: <context:component-scan base-package="com.potevio.web.action"/> <mvc:annotation-driven/> java代码: @Controller public class LoginAction extends BaseAction { UserDAO userService; @RequestMapping(value = "/dss/login.do", method = RequestMethod.POST) public String login(@RequestParam String name, @RequestParam String password, Model model, HttpServletRequest request) throws Exception {} } 运行tomcat,看到日志中已经匹配到了2012-02-27 15:46:20|INFO|Mapped URL path [/dss/login.do] onto handler 'loginAction' 但是在登录页面点击提交时找不到页面。日志中提示如下: 2012-02-27 15:47:24|DEBUG|opened session at timestamp: 13303288441 2012-02-27 15:47:24|DEBUG|DispatcherServlet with name 'dss' processing GET request for [/dss/login.do] 2012-02-27 15:47:24|WARN|No mapping found for HTTP request with URI [/dss/login.do] in DispatcherServlet with name 'dss' 2012-02-27 15:47:24|DEBUG|Successfully completed request 具体配置与日志见附件。

Mybatis 自动生成代码工具 ---- 却没有生成DAO具体实现类

我的配置: [code="java"] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> <generatorConfiguration> <!-- 连接数据库的JAR包 --> <classPathEntry location="mysql-connector-java-5.0.8-bin.jar" /> <context id="mysqlTables" targetRuntime="MyBatis3"> <!-- 去掉生成出来的代码的注解 --> <commentGenerator> <property name="suppressAllComments" value="true" /> <property name="suppressDate" value="true" /> </commentGenerator> <!-- 连接 --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/test" userId="root" password="******"> </jdbcConnection> <javaTypeResolver > <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <!-- 生成model\xml\dao --> <javaModelGenerator targetPackage="test.model" targetProject="src"> <property name="enableSubPackages" value="true" /> <property name="trimStrings" value="true" /> </javaModelGenerator> <sqlMapGenerator targetPackage="test.xml" targetProject="src"> <property name="enableSubPackages" value="true" /> </sqlMapGenerator> <javaClientGenerator type="XMLMAPPER" targetPackage="test.dao" targetProject="src"> <property name="enableSubPackages" value="true" /> </javaClientGenerator> <!-- 要生成的相关数据表,如果有多个表的话,需要配置多个 --> <table tableName="user"> <property name="ignoreQualifiersAtRuntime" value="true" /> <property name="runtimeTableName" value="user" /> </table> </context> </generatorConfiguration> [/code] 关于DAO层的配置具体是这些代码: [code="java"] <javaClientGenerator type="XMLMAPPER" targetPackage="test.dao" targetProject="src"> <property name="enableSubPackages" value="true" /> </javaClientGenerator [/code] 可是这样遇到一个问题,就是只生成了UserMapper.java 具体内容如下,部分省略: [code="java"] public interface UserMapper { int countByExample(UserExample example); } [/code] 比较好奇的是,只生成了接口类,却没有生成具体实现类,是不是我配置有问题?

springmvc+springsecurity配置问题

配置文件如下: ![web.xml](https://img-ask.csdn.net/upload/201605/26/1464271969_984130.png) ![spring-mvc.xml](https://img-ask.csdn.net/upload/201605/26/1464271996_169251.png) ![spring-security](https://img-ask.csdn.net/upload/201605/26/1464272016_955368.png) ![启动错误信息](https://img-ask.csdn.net/upload/201605/26/1464272038_284217.png) 请问是什么问题导致启动报错的,还有web.xml里的这段配置具体作用是什么呢 <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>

spring mvc 中如何绑定多个(个数不确定,动态变化)相同对象?

<div class="iteye-blog-content-contain" style="font-size: 14px;"> <p>有如下应用场景:有一个投票系统,每一个投票主题下面有多个子调查,并且子调查的个数是不确定的,可能1个,也可能多个,具体几个用户可以动态添加子调查。假设调查主题和子调查定义如下:</p> <p>调查主题Vote</p> <p> </p> <pre name="code" class="java">public class Vote { private int id; private String content; private Set&lt;SubVote&gt; subVotes; //略去getter/setter即其它属性 }</pre> <p> 调查主题的子调查:</p> <p> </p> <pre name="code" class="java">public class SubVote { private int id; private Vote vote; private String name; //略去getter/setter即其它属性 }</pre> <p> 根据前面的叙述,调查主题下面可以有若干个子调查,子调查的个数和具体内容用户录入,然后提交,问题是:由于可能有多个子调查“SubVote”,这多个(具体个数不定)子调查的表单在提交时服务器端如何处理?表单又该如何设计?(要防止出现子调查1的选项和子调查2的选项混淆,并且子调查SubVote的属性名字是一样的)</p> <p> </p> <p>这个问题和帖子:<a style="font-size: 1.2em; line-height: 1.5em; color: white; text-decoration: underline; background-color: #e9650e;" href="http://jinnianshilongnian.iteye.com/blog/1717180">扩展SpringMVC以支持更精准的数据绑定</a> 中的问题不一样,思索再三没有好的解决办法。</p> <p>我想的变通的解决方法是:先添加调查主题,然后一个一个的为主题添加子调查。</p> <p>但我想要一次添加一个主题和多个子调查的解决方案,请关注,谢谢!</p> </div>

使用maven搭建的ssm框架能够访问jsp页面但是就是无法访问controller层,代码如下

controller层是这样的 @Controller @RequestMapping("web_User") public class UserController { private static final Logger logger = Logger.getLogger(UserController.class); @Resource private UserService userService; /** * 获取具体用户信息 * */ @RequestMapping(value = { "getUserById_test" }, method = { RequestMethod.POST }) public @ResponseBody Map<String,Object> getVideoById(@RequestParam long id) { User user = userService.finduserById(id); Map<String, Object> map = new HashMap<String, Object>(); map.put("result", user); return map; } } applicationcontext是这样的 <?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:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:cache="http://www.springframework.org/schema/cache" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd "> <mvc:annotation-driven /> <context:annotation-config /> <mvc:default-servlet-handler /> <context:component-scan base-package="com.gp.demo.*" /> <!-- 启用缓存注解功能 --> <cache:annotation-driven cache-manager="cacheManager"/> <!-- 缓存管理器工厂加载ehcache的配置 --> <bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> <property name="configLocation" value="classpath:ehcache.xml"/> </bean> <!-- 声明缓存管理器 --> <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"> <property name="cacheManager" ref="cacheManagerFactory"/> </bean> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <value>classpath:jdbc.properties</value> </property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="packagesToScan"> <list> <value>com.gp.demo.domain</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="hibernate.show_sql">true</prop> </props> </property> </bean> <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> <property name="initialSize" value="${jdbc.initialSize}" /> </bean> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="dataSource" ref="dataSource" /> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <!-- 连接事务的注解配置 --> <tx:annotation-driven transaction-manager="transactionManager" /> <!-- 配置事务的传播特性 hibernate4必须配置为开启事务 否则 getCurrentSession()获取不到 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="Find*" propagation="REQUIRED" read-only="true" /> <tx:method name="is*" propagation="REQUIRED" read-only="true" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="send*" propagation="REQUIRED" /> <tx:method name="accept*" propagation="REQUIRED" /> <tx:method name="approve*" propagation="REQUIRED" /> <tx:method name="count*" propagation="REQUIRED" /> <tx:method name="sort*" propagation="REQUIRED" /> <tx:method name="set*" propagation="REQUIRED" /> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="create*" propagation="REQUIRED" /> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="merge*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="remove*" propagation="REQUIRED" /> <tx:method name="put*" propagation="REQUIRED" /> <tx:method name="use*" propagation="REQUIRED" /> <tx:method name="register*" propagation="REQUIRED" /> <tx:method name="search*" propagation="REQUIRED" /> <tx:method name="get*" propagation="REQUIRED" /> <tx:method name="cancel*" propagation="REQUIRED" /> <tx:method name="login*" propagation="REQUIRED" read-only="true" /> <tx:method name="count*" propagation="REQUIRED" read-only="true" /> <tx:method name="find*" propagation="REQUIRED" read-only="true" /> <tx:method name="list*" propagation="REQUIRED" read-only="true" /> <!-- <tx:method name="*" read-only="true" /> --> </tx:attributes> </tx:advice> <!-- 那些类的哪些方法参与事务 --> <aop:config> <aop:pointcut id="allManagerMethod" expression="execution(public * com.gp.demo.service.*.*(..))" /> <aop:advisor pointcut-ref="allManagerMethod" advice-ref="txAdvice" /> </aop:config> <mvc:annotation-driven /> <bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver" /> <bean id="conversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean" /> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /> <bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" /> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="order" value="0" /> <property name="cacheSeconds" value="0" /> <property name="webBindingInitializer"> <bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer"> </bean> </property> <property name="messageConverters"> <list> <bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter" /> <bean class="org.springframework.http.converter.StringHttpMessageConverter" /> <bean class="org.springframework.http.converter.FormHttpMessageConverter" /> <bean class="org.springframework.http.converter.xml.SourceHttpMessageConverter" /> <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" /> </list> </property> </bean> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/"></property> <property name="suffix" value=".jsp"></property> </bean> <!-- 定时邮件 --> <!-- end 定时邮件 --> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <!-- 设置上传文件的最大尺寸为100MB --> <property name="maxUploadSize"> <value>104857600</value> </property> </bean> <!-- SpringMVC在超出上传文件限制时,会抛出org.springframework.web.multipart.MaxUploadSizeExceededException --> <!-- 该异常是SpringMVC在检查上传的文件信息时抛出来的,而且此时还没有进入到Controller方法中 --> <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> <property name="exceptionMappings"> <props> <!-- 遇到MaxUploadSizeExceededException异常时,自动跳转到/WEB-INF/jsp/error_fileupload.jsp页面 --> <prop key="org.springframework.web.multipart.MaxUploadSizeExceededException">error_fileupload</prop> </props> </property> </bean> <!-- <bean id="Obtainemile" class="com.wiwoworld.oa.web.NoticeController.Obtainemile" scope="singleton" init-method="startThread"></bean> <bean id="affordVisit" class="com.xmpp.manager.MangerThread.visitDatabase" scope="singleton" init-method="startThread"></bean> --> <!-- <bean id="lunxunqidong" class="com.wiwoworld.oa.web.NoticeController" scope="singleton" init-method="searchMailnotice"></bean> --> </beans>

springmvc+mybatis访问页面出现Handler dispatch failed

今天搭springmvc+mybatis的时候,服务器启动没有问题,访问页面的时候出现处理程序调度失败的问题,找了好久也一点头绪没有发现。 具体错误如下: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.getResponseStatus()Lorg/springframework/http/HttpStatus; org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:982) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:622) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

java.io.StreamCorruptedException: invalid stream header: 77327070是什么情况如何解决?

springboot+datajpa+sqlserver报Caused by: invalid stream header: 77327070是什么情况如何解决? 刚接触springboot+jpa的小白,拜求各路大神的帮忙: 开发工具是eclipse: 没写controller层,先用junit测试crud(即增删改查)中其中的修改和删除,不能用,代码如下: 实体编译好后 1.首先JpaRepository层用的完全是继承JpaRepository的借口自带方法,出查询外没用自定义任何修改: @Repository @Transactional public interface sd extends JpaRepository<sd, String>{ Page<sd> findAll(Pageable pageable); } ```2.service 层是: @Override @Modifying @Transactional public void delete(String pid) { // TODO Auto-generated method stub cd.deleteById(pid); } @Override public boolean update(sd sf) { // TODO Auto-generated method stub cd.save(cfb); return true; } 3.测试类中: @Test @Modifying @Transactional public void deletepro() { cps.delete("fef232"); } @Test public void querypro() { /* int page=1,size=10; Sort sort = new Sort(Direction.DESC, "pid"); Pageable pageable = new PageRequest(page, size, sort); System.out.println(cps.findByPages(pageable));*/ } ``4.具体报错为: **org.hibernate.type.SerializationException: could not deserialize** at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191] .......(太长了懒得粘了省略) **Caused by: java.io.StreamCorruptedException: invalid stream header: 77327070 ** at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:866) ~[na:1.8.0_191] at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358) ~[na:1.8.0_191] at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:309) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:299) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:218) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final] ... 110 common frames omitted 5,配置用的是:application.properties 具体是: #port is update server.port=8080 #connection spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver spring.datasource.url=jdbc:sqlserver://localhost:1433;DatabaseName=tzc12 spring.datasource.username=sa1 spring.datasource.password=qq hibernate.dialect=org.hibernate.dialect.SQLServerDialect spring.jpa.properties.hibernate.show_sql=true spring.jpa.hibernate.ddl-auto = update # Naming strategy spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy #controller spring.mvc.view.prefix=/ spring.mvc.view.suffix=.jsp #Connection Pool spring.datasource.initialSize=5 spring.datasource.minIdle=5 spring.datasource.maxActive=20 spring.datasource.maxWait=60000 spring.datasource.timeBetweenEvictionRunsMillis=60000 spring.datasource.minEvictableIdleTimeMillis=300000 spring.datasource.validationQuery=SELECT 1 FROM DUAL spring.datasource.testWhileIdle=true spring.datasource.testOnBorrow=false spring.datasource.testOnReturn=false ``` 除外,测试查询方法时junit未报错,但出现了以下情况是什么原因?如何解决: JpaRepository层看最上面 service层: @Override public Page<sd> findByPages(Pageable pageable) { // TODO Auto-generated method stub return cd.findAll(pageable); } @Test public void querypro() { int page=1,size=10; Sort sort = new Sort(Direction.DESC, "pid"); Pageable pageable = new PageRequest(page, size, sort); System.out.println(cps.findByPages(pageable)); } 结果出来为: Page 2 of 1 containing UNKNOWN instances 更新后: 实体类: sd为主表,cds为附表,即cds 的主键是sd的外键。 @Entity @Table(name="cftbiop") public class sd implements Serializable{ /** * */ private static final long serialVersionUID = 8786038170195933216L; @Id private String pid=(UUID.randomUUID().toString()) ; private String pname ; private String introduction; private String marque; private String showcase; private String waytoraise ; private int suppot; private int raisefunds ; private int goalnum ; private cds showid; @ManyToOne @JoinColumn(name="showid") public cds getShowid() { return showid; } public void setShowid(CFShowProspecification showid) { this.showid = showid; } private boolean homepagedisplay; private int price; 其余getter,setter省略不粘了,都已getter,setter, 测试查询方法,把page改为0后,报了和删除,修改一样的错误

DispatcherServlet 前端控制器

知识摘自:http://jinnianshilongnian.iteye.com/blog/1602617 3.1、DispatcherServlet作用 DispatcherServlet是前端控制器设计模式的实现,提供Spring Web MVC的集中访问点,而且负责职责的分派,而且与Spring IoC容器无缝集成,从而可以获得Spring的所有好处。 具体请参考第二章的图2-1。 DispatcherServlet主要用作职责调度工作,本身主要用于控制流程,主要职责如下: 1、文件上传解析,如果请求类型是multipart将通过MultipartResolver进行文件上传解析; 2、通过HandlerMapping,将请求映射到处理器(返回一个HandlerExecutionChain,它包括一个处理器、多个HandlerInterceptor拦截器); 3、通过HandlerAdapter支持多种类型的处理器(HandlerExecutionChain中的处理器); 4、通过ViewResolver解析逻辑视图名到具体视图实现; 5、本地化解析; 6、渲染具体的视图等; 7、如果执行过程中遇到异常将交给HandlerExceptionResolver来解析。 从以上我们可以看出DispatcherServlet主要负责流程的控制(而且在流程中的每个关键点都是很容易扩展的)。

请教:有人知道springMVC配置文件报错,但是不影响项目启动。报错信息如下:

Error occured processing XML '[Ljava.lang.String; cannot be cast to java.lang.String'. See Error Log for more details![图片说明](https://img-ask.csdn.net/upload/201610/11/1476158976_345034.png)

急求 使用代理出现类型转换异常!!!

非常抱歉,由于问题还没有解决而点了关闭问题,在此道歉,用mysql连接没有出现问题,而用sqlserver就出现下述问题。 具体代码如下,异常出现在getConnection方法中Connection conn2 = (Connection)Proxy.newProxyInstance(conn.getClass().getClassLoader(),conn.getClass().getInterfaces(),this); 异常内容:Exception in thread "main" java.lang.ClassCastException: $Proxy0 at com.think.Handler.bind(Handler.java:24) at com.think.TestProxy.main(TestProxy.java:9) 代码: package tutorial.DBUtil; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.sql.Connection; import java.sql.SQLException; public class _Connection implements InvocationHandler { private final String CLOSE_METHOD_NAME = "close"; private Connection conn = null; private boolean inUse = false; //数据库的忙状态 private long lastAccessTime = System.currentTimeMillis();//用户最后一次访问该连接方法的时间 _Connection(Connection conn,boolean inUse) { this.conn = conn; this.inUse = inUse; } /** * Returns the conn. * @return Connection */ public Connection getConnection() { //返回数据库连接conn的接管类,以便截住close方法 Connection conn2 = (Connection)Proxy.newProxyInstance( conn.getClass().getClassLoader(), conn.getClass().getInterfaces(),this); return conn2; } /** * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object) */ public Object invoke(Object proxy,Method m,Object[] args) { Object obj = null; if(CLOSE_METHOD_NAME.equals(m.getName())) { setInUse(false); }else{ try { m.invoke(conn, args); ////设置最后一次访问时间,以便及时清除超时的连接 lastAccessTime = System.currentTimeMillis(); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return obj; } /** * 该方法真正的关闭了数据库的连接 * @throws SQLException */ public void close() throws SQLException { //由于类属性conn是没有被接管的连接,因此一旦调用close方法后就直接关闭连接 conn.close(); } /** * Returns the inUse. * @return boolean */ public boolean isInUse() { return inUse; } /** * Returns the lastAccessTime. * @return long */ public long getLastAccessTime() { return lastAccessTime; } /** * Sets the inUse. * @param inUse The inUse to set */ public void setInUse(boolean inUse) { this.inUse = inUse; } } 问题补充: public static void main(String[] args) throws Exception { Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance(); String url = "jdbc:microsoft:sqlserver://localhost:1433;databasename=Test"; Connection conn = DriverManager.getConnection(url, "sa", "123456"); // Connection con = getConnection(); _Connection _con = new _Connection(conn,true); Connection cs = _con.getConnection(); PreparedStatement ps = cs.prepareStatement("select * from testuser"); ResultSet rs = ps.executeQuery(); while (rs.next()) { System.out.print(rs.getString(1) + "\n"); System.out.print(rs.getString(2) + "\n"); } cs.close(); } 其他的除了 obj = m.invoke(conn,args);修改外都一样。既然楼下测试没有问题,我想是否是我的环境中少些东西。当我不用代理时候,一切连接正常。当调用Connection cs = _con.getConnection();就会报异常,Debug 时候在Thread.dispatchUncaughtExcetpion(Throwable) line:not available 页中显示Source not found. 问题补充: 根据楼下的要求 我贴出了main方法,问题还是存在 [b]问题补充:[/b] 针对你提的两个可能,我晚上回去测试下,希望在此期间你能给出更多可能,谢谢 [b]问题补充:[/b] 导入的 java.sql.Connection是JDBC3.0的。就会出现ClassCastException,而且不会打印出更详细的错误信息。 SqlServer2005支持JDBC3.0,那你的意思是只能用2005的版本? [b]问题补充:[/b] 找了下,好象没有提供的啊,能否给提供下?再次谢谢你的关注! [b]问题补充:[/b] 象这样说 我只能用sqlserver2005的版本了? [b]问题补充:[/b] 不错啊 我晚上找个2005的驱动包 调试下,要是行的通的话就结帖,非常感激你的帮助!

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你打算用Java 8一辈子都不打算升级到Java 14,真香

我们程序员应该抱着尝鲜、猎奇的心态,否则就容易固步自封,技术停滞不前。

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

一文带你入门Java Stream流,太强了

两个星期以前,就有读者强烈要求我写一篇 Java Stream 流的文章,我说市面上不是已经有很多了吗,结果你猜他怎么说:“就想看你写的啊!”你看你看,多么苍白的喜欢啊。那就“勉为其难”写一篇吧,嘻嘻。 单从“Stream”这个单词上来看,它似乎和 java.io 包下的 InputStream 和 OutputStream 有些关系。实际上呢,没毛关系。Java 8 新增的 Stream 是为...

立即提问
相关内容推荐