Spring 2.5 + Toplink essentials 2.0.1-09 + Derby 10.3.1.4 EmbeddedDriver 會丟出例外

使用這樣的組合時:

Spring 2.5 + Toplink essentials 2.0.1-09 + Derby 10.3.1.4 EmbeddedDriver

會丟出例外:

Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09a-fcs (11/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Cannot create an instance of generated class org.apache.derby.exe.ac888c4022x0116x6b3dx29dcx00000029b4b81.
Error Code: 20000
Call: SELECT SEQ_COUNT FROM SEQUENCE WHERE SEQ_NAME = ?
bind => [SEQ_GEN_TABLE]
Query: ValueReadQuery()
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
.
.
.
Caused by: java.sql.SQLException: Cannot create an instance of generated class org.apache.derby.exe.ac888c4022x0116x6b3dx29dcx00000029b4b81.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)


這個例外疑似是Derby或Spring Framework造成的,詢問Google大神後,找到以下討論:

Spring + TopLink + Embedded Derby

目前暫時改用Derby Network Server configuration開發,幸好在web環境下,Derby的Embedded configuration通常由application Server來啟動,較少由web application本身啟動,不過這畢竟是一個問題,會導致少了一種部署的方式,希望能獲得解決。

0 意見: