在使用Jboss開發spring項目時,在啟動是出現警告資訊:
11:19:23,280 WARN [org.jboss.as.ee] (MSC service thread 1-5) JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: 無法找到 class org.springframework.web.context.request.async.StandardServletAsyncWebRequest 的預設構造器
網上搜尋了解決方案是去除debug資訊,但是這樣不是根本解決辦法,我們根據錯誤資訊,來修改。
下面的解決辦法是修改源碼,添加預設構造器
根據錯誤資訊,找到spring-web 下面的StandardServletAsyncWebRequest類,當然是.java 檔案
修改後,會自動生成.class檔案,這樣用壓縮軟體打開jar包,把這個class檔案拷貝過去。再重新
啟動就不會報 WARN
/**
* 新增的預設構造器
*/
public StandardServletAsyncWebRequest() {}
public StandardServletAsyncWebRequest(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse) {}