1. 程式人生 > >bug寶典JAVA篇 Authentication failed for token

bug寶典JAVA篇 Authentication failed for token

異常資訊:Authentication failed for token submission,詳細資訊如下所示。這個問題並沒有出現在我的eclipse環境,但是打成war放到tomcat下面卻出現了這樣的異常。
1
看來需要分析整個登入過程,我用的許可權框架是apache shiro,下面是登入的程式碼截圖,UsernamePasswordCaptchaToken是我封裝的待驗證碼的token,然後我希望登入這個token進行登入。
2
將異常輸出後,發現

Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com
.dzmsoft.ucs.base.dao.UcsUserMapper.selectByExample at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:223) at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48) at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod
(MapperProxy.java:59) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) at com.sun.proxy.$Proxy44.selectByExample(Unknown Source) at com.dzmsoft.ucs.base.service.impl.UcsUserServiceImpl.selectByExample(UcsUserServiceImpl.java:180) at com.dzmsoft.ucs.base
.service.impl.UcsUserServiceImpl.selectByUsername(UcsUserServiceImpl.java:132) at com.dzmsoft.ucs.base.service.impl.UcsUserServiceImpl$$FastClassBySpringCGLIB$$502ff820.invoke(<generated>)

問題已經很明顯了,執行maven命令並沒有mybatis的mapper.xml檔案打到jar裡面去。將引數化構建的jar下載下來一看,果然少了mapping檔案,
2
下面是工程目錄:
3
現在的問題變成了,mvn生成的jar為什麼會將xml給弄丟了。參考:mvn 打不進去xml檔案解決辦法