1. 程式人生 > >Spring test TestController 一直不行,沒報任何錯誤

Spring test TestController 一直不行,沒報任何錯誤

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;

import com.lly.test.user.AbstractContextControllerTests;


@RunWith(SpringJUnit4ClassRunner.class)
public class UserControllerTest extends AbstractContextControllerTests {
	
	private static String URI = "/netloan/userManage/saveUserInfo";

	private MockMvc mockMvc;
	
	private String json ="{\"userName\":luhiahua,\"passWord\":1235,\"certCode\":\"320681198903167015\"}";
	

	@Before
	public void setup() {
		this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
	}

	@Test
	public void addUserInfo() throws Exception {
		String ret = this.mockMvc.perform(
				post(URI,"json")
					.characterEncoding("UTF-8")
					.contentType(MediaType.APPLICATION_JSON)
					.content(json.getBytes())).andReturn()  
	                .getResponse().getContentAsString()
				;
		System.out.println("===================:"+ret);
	}

}

以上是原始碼:

JunitTest 日誌:

2013-12-30 11:00:31,514 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [spring-dispather.xml]
2013-12-30 11:00:32,717 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [spring-base.xml]
2013-12-30 11:00:33,117 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [spring-dao.xml]
2013-12-30 11:00:33,273 INFO [org.springframework.web.context.support.GenericWebApplicationContext] - Refreshing org.s
[email protected]
b6e39f: startup date [Mon Dec 30 11:00:33 CST 2013]; root of context hierarchy 2013-12-30 11:00:33,727 INFO [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer] - Loading properties file from class path resource [jdbc.properties] 2013-12-30 11:00:33,728 INFO [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer] - Loading properties file from class path resource [hibernate.properties] 2013-12-30 11:00:34,222 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Pre-instantiating singletons in org.s
[email protected]
54083e1e: defining beans [mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,validator,conversion-service,springApplicationContextHolder,globalExceptionResolver,CommonHibernateDao,generalHibernateDao,genericHibernateDao,hibernateMatchRuleContext,dictController,dictInfoDaoImpl,fileUploadController,springController,targetController,targetUserRelaDaoImpl,userController,userDaoImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.handler.MappedInterceptor#1,org.springframework.web.servlet.handler.MappedInterceptor#2,org.springframework.web.servlet.config.viewControllerHandlerMapping,org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,handlerAdapter,org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0,multipartResolver,exceptionResolver,CommonService,dictServiceImpl,targetServiceImpl,userServiceImpl,propertyConfigurer,messageSource,dataSource,sessionFactory,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,txManager,txAdvice,txPointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy 2013-12-30 11:00:34,486 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Mapped "{[/netloan/dictManage/findByDictType/{dictType}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object com.lly.netloan.system.dict.controller.DictController.findByDictType(java.lang.String) throws java.lang.Exception 2013-12-30 11:00:34,488 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Mapped "{[/netloan/dictManage/findByParentDictId/{parentDictId}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object com.lly.netloan.system.dict.controller.DictController.findByParentDictId(java.lang.String) throws java.lang.Exception 2013-12-30 11:00:34,491 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Mapped "{[/netloan/fileUpload],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object com.lly.netloan.system.fileservice.controller.FileUploadController.file(com.lly.netloan.system.user.entity.User) throws java.lang.Exception 2013-12-30 11:00:34,494 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Mapped "{[/spring/url-mapping],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object com.lly.netloan.system.spring.controller.SpringController.getURLMapping() 2013-12-30 11:00:34,497 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Mapped "{[/netloan/targetManage],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object com.lly.netloan.system.target.controller.TargetController.saveTur(com.lly.netloan.system.target.entity.TargetUserRela) throws java.lang.Exception 2013-12-30 11:00:34,501 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Mapped "{[/netloan/userManage/saveUserInfo],methods=[POST],params=[],headers=[],consumes=[application/json],produces=[],custom=[]}" onto public java.lang.Object com.lly.netloan.system.user.controller.UserController.saveUserInfo(com.lly.netloan.system.user.entity.User) throws java.lang.Exception 2013-12-30 11:00:34,503 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Mapped "{[/netloan/userManage/url-mapping],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object com.lly.netloan.system.user.controller.UserController.getURLMapping() throws java.lang.Exception 2013-12-30 11:00:34,918 INFO [org.hibernate.validator.util.Version] - Hibernate Validator 4.2.0.Final 2013-12-30 11:00:35,622 INFO [org.hibernate.annotations.common.Version] - HCANN000001: Hibernate Commons Annotations {4.0.1.Final} 2013-12-30 11:00:35,633 INFO [org.hibernate.Version] - HHH000412: Hibernate Core {4.1.0.Final} 2013-12-30 11:00:35,637 INFO [org.hibernate.cfg.Environment] - HHH000205: Loaded properties from resource hibernate.properties: {hibernate.default_batch_fetch_size=16, net.sf.ehcache.configurationResourceName=ehcache.xml, hibernate.cache.use_query_cache=true, hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.max_fetch_depth=2, hibernate.cache.use_second_level_cache=true, hibernate.format_sql=true, hibernate.cache.use_structured_entries=true, hibernate.cache.region.factory_class=org.hibernate.cache.EhCacheRegionFactory, hibernate.query.substitutions=true 1, false 0, hibernate.generate_statistics=true, hibernate.hbm2ddl.auto=none, hibernate.bytecode.use_reflection_optimizer=true, hibernate.show_sql=true} 2013-12-30 11:00:35,639 INFO [org.hibernate.cfg.Environment] - HHH000406: Using bytecode reflection optimizer 2013-12-30 11:00:35,639 INFO [org.hibernate.cfg.Environment] - HHH000021: Bytecode provider name : javassist 2013-12-30 11:00:37,684 INFO [org.hibernate.dialect.Dialect] - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect 2013-12-30 11:00:37,704 INFO [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] - HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4 2013-12-30 11:00:37,722 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] - HHH000399: Using default transaction strategy (direct JDBC transactions) 2013-12-30 11:00:37,733 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] - HHH000397: Using ASTQueryTranslatorFactory 2013-12-30 11:00:38,986 INFO [org.hibernate.cache.spi.UpdateTimestampsCache] - HHH000250: Starting update timestamps cache at region: org.hibernate.cache.spi.UpdateTimestampsCache 2013-12-30 11:00:38,993 WARN [org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory] - HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.spi.UpdateTimestampsCache]; using defaults. 2013-12-30 11:00:39,049 INFO [org.hibernate.cache.internal.StandardQueryCache] - HHH000248: Starting query cache at region: org.hibernate.cache.internal.StandardQueryCache 2013-12-30 11:00:39,051 WARN [org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory] - HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.internal.StandardQueryCache]; using defaults. 2013-12-30 11:00:39,271 INFO [org.springframework.orm.hibernate4.HibernateTransactionManager] - Using DataSource [[email protected]] of Hibernate SessionFactory for HibernateTransactionManager 2013-12-30 11:00:39,496 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0' 2013-12-30 11:00:39,527 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Root mapping to handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController] 2013-12-30 11:00:39,556 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/dictManage/findByDictType/{dictType}] onto handler 'dictController' 2013-12-30 11:00:39,556 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/dictManage/findByDictType/{dictType}.*] onto handler 'dictController' 2013-12-30 11:00:39,556 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/dictManage/findByDictType/{dictType}/] onto handler 'dictController' 2013-12-30 11:00:39,556 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/dictManage/findByParentDictId/{parentDictId}] onto handler 'dictController' 2013-12-30 11:00:39,556 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/dictManage/findByParentDictId/{parentDictId}.*] onto handler 'dictController' 2013-12-30 11:00:39,556 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/dictManage/findByParentDictId/{parentDictId}/] onto handler 'dictController' 2013-12-30 11:00:39,557 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/fileUpload] onto handler 'fileUploadController' 2013-12-30 11:00:39,557 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/fileUpload.*] onto handler 'fileUploadController' 2013-12-30 11:00:39,557 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/fileUpload/] onto handler 'fileUploadController' 2013-12-30 11:00:39,558 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/spring/url-mapping] onto handler 'springController' 2013-12-30 11:00:39,558 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/spring/url-mapping.*] onto handler 'springController' 2013-12-30 11:00:39,558 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/spring/url-mapping/] onto handler 'springController' 2013-12-30 11:00:39,559 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/targetManage] onto handler 'targetController' 2013-12-30 11:00:39,559 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/targetManage.*] onto handler 'targetController' 2013-12-30 11:00:39,559 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/targetManage/] onto handler 'targetController' 2013-12-30 11:00:39,560 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/userManage/saveUserInfo] onto handler 'userController' 2013-12-30 11:00:39,560 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/userManage/saveUserInfo.*] onto handler 'userController' 2013-12-30 11:00:39,560 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/userManage/saveUserInfo/] onto handler 'userController' 2013-12-30 11:00:39,560 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/userManage/url-mapping] onto handler 'userController' 2013-12-30 11:00:39,560 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/userManage/url-mapping.*] onto handler 'userController' 2013-12-30 11:00:39,560 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] - Mapped URL path [/netloan/userManage/url-mapping/] onto handler 'userController' 2013-12-30 11:00:39,899 INFO [org.springframework.mock.web.MockServletContext] - Initializing Spring FrameworkServlet '' 2013-12-30 11:00:39,899 INFO [org.springframework.test.web.servlet.TestDispatcherServlet] - FrameworkServlet '': initialization started 2013-12-30 11:00:39,937 INFO [org.springframework.test.web.servlet.TestDispatcherServlet] - FrameworkServlet '': initialization completed in 38 ms ===================: 2013-12-30 11:00:40,069 INFO [org.logicalcobwebs.proxool.proxoolDataSource] - Shutting down 'proxoolDataSource' pool immediately [Shutdown Hook] 2013-12-30 11:00:40,071 INFO [org.springframework.web.context.support.GenericWebApplicationContext] - Closing org.s[email protected]b6e39f: startup date [Mon Dec 30 11:00:33 CST 2013]; root of context hierarchy 2013-12-30 11:00:40,073 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Destroying singletons in org.s[email protected]54083e1e: defining beans [mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,validator,conversion-service,springApplicationContextHolder,globalExceptionResolver,CommonHibernateDao,generalHibernateDao,genericHibernateDao,hibernateMatchRuleContext,dictController,dictInfoDaoImpl,fileUploadController,springController,targetController,targetUserRelaDaoImpl,userController,userDaoImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.handler.MappedInterceptor#1,org.springframework.web.servlet.handler.MappedInterceptor#2,org.springframework.web.servlet.config.viewControllerHandlerMapping,org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,handlerAdapter,org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0,multipartResolver,exceptionResolver,CommonService,dictServiceImpl,targetServiceImpl,userServiceImpl,propertyConfigurer,messageSource,dataSource,sessionFactory,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,txManager,txAdvice,txPointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy 2013-12-30 11:00:40,081 INFO [org.logicalcobwebs.proxool.PrototyperController] - Stopping Prototyper thread 2013-12-30 11:00:40,081 INFO [org.logicalcobwebs.proxool.HouseKeeperController] - Stopping HouseKeeper thread

可以看到,打印出來的資料請求返回的JSON是空的,加斷點發現沒呼叫到後臺的controller層東西,剛開始一直以為自己寫的

RESTful標籤寫得有問題,導致引數一直注入不了,後來查了Spring 官方文件,沒發現問題 http://projects.spring.io/spring-framework/

後來無意之中發現自己請求的資料 JSON格式有問題,錯誤就在“

private String json ="{\"userName\":luhiahua,\"passWord\":1235,\"certCode\":\"320681198903167015\"}";

的 String 串沒加引號,

哎一失足成千古恨,查了兩天終於解決了,把以上日誌貼上來,希望碼農們不要犯我的低階錯誤

private String json ="{\"userName\":\"luhiahua\",\"passWord\":1235,\"certCode\":\"320681198903167015\"}";


相關推薦

Spring test TestController 一直不行任何錯誤

import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.http.MediaType; import org.sp

mysql安裝錯系統發生錯誤 2;MySQL服務無法啟動 服務任何錯誤(已解決)

在Windows下安裝mysql,遇到一些問題,分享一下解決方法 問題1:安裝後用net mysql start啟動,提示:系統發生錯誤 2。系統找不到指定的檔案。 原因:你服務的路徑和安裝的路徑不一致造成的。之前安裝過mysql後解除安裝的機器容易出現這樣的問題 解決方

Maven專案中引入spring-test單元測試 @RunWith與@ContextConfigration

場景 在SSM專案整合時引入spring-test單元測試時, @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath:applicationContext.xml"}) 報錯

微信小程式:wx.downloadFile 不成功錯 downloadFile:fail Error: socket hang up 錯誤

  小程式剛出來,因為預研需要,很不幸的做了一回小白鼠,於是掉進了神坑。 下載檔案,首先是沒報錯了,然後不成功,這個時候,請把 fail開啟,把fail的報錯資訊輸出來     wx.downloadFile({       url: 'https://xxxx.xxx.

之前設定橫向一直不行看了這個覺得可以

初學HTML,遇到一個題需要將幾張圖放在一個邊框裡,並且需要橫向拖動        想著很簡單,直接在div中設定width、height。並新增屬性“overflow:auto;”。但實際執行是發現圖片始終會換行,視窗只能上下滾動        後來找到問題的原因,是因為由

spring boot 匯出jar 包執行錯無法載入 orcl驅動的問題。

原因是因為orcl資料庫是收費的,所以在pom檔案中無法匯入所以需要手動新增jar包,但是打包的時候無法將手動的jar包打包,只打包maven中的jar。 解決的辦法: 需要自己本地建立一個maven本地倉庫,然後需要配置環境 。 將執行 mvn

測試springmvc表單提交新增資料伺服器400錯誤-----HTTP Status 400

用postman測試一個新增資料的控制器方法時,報了400錯誤 經查,是請求無效的意思 一般可能出現在有Date格式的資料表中 我的模型類有個Date型別的資料,如果要正常傳入,可以新增以下程式碼在Date格式資料上方,如圖所示 @DateTimeFormat(patter

複製Java Web專案Tomcan上下文錯誤

複製一個Java Web專案,在貼上的時候改一下專案名字。這樣執行是不行的。Tomcat啟動不起來,會報“無法為tomcat釋出伺服器配置 多個上下文有路徑”這個錯誤。原因是複製的專案雖然專案名改了,

為什麼我的AJAX請求處理成功了404錯誤

今天遇到了一個很離奇的場景,使用ajax請求後臺結果 後臺處理成功了頁面還報了404錯誤。 程式設計師不說話,默默上程式碼: JS: var save = function(){ $.ajax({ url: urlMap.saveO

https post請求Nginx405錯誤

        最近在做微信開發,公司打算對產品增加微信支付功能,但是微信支付費率較高,於是與某微信支付的第三方合作,利用他們的平臺,完成微信支付。經過測試,基本確定使用公眾號支付方式。但在聯調時,遇到一個非常坑的問題。一開始掉進去了,和同事掙扎了一天,最終發現只是個很簡

springmvc始終跳轉至首頁404錯誤

本篇部落格特別補充:2017-3-4 9:42,經過分析和測試,本篇部落格的解決方案只是碰巧,暫時的解決了問題。在後續的執行中,又出現了同樣的毛病。經過日誌跟蹤,發現了端倪,下篇部落格深入的剖析!本篇

nginx配置檔案裡user只能是root否則403錯誤

yum 一個全新的nginx,版本是1.12.2的 直接啟動,瀏覽器輸入localhost訪問的nginx頁面 1、當我將nginx.conf配置檔案裡root 路徑改成/root/html/index.html #mkdir /root/html #echo hel

不論任何錯誤 都是網絡源有問題安裝spacemacs錯的解決方式

報錯 des spa -a -i mir ati pac var 不論報任何錯誤 都是網絡源有問題打開.spacemacs### 這是原頭部(defun dotspacemacs/layers () "Configuration Layers declaration.Yo

mysql5.7版本之後安裝成功後服務無法啟動沒有報告任何錯誤的解決辦法。

原因多出在手動建立data目錄。 5.7版本及以前可以通過新建一個my.ini檔案,然後輸入一下程式碼即可按步驟成功啟動: [client] port=3306 default-character-set=utf8 [mysqld]  # 設定為自己MYSQL的安裝目錄&n

MySQL“服務無法啟動 服務報告任何錯誤

1. 拒絕訪問 右擊命令提示符[cmd],以管理員身份執行 2. 服務名無效 ↓↓↓ 選擇系統環境Path配置,配置 “..\MySQL\MySQL Server XX/bin” ↓↓↓ ‘管理員身份’重啟命令提示符[cmd],安裝M

解決nginx服務下 thinkphp只能訪問首頁不任何錯誤的問題

    一、問題所在         首先遇到這個問題很奇怪我也糾結了好幾個小時,後來查資料各種百度終於找到問題的所在 pathinfo 它是php的功能,php有兩個pathinfo,一個是環境變數$_SERVER['PATH_INFO'] ,另一個是函式path_in

菜鳥調錯(四)——Spring與DWR集成配置文件

microsoft his www data editors bing ces myeclipse java 背景簡單介紹:該項目是市信用辦的一個系統,之前好像是一個石家莊的公司負責的。我屬於是半路接手。拿到源代碼後。依據他們給的簡(shao)單(de)明(ke)了(l

Spring Test DbunitH2數據庫

float spring 之前 listener hidden ces seo 直接 auto 概述 Dbunit是一個基於JUnit的數據庫集成測試框架。DBUnit 的設計理念就是在測試之前,給對象數據庫植入我們需要的準備數據,最後,在測試完畢後,回溯到測

【Kotlin】spring boot項目中在Idea下啟動錯@Configuration class 'BugsnagClient' may not be final.

post open conf png spa temp 技術 dea and 報錯如下: Exception encountered during context initialization - cancelling refresh attempt: org.spr

maven spring 引用spring-test.jar

test run ring maven 一個 spring pri img 工程 原因: 因為我想在項目中編寫test方法,來進行接口測試是否正確,當我執行Tomcat7::run 時,報了這個錯誤,讓我十分納悶 我百度了一下,都是說在pom文件中加一個配置(具體自