springmvc页面访问不到,也没有报错,下面的日志信息

2017-11-13 08:36:17,837 [org.springframework.web.servlet.DispatcherServlet]-[DEBUG] DispatcherServlet with name 'springmvc' processing GET request for [/customer/list]
2017-11-13 08:36:17,837 [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]-[DEBUG] Looking up handler method for path /customer/list
2017-11-13 08:36:17,837 [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]-[DEBUG] Returning handler method [public java.lang.String controller.CustomerController.list(org.springframework.ui.Model)]
2017-11-13 08:36:17,837 [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'customerController'
2017-11-13 08:36:17,837 [org.springframework.web.servlet.DispatcherServlet]-[DEBUG] Last-Modified value for [/customer/list] is: -1
preHandle /customer/list
2017-11-13 08:36:17,837 [org.springframework.web.servlet.DispatcherServlet]-[DEBUG] Successfully completed request

5个回答

这个最好吧代码复制出来看看 不然猜不到

日志最后截图出来看看呀 你这样太少了 看不到原因

有没有error的信息

没有error信息,debug不会阻挡的,这有可能是你的jsp有问题,看日志貌似是成功了

被自己设置的拦截器拦截了,所以返回为-1.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

一个spring mvc项目,异常信息直接输出到页面上,而控制台日志里面却没有打印异常堆栈信息?

一个spring mvc项目,异常信息直接输出到页面上,而控制台日志里面却没有打印异常堆栈信息? 如下图,错误的堆栈信息都输出到了页面上 ![](https://img-ask.csdn.net/upload/202002/21/1582283746_64987.png) 而控制台的日志里面却不打印 附上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" id="WebApp_ID" version="3.0"> <!-- The definition of the Root Spring Container shared by all Servlets and Filters --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:META-INF/spring/spring-config.xml</param-value> </context-param> <context-param> <param-name>webAppRootKey</param-name> <param-value>manage-web.all.root</param-value> </context-param> <!-- Processes application requests --> <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:META-INF/spring/springMVC-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springMVC</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <!-- Creates the Spring Container shared by all Servlets and Filters --> <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> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> ```

web.xml加载bean.xml获取不到bean属性的值?也没有报错日志

以下是web.xml的代码截图 ![图片说明](https://img-ask.csdn.net/upload/201712/21/1513842619_200884.png) 以下是bean.xml的配置: <beans> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:../conf/system.properties"/> <property name="ignoreUnresolvablePlaceholders"><value>true</value></property> </bean> <bean id="log4jInitializer" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="staticMethod"><value>org.springframework.util.Log4jConfigurer.initLogging</value> </property> <property name="arguments"><list><value>classpath:../conf/log4j.xml</value><value>2000</value></list></property> </bean> <!-- <bean id="RSAUtil" class="com.ailk.toptea.ebomc.tomcat.RSAUtil"> <property name="rSAKeyStore"><value>${catalina.home}/webapps/ROOT/WEB-INF/conf/RSAKey.txt</value></property> </bean> --> <bean name="PasswdTask" class="com.ailk.toptea.ebomc.tomcat.user.PasswdTask" /> <bean id="jobDetail_PasswdTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="PasswdTask" /> <property name="targetMethod" value="start" /> </bean> <bean id="cronTrigger_PasswdTask" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobDetail_PasswdTask" /> <property name="cronExpression"> <value>0 0/5 * * * ?</value> </property> </bean> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="cronTrigger_PasswdTask" /> </list> </property> </bean> <!--scheme数据源配置 --> <!-- 20150728 add by gongzf, begin... --> <!--scheme数据源配置 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"><value>${scheme.jdbc.driverClassName}</value></property> <property name="url"><value>${scheme.jdbc.url}</value></property> <property name="username"><value>${scheme.jdbc.username}</value></property> <property name="password"><value>${scheme.jdbc.password}</value></property> <property name="maxActive"><value>${scheme.db.maxActive}</value></property> <property name="maxIdle"><value>${scheme.db.maxIdle}</value></property> <property name="maxWait"><value>${scheme.db.maxWait}</value></property> <property name="testOnBorrow" value="true"/> <property name="testWhileIdle" value="true"/> <property name="validationQuery" value="select 1 from dual"/> </bean> <bean id="DataBaseManager" class="com.ailk.toptea.ebomc.util.DataBaseManager"> <property name="dataSource"> <ref bean="dataSource"/> </property> <property name="apiKey"> <value>${baidu.apiKey}</value> </property> <property name="secretKey"> <value>${baidu.secretKey}</value> </property> <property name="pushToken"> <value>${ebomc.pushToken}</value> </property> <property name="iOSUpdatePath"> <value>${ebomc.iOSUpdatePath}</value> </property> <property name="host"> <value>${apns.host}</value> </property> <property name="port"> <value>${apns.port}</value> </property> <property name="cerPath"> <value>${apns.cerPath}</value> </property> <property name="cerPwd"> <value>${apns.cerPwd}</value> </property> </bean> <bean id="urlconfig" init-method="init" class="com.ailk.toptea.ebomc.util.URLConfig"> <property name="file"> <value>url.xml</value> </property> </bean> </beans> 以下是工程目录截图: ![图片说明](https://img-ask.csdn.net/upload/201712/21/1513842879_847204.png)

springmvc+mybatis 页面404,控制台无异常输出

DEBUG [http-8080-10] - DispatcherServlet with name 'springMvc' processing GET request for [/XYKJOA/getALLWorkPlan.do] DEBUG [http-8080-10] - Looking up handler method for path /getALLWorkPlan.do DEBUG [http-8080-10] - Returning handler method [public java.lang.String com.xykj.controller.WorkPlanController.getALLWorkPlan(javax.servlet.http.HttpServletRequest)] DEBUG [http-8080-10] - Returning cached instance of singleton bean 'workPlanController' DEBUG [http-8080-10] - Last-Modified value for [/XYKJOA/getALLWorkPlan.do] is: -1 DEBUG [http-8080-10] - Creating a new SqlSession DEBUG [http-8080-10] - Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@707cdc58] DEBUG [http-8080-10] - Fetching JDBC Connection from DataSource DEBUG [http-8080-10] - Registering transaction synchronization for JDBC Connection DEBUG [http-8080-10] - JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@24d2fb67] will be managed by Spring DEBUG [http-8080-10] - ooo Using Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@24d2fb67] DEBUG [http-8080-10] - ==> Preparing: select * from XY_WorkPlan DEBUG [http-8080-10] - ==> Parameters: DEBUG [http-8080-10] - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@707cdc58] DEBUG [http-8080-10] - Should roll back transaction but cannot - no transaction available DEBUG [http-8080-10] - Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@707cdc58] DEBUG [http-8080-10] - Returning JDBC Connection to DataSource DEBUG [http-8080-10] - Rendering view [org.springframework.web.servlet.view.JstlView: name 'work/workplan_list'; URL [/work/workplan_list.jsp]] in DispatcherServlet with name 'springMvc' DEBUG [http-8080-10] - Forwarding to resource [/work/workplan_list.jsp] in InternalResourceView 'work/workplan_list' DEBUG [http-8080-10] - Successfully completed request

通过表单提交到springmvc报错403

通过freemarker跳转到springmvc某个controller,如果是get方式则没什么问题。如果是post,这里表单制定的是post方式,controller制定的也是post,但是跳转不过去。并且报403错误 “HTTP Status 403 - Bad or missing token!”。求大神帮忙解决。感谢

windows启动tomcat卡住,控制台没有报错,但就是不往下走

![图片说明](https://img-ask.csdn.net/upload/202004/29/1588141727_878392.png) 如图所示,就一直卡在这,也没有任何报错信息,有大神知道是怎么回事吗,tomcat版本是7.0.94,jdk版本1.8

Tomcat项目部署成功,但是启动时项目没有启动,也没有报错,仍然跑空猫

![图片说明](https://img-ask.csdn.net/upload/201610/09/1475997888_618795.png) ![图片说明](https://img-ask.csdn.net/upload/201610/09/1475998128_596337.png) 一张是运行情况的图,一张是tomcat配置的图,把项目加载到tomcat中了,但是始终跑的是空猫,0.5秒tomcat就运行好了,访问项目就是404。。。求解啊,该怎么解决这个问题呢

整合Spring+SpringMVC+Hibernate时,无法进入控制层

整合Spring+SpringMVC+Hibernate时,启动正常,可以打开登录页面,但是进行登录时,无法进入controller层,而且不报错,只输出三行日志。 DispatcherServlet with name 'springMVC' processing POST request for [/SSH/user/login.do] No mapping found for HTTP request with URI [/SSH/user/login.do] in DispatcherServlet with name 'springMVC' Successfully completed request 意思大概是找不到路径,但应该不是路径的问题,如果路径有问题,页面上message会显示有问题的路径,而不是什么都没有。 HTTP Status 404 - type Status report message description The requested resource is not available. Apache Tomcat/7.0.82 spring-context.xml配置是这样的 <!-- 自动扫描 --> <context:component-scan base-package="service,dao,entity,controller"/> <!-- 配置数据源 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" > <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> <property name="url" value="jdbc:sqlserver://localhost:1433;database=user_role" /> <property name="username" value="sa"/> <property name="password" value="123456"/> </bean> <!-- 配置SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> <!--指定数据库方言--> <prop key="hibernate.hbm2ddl.auto">update</prop> <!--hibernate根据实体自动生成数据库表--> <prop key="hibernate.show_sql">true</prop> <!--在控制台显示执行的数据库操作语句--> <prop key="hibernate.format_sql">true</prop> <!--在控制台显示执行的数据库操作语句(格式)--> </props> </property> <property name="annotatedClasses"> <list> <value>entity</value> </list> </property> </bean> <!-- <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <bean id="userDao" class ="dao.UserDao"> <property name="sessionFactory" ref="sessionFactory" /> <property name="hibernateTemplate" ref="hibernateTemplate" /> </bean> --> <!-- 开启注解事务 --> <tx:annotation-driven transaction-manager="transactionManager"/> <!-- 事物管理器配置 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- 配置事务,使用代理的方式 --> <bean id="transactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true"> <property name="transactionManager" ref="transactionManager"></property> <property name="transactionAttributes"> <props> <prop key="add*">PROPAGATION_REQUIRED,-Exception</prop> <prop key="modify*">PROPAGATION_REQUIRED,-myException</prop> <prop key="del*">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> spring-mvc.xml配置 <!-- 开启注解 --> <mvc:annotation-driven /> <!-- 注解扫描包 --> <context:component-scan base-package="controller" /> <!-- 静态资源(js/image)的访问 --> <mvc:resources location="/js/" mapping="/js/**"/> <!-- 定义视图解析器 --> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/jsp/"></property> <property name="suffix" value=".jsp"></property> </bean> web配置 <display-name>SSH</display-name> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> <!-- 加载所有的配置文件 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:config/spring-context.xml</param-value> </context-param> <!-- 配置Spring监听 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 防止Spring内存溢出监听器 --> <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> </listener> <!-- 配置SpringMVC --> <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*:config/spring-mvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springMVC</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <!-- 配置字符集 --> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 如果OpenSession加了*号,启动时会报错,找不到名为sessionFactory的bean --> <!-- 配置Session --> <filter> <filter-name>openSession</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>sessionFactoryBeanName</param-name> <param-value>sessionFactory</param-value> </init-param> </filter> <filter-mapping> <filter-name>openSession</filter-name> <url-pattern>/</url-pattern> </filter-mapping>

web项目,访问某个文件返回404, 用的是springmvc, 服务器jetty

web工程下的某一个目录中有5个文件,其中有两个.svg文件, .woff .ttf .eot 文件各一个. 在tomcat服务器中,这5个文件可以正常访问. 将工程放入jetty容器中, 只能访问.svg文件, 访问另外三个文件则报错404, 错误日志是: No media type found for ServletContextresource [/fonts/inmoon.eot] returning 404

spring boot项目打成war包并且部署访问时该网页无法正常运作

项目启动时不报错,就是无法访问 ![访问时出现此情况](https://img-ask.csdn.net/upload/201809/26/1537940972_649417.jpg) 访问的时候服务器也没有日志,我打的是war包,详情看代码 POM.XML ``` <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-servlet-api</artifactId> <version>8.0.39</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <!-- 去除内嵌tomcat--> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> ``` ``` @EnableTransactionManagement @SpringBootApplication @MapperScan("com.vrqzd.dao") public class VrqzdApplication extends SpringBootServletInitializer implements CommandLineRunner { private final static Logger logger = LoggerFactory.getLogger(VrqzdApplication.class); public static void main(String[] args) { SpringApplication.run(VrqzdApplication.class, args); } @Override public void run(String... args) throws Exception { logger.info("主程序启动----------------->>启动完毕"); } } ``` ``` @EnableTransactionManagement @SpringBootApplication @MapperScan("com.vrqzd.dao") public class SpringBootStartApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { // 注意这里要指向原先用main方法执行的Application启动类 return builder.sources(VrqzdApplication.class); } } ``` ``` /** * 登录页面载入 * @param response * @return */ @RequestMapping(value ="login",method = RequestMethod.GET) public String login(HttpServletResponse response, HttpSession session, HttpServletRequest request){ // return "page/login"; logger.info("==============登录发起=========="); Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (session.getAttribute("ret")!=null){ request.setAttribute("ret", session.getAttribute("ret")); session.removeAttribute("ret"); } if(auth instanceof AnonymousAuthenticationToken){ return "page/login"; }else{ return "redirect:/user"; } } ``` 发起这个登录的时候后台没有任何日志,就给我一个该网页无法正常运作,

springMvc的post请求参数问题

最近使用spring mvc,有一个疑惑。别人调我的接口,新建一个资源,需要传一系列参数,一些参数是用来判断我新建资源方式的。这些参数放在url上是否更加合适,按照我的理解,post请求的话,body里面存放的是新建的资源内容,而用来做判断的参数放在url上。这样的理解不知道合不合理,希望大神解惑。

logback异常信息显示问题?

使用的spring mvc+hibernate框架,logback记录日志的时候,如果出了错误,没有用try。。catch捕捉并logger.error打印的话,能自动打印吗?我记得以前用log4j的话是可以的,现在我系统中出了错误,控制台也没错误信息,日志里面也没有,要是在Controller层的方法上都加上try..catch的话就麻烦了。。 有解决方案吗? 下面是我logback.xml配置: [code="xml"] <?xml version="1.0" encoding="UTF-8"?> <configuration> <property name="log.sh4frame" value="../logs/sh4frame" /> <jmxConfigurator /> <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</pattern> </encoder> </appender> <!-- 按照每天生成日志文件 --> <appender name="logfile" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${log.sh4frame}.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>${log.sh4frame}.%d{yyyy-MM-dd}.log.zip</FileNamePattern> <!--日志保存天数--> <maxHistory>100</maxHistory> </rollingPolicy> <encoder> <pattern>%relative [%thread] %level %logger - %msg%n</pattern> </encoder> <!--日志文件最大的大小 默认就是10M--> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <MaxFileSize>10MB</MaxFileSize> </triggeringPolicy> </appender> <!--日志异步到数据库 --> <logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="INFO" /> <logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="INFO"/> <logger name="org.hibernate.SQL" level="INFO" /> <logger name="org.hibernate.engine.QueryParameters" level="INFO" /> <logger name="org.hibernate.engine.query.HQLQueryPlan" level="INFO" /> <root level="INFO"> <appender-ref ref="stdout" /> <appender-ref ref="logfile" /> </root> </configuration> [/code]

Spring mvc做登录拦截,诡异的报404,tomcat日志没有任何输出

先看出错提示![图片说明](https://img-ask.csdn.net/upload/201506/17/1434534385_621647.png) TOMCAT没有日志输出,直接在浏览器报的404 拦截器类方法: public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { LoginAccount user=(LoginAccount) request.getSession().getAttribute("user"); String url=request.getRequestURL().toString(); System.out.println("进入拦截器,请求地址:"+url); if(user==null){ response.sendRedirect("index.jsp"); return false; }else{ return true; } } ``` 拦截器配置 <mvc:view-controller path="/" view-name="index"/> <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/**"/> <mvc:mapping path="/"/> <mvc:exclude-mapping path="/login.do"/> <mvc:exclude-mapping path="/logout.do"/> <mvc:exclude-mapping path="/room.do"/> <bean id="loginInterceptor" class="com.jszy.oa.intercepter.LoginInterceptor"> <property name="loginUrl" value="login.do"></property> </bean> </mvc:interceptor> </mvc:interceptors> ``` WEB.XML 配置,<url-pattern>节点参考http://iammr.7.blog.163.com/blog/static/49102699201222643458216/文章,拦截根目录。在用户SESSION未超时访问根目录时跳转到后台首页 <servlet> <servlet-name>spring-mvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <description>spring MVC 配置文件</description> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring-mvc-websocket.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring-mvc</servlet-name> <url-pattern></url-pattern> </servlet-mapping> ``` ``` 出问题的地方就在访问http://localhost:8080/oa/,点击登录时请求http://localhost:8080/oa/login.do报了404,没有输出日志。 如果把<url-pattern></url-pattern>改成<url-pattern>*.do</url-pattern> 拦截器能正常工作,就是没有办法拦截这个地址http://localhost:8080/oa/

tomcat日志调到debug,不报错但一直循环

springmvc + spring + mybatis tomcat日志调到debug,不报错但一直循环,如下:、 Creating shared instance of singleton bean 'trendsOperatorMapper' Creating instance of bean 'trendsOperatorMapper' Eagerly caching bean 'trendsOperatorMapper' to allow for resolving potential circular references Processing injected method of bean 'trendsOperatorMapper': AutowiredMethodElement for public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate) Processing injected method of bean 'trendsOperatorMapper': AutowiredMethodElement for public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory) Returning eagerly cached instance of singleton bean 'trendsOperatorMapper' that is not fully initialized yet - a consequence of a circular reference Creating shared instance of singleton bean 'sqlSessionFactory' Creating instance of bean 'sqlSessionFactory' Eagerly caching bean 'sqlSessionFactory' to allow for resolving potential circular references Creating shared instance of singleton bean 'dataSource' Creating instance of bean 'dataSource' Eagerly caching bean 'dataSource' to allow for resolving potential circular references Creating shared instance of singleton bean 'dataSource_model1' Creating instance of bean 'dataSource_model1' Ignoring bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'trendsOperatorMapper': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [jar:file:/data/webserver/webroot_meng/WebRoot/WEB-INF/lib/DaguuCenterServiceV2-1.0-SNAPSHOT.jar!/spring/applicationContext-base.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [jar:file:/data/webserver/webroot_meng/WebRoot/WEB-INF/lib/DaguuCenterServiceV2-1.0-SNAPSHOT.jar!/spring/applicationContext-base.xml]: Cannot resolve reference to bean 'dataSource_model1' while setting bean property 'targetDataSources' with key [TypedStringValue: value [model1], target type [class java.lang.String]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource_model1' defined in URL [jar:file:/data/webserver/webroot_meng/WebRoot/WEB-INF/lib/DaguuCenterServiceV2-1.0-SNAPSHOT.jar!/spring/applicationContext-base.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.mchange.v2.c3p0.ComboPooledDataSource]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.mchange.v2.c3p0.impl.C3P0Defaults Creating shared instance of singleton bean 'sqlSessionFactory' Creating instance of bean 'sqlSessionFactory' Eagerly caching bean 'sqlSessionFactory' to allow for resolving potential circular references

SpringMVC整合Mybatis-plus3.0.5 使用分页插件 条件查询出错

![图片说明](https://img-ask.csdn.net/upload/201812/12/1544599459_621897.jpg) ![图片说明](https://img-ask.csdn.net/upload/201812/12/1544599316_753387.png) ![图片说明](https://img-ask.csdn.net/upload/201812/12/1544599377_201023.png)

这种错怎么解决突然报的404 导入之前的项目或者都复制过来都不报错 新建一个jsp页面就报404

7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server.服务器版本: Apache Tomcat/9.0.19 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server.构建: Apr 12 2019 14:22:48 UTC 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version number: 9.0.19.0 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 10 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS.版本: 10.0 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 结.造: amd64 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java 环境变量: C:\Program Files\Java\jre-9.0.4 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM 版本: 9.0.4+11 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM.供应商: Oracle Corporation 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: E:\mybatis\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: E:\mytomcat\apache-tomcat-9.0.19 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=E:\mybatis\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=E:\mytomcat\apache-tomcat-9.0.19 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=E:\mybatis\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps 7月 24, 2019 9:10:26 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=UTF-8 7月 24, 2019 9:10:26 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.6.5]. 7月 24, 2019 9:10:26 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 7月 24, 2019 9:10:26 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 7月 24, 2019 9:10:26 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized [OpenSSL 1.1.1a 20 Nov 2018] 7月 24, 2019 9:10:26 下午 org.apache.coyote.AbstractProtocol init 信息: 初始化协议处理器 ["http-nio-8080"] 7月 24, 2019 9:10:27 下午 org.apache.coyote.AbstractProtocol init 信息: 初始化协议处理器 ["ajp-nio-8009"] 7月 24, 2019 9:10:27 下午 org.apache.catalina.startup.Catalina load 信息: 服务器在[1,274]毫秒内初始化 7月 24, 2019 9:10:27 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service [Catalina] 7月 24, 2019 9:10:27 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet engine: [Apache Tomcat/9.0.19] 7月 24, 2019 9:10:27 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom 警告: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [171] milliseconds. 7月 24, 2019 9:10:32 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 7月 24, 2019 9:10:33 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 7月 24, 2019 9:10:33 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 7月 24, 2019 9:13:04 下午 org.apache.ibatis.mapping.VendorDatabaseIdProvider getDatabaseId 严重: Could not get a databaseId from dataSource java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName(VendorDatabaseIdProvider.java:76) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName(VendorDatabaseIdProvider.java:61) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId(VendorDatabaseIdProvider.java:49) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:395) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:295) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4682) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5150) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.base/java.util.concurrent.AbstractExecutorService.submit(Unknown Source) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.base/java.util.concurrent.AbstractExecutorService.submit(Unknown Source) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:423) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:932) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:633) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492) Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) ... 50 more WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.ibatis.reflection.Reflector (file:/E:/mybatis/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/aa/WEB-INF/lib/mybatis-3.2.2.jar) to method java.lang.Object.finalize() WARNING: Please consider reporting this to the maintainers of org.apache.ibatis.reflection.Reflector WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 7月 24, 2019 9:13:05 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'springmvc' 7月 24, 2019 9:13:06 下午 org.apache.coyote.AbstractProtocol start 信息: 开始协议处理句柄["http-nio-8080"] 7月 24, 2019 9:13:06 下午 org.apache.coyote.AbstractProtocol start 信息: 开始协议处理句柄["ajp-nio-8009"] 7月 24, 2019 9:13:06 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in [159,538] milliseconds web配置文件 <?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_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>SpringMybatisOa</display-name> <!-- dwr --> <servlet> <servlet-name>dwr_invoker</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>crossDomainSessionSecurity</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>dwr_invoker</servlet-name> <url-pattern>/dwre/*</url-pattern> </servlet-mapping> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springconfig/*.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>*.action</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app> springmvc配置 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="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.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <mvc:annotation-driven/><!-- 启动注解方式的mvc --> <context:component-scan base-package="action"/><!-- 扫描该包下所有类加载到容器 --> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/"/> <property name="suffix" value=".jsp"/> </bean> </beans> spring配置 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="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.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations" value="classpath:jdbc.properties"></property> </bean> <bean id="ds" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${driverClass}" /> <property name="jdbcUrl" value="${url}" /> <property name="user" value="${userName}" /> <property name="password" value="${passWord}" /> </bean> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="ds" /> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="ds" /> <!-- 自动扫描mapping.xml文件 --> <property name="mapperLocations" value="classpath:dao/*.xml"></property> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> <property name="basePackage" value="dao" /> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> <context:component-scan base-package="biz.impl"/> </beans> 在线等 急!!!

SpringMVC 整合FreeMarker时的问题

springMVCr的配置如下: [code="java"] <?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:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <context:component-scan base-package="com.ahmi.controller" /> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" /> <bean id="freemarkerResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"> <property name="order" value="1"/> <property name="prefix" value="/WEB-INF/freemarker"/> <property name="suffix" value=".ftl"/> <property name="contentType" value="text/html;charset=utf-8"/> <property name="viewClass"> <value>org.springframework.web.servlet.view.freemarker.FreeMarkerView</value> </property> </bean> <bean id="jspResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" p:order="2" /> <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> <property name="defaultEncoding" value="UTF-8"/> </bean> </beans> [/code] Controller如下: [code="java"] @Controller @RequestMapping("/user") @Scope("prototype") public class UserController { @RequestMapping public String show(@RequestParam long userId,ModelMap model){ System.out.println(Config.getString("user#Test")); User u = userService.getUser(userId); System.out.println(u.getUser2().size()); model.addAttribute("u",u); return "/user/test"; } } [/code] 在WEB-INF的freemarker/user目录下有test.ftl文件,但是通过路径:http://localhost:8080/Test/user?method=show&userId=20访问的时候却不能跳到ftl模板处。 分析日志时发现有这么几句话: 2010-01-22 15:48:41,468 [http-8080-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'freemarkerConfig' 2010-01-22 15:48:41,468 [http-8080-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name '/user/test' 2010-01-22 15:48:41,468 [http-8080-1] DEBUG freemarker.cache - Could not find template in cache, creating new one; id=[WEB-INF/freemarker/user/test.ftl[zh_CN,UTF-8,parsed] ] [color=red]2010-01-22 15:48:41,500 [http-8080-1] DEBUG org.springframework.web.servlet.view.freemarker.FreeMarkerView - No FreeMarker view found for URL: /WEB-INF/freemarker/user/test.ftl[/color] 2010-01-22 15:48:41,500 [http-8080-1] DEBUG org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver - Cached view [/user/test] 2010-01-22 15:48:41,500 [http-8080-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name '/user/test' 2010-01-22 15:48:41,500 [http-8080-1] DEBUG org.springframework.web.servlet.view.InternalResourceViewResolver - Cached view [/user/test] 非常郁闷啊,我在这个目录下确实存在模板文件啊,为什么它说不存在呢??有人知道为什么吗?

Springboot restful api 访问异常

服务器部署的一个springboot的服务,今天突然出现了一个问题,现象是: 1.当在服务器使用curl 来请求任意的一个接口,第一次请求时可以获得返回值。 2.再次curl任意的接口,服务端没有任何返回,一段时间之后报超时,也不打印任何日志。 3.取消之后再次curl任意接口,可以获得返回值。以此过程反复。 4.重启服务之后就不再出现这个问题。 想请问下这个问题考虑那些方向出了问题?

项目运行没有报错,但是提交表单后无法找到controller

![图片说明](https://img-ask.csdn.net/upload/201803/19/1521426498_402357.png) 一次完整请求的日志: ![图片说明](https://img-ask.csdn.net/upload/201803/19/1521426741_184369.png) 我的各种配置: spring-mvc.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" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <mvc:annotation-driven> <mvc:message-converters> <bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter"/> <bean class="org.springframework.http.converter.FormHttpMessageConverter"/> <bean class="org.springframework.http.converter.xml.SourceHttpMessageConverter"/> <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/> </mvc:message-converters> </mvc:annotation-driven> <!-- 使用annotation 自动注册bean,并保证@Required,@Autowired的属性被注入 --> <mvc:annotation-driven/> <context:component-scan base-package="com.commoninfo.user.controller"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan> <aop:aspectj-autoproxy proxy-target-class="true"> <aop:include name="controllerAspect"/> </aop:aspectj-autoproxy> <!-- 避免IE执行AJAX时,返回JSON出现下载文件 --> <!-- 支持JSON数据格式 --> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="messageConverters"> <list> <ref bean="mappingJacksonHttpMessageConverter"/> </list> </property> </bean> <bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> </bean> <!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 --> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/view/"/> <property name="suffix" value=".jsp"/> </bean> <!--处理静态资源--> <mvc:default-servlet-handler/> </beans> spring-mybatis.xml配置: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <!--引入属性文件--> <context:property-placeholder location="classpath:/jdbc.properties"/> <context:component-scan base-package="com.commoninfo.user.service"/> <!--配置数据源--> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="${database.driver}"/> <property name="jdbcUrl" value="${database.url}"/> <property name="user" value="${database.username}"/> <property name="password" value="${database.password}"/> <property name="minPoolSize" value="1"/> <property name="maxPoolSize" value="20"/> <property name="maxIdleTime" value="1800"/> <property name="acquireIncrement" value="2"/> <property name="maxStatements" value="0"/> <property name="initialPoolSize" value="2"/> <property name="idleConnectionTestPeriod" value="1800"/> <property name="acquireRetryAttempts" value="30"/> <property name="breakAfterAcquireFailure" value="true"/> <property name="testConnectionOnCheckout" value="false"/> </bean> <!--mybatis文件--> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <!--自动扫描entity目录--> <property name="configLocation" value="classpath:mybatis-config.xml"/> <property name="mapperLocations" value="classpath*:com/commoninfo/user/**/*.xml"/> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.commoninfo.user.dao"/> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> </bean> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"/> </bean> <!-- 配置事物的注解方式注入 --> <tx:annotation-driven transaction-manager="transactionManager"/> </beans> ``` web.xml的配置: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> <!-- Spring-mybatis的配置文件 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring-mybatis.xml</param-value> </context-param> <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:spring-mvc.xml</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>SpringMVC</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <!--字符过滤器--> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <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> <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> </listener> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!--404错误页--> <error-page> <error-code>404</error-code> <location>/WEB-INF/view/404.jsp</location> </error-page> </web-app> index.jsp的内容: <%-- Created by IntelliJ IDEA. User: zhulongkun Date: 2018/3/18 Time: 14:06 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %> <html> <head> <title>登录测试</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div align="center"> <form action="/test/dologin.do" method="post"> <table> <tr> <td><label>用户名</label></td> <td><label> <input type="text" name="username" style="width: 180px;"/> </label></td> </tr> <tr> <td><label>密&nbsp;码</label></td> <td><label> <input type="password" name="password" style="width: 180px;"/> </label></td> </tr> <tr> <td><input type="submit" name="login" value="登录"/></td> <td><input id="registerBtn" type="button" name="register" value="注册"/></td> </tr> </table> </form> </div> </body> </html> controller的内容: package com.commoninfo.user.controller; import com.commoninfo.user.entity.User; import com.commoninfo.user.service.UserService; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; /** * @author zhulongkun20@163.com * @date 2018/3/18 13:56 */ @Controller @RequestMapping("/test") public class LoginController { private static Logger logger = Logger.getLogger(LoginController.class); @Resource private UserService userService; @RequestMapping(value = "/dologin.do") public String doLogin(HttpServletRequest httpServletRequest, Model model) { User user = userService.getUsersByUsername( httpServletRequest.getParameter("username")).get(0); logger.info("User的信息为:" + user.toString()); if (userService.doUserLogin(user)) { model.addAttribute("successMsg", "登录成功!"); model.addAttribute("username", user.getUsername()); logger.info("successMsg:" + model.containsAttribute("successMsg")); logger.info("username:" + model.containsAttribute("username")); return "success"; } else { model.addAttribute("failedMsg", "用户名或密码错误!"); logger.info("failedMsg:" + model.containsAttribute("failedMsg")); return "failed"; } } } ``` ``` ``` ``` ``` ``` ``` ```

关于XXL-Job的问题,为啥没日志

初学者小白一枚,本地部署感觉没跑通,大神看看。。 1. 启动的任务,cron 0/1 * * * * ? 是每秒执行一次吧,为啥点进去日志没看到记录呢,日志都是手动执行的,没看到有自动触发的。。。 2. admin项目一直报错 com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction

2019 Python开发者日-培训

2019 Python开发者日-培训

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

设计模式(JAVA语言实现)--20种设计模式附带源码

设计模式(JAVA语言实现)--20种设计模式附带源码

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

java后台+微信小程序 实现完整的点餐系统

java后台+微信小程序 实现完整的点餐系统

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

2019 AI开发者大会

2019 AI开发者大会

玩转Linux:常用命令实例指南

玩转Linux:常用命令实例指南

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

4小时玩转微信小程序——基础入门与微信支付实战

4小时玩转微信小程序——基础入门与微信支付实战

Git 实用技巧

Git 实用技巧

Python数据清洗实战入门

Python数据清洗实战入门

使用TensorFlow+keras快速构建图像分类模型

使用TensorFlow+keras快速构建图像分类模型

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

程序员的算法通关课:知己知彼(第一季)

程序员的算法通关课:知己知彼(第一季)

MySQL数据库从入门到实战应用

MySQL数据库从入门到实战应用

机器学习初学者必会的案例精讲

机器学习初学者必会的案例精讲

手把手实现Java图书管理系统(附源码)

手把手实现Java图书管理系统(附源码)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

.net core快速开发框架

.net core快速开发框架

玩转Python-Python3基础入门

玩转Python-Python3基础入门

Python数据挖掘简易入门

Python数据挖掘简易入门

微信公众平台开发入门

微信公众平台开发入门

程序员的兼职技能课

程序员的兼职技能课

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

HoloLens2开发入门教程

HoloLens2开发入门教程

微信小程序开发实战

微信小程序开发实战

Java8零基础入门视频教程

Java8零基础入门视频教程

相关热词 c#树形选择 c#中类图的使用方法 c# 传参 调用exe c# 怎么定义方法 c# 修改本地时间 c#前台怎么读取资源文件 c# xml转list c#实现框选截图 m*m乘法表c# c# 乘法99表
立即提问