框架報錯
這些錯誤很多時候都不細心引起的,如果大家也有出現些問題,希望能給大家一下提示,同時也提醒自己不要再犯相同的錯誤了.
使用eclipse編譯專案的時候一直在報這個錯誤,但是專案都是可以通過編譯的,到網上找的,說jdk換成1.8的,我換了這後還是沒有用
com/mysql/jdbc/JDBC42ResultSet : Unsupported major.minor version 52.0
—-最後解決——- 我的tomcat裡面有一個jdbc的驅動,比我自己專案下的jar包版本要高.把tomcat那個驅動刪除即可.
下面是部分ssm框架的錯誤
Caught exception while allowing TestExecutionListener
[org.springframewor
to prepare test instance [[email protected]]
java.lang.IllegalStateException: Failed to load ApplicationContext
原因是
其中user寫成username
Bean property ‘checkoutTimeOut’ is not writable or has an invalid setter method. Did you mean ‘checkoutTimeout’?
name寫錯了checkoutTimeOut …. nested exception is
java.io.FileNotFoundException: class path resource
[classPath:mybatis-config.xml] cannot be opened because it does not
exist
classPath 改成小寫就可以了
[email protected]bc –
Acquisition Attempt Failed!!! Clearing pending acquires. While trying
to acquire a needed new resource, we failed to succeed more than the
maximum number of allowed acquisition attempts (2). Last acquisition
attempt exception:
資料庫,表名不對
runtime name=”com.genuitec.runtime.generic.jee60
別人專案,開啟報錯,刪除setting檔案中runtime即可
org.mybatis.spring.MyBatisSystemException: nested exception is
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not
get JDBC Connection; nested exception is java.sql.SQLException: An
attempt by a client to checkout a Connection has timed out.
jdbc.properties 跟.xml文連線賬號沒對上
org.apache.ibatis.binding.BindingException: Invalid bound statement
(not found): org.seckill.dao.SeckillDao.queryAll
程式包org.junit.runner不存在
junit 換為4.x版本即可
maven專案執行注意 http://www.tuicool.com/articles/fm6nay
Servlet.init() for servlet seckill-dispacherServlet threw exception
Allocate exception for servlet seckill-dispacherServlet
以上兩個報錯都是,一個web.xml配置不對,一個因為springmvc.xml的轉發路徑不對
org.apache.ibatis.binding.BindingException: Invalid bound statement
(not found): select id 方法不對,ALl All 由於字型原因一直沒看出來
元素型別 "set" 必須後跟屬性規範 ">" 或 "/>"。 Nested exception: 元素型別 "set" 必須後跟屬性規範 ">" 或 "/>"。 配置檔案set位置沒有加空格
A different object with the same identifier value was already associated with the session : [cn.entity.Employee#1] 主鍵重複
org.mybatis.spring.MyBatisSystemException: nested exception is
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.UnsupportedOperationException
### The error may exist in file [C:\Users\Administrator.USER-20160618MA\seckill\target\classes\mapper\SeckillDao.xml]
### The error may involve org.seckill.dao.SeckillDao.queryAll
### The error occurred while handling results
### SQL: select seckill_id,name,number,start_time,end_time,create_time from seckill
order by create_time desc limit ?,?; dao的對映mapping.xml中
resultType型別的問題:dao接口裡寫的方法返回是一個List集合,
這個resultType型別是直接表示返回型別的(對應著我們的model物件中的實體)
不能引入js檔案,先命名resources這個資料夾一定要有,名字不對的話
就算配置檔案都對了,頁面也是顯示引入資源404