1. 程式人生 > >SpringBoot專案引用jar包報錯

SpringBoot專案引用jar包報錯

我的專案是maven專案因為要引用本地的程式碼,所以將本地的程式碼打包成jar包引用到maven專案中去,引用方法已經說明了。

打包我是使用直接export匯出的jar包,專案啟動沒有問題,然而當引用到呼叫的jar內部的dao層時就會報錯

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 
        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.$Proxy156.selectByPrimaryKey(Unknown Source)
造成這個問題是因為我的專案不是使用的maven方式打包,只需要去引用專案的pom檔案裡面改一下打包的方式
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-jar-plugin</artifactId>
</plugin>
然後run as  - maven build  的方式打包。將打包替換掉原來export的jar,update一下 問題完滿解決