個人報錯是:html
java.sql.SQLSyntaxErrorException: Table 'gaei_ms.gaei_work_task' doesn't exist
2012-09-05 10:12:30,728 ERROR [btpool0-472 ] fisheye.app TotalityFilter-logExceptionDetails - Exception "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'fecru.AO_B434B9_WEB_HOOK' doesn't exist" (net.java.ao.sql.ActiveObjectSqlException) while processing "/plugins/servlet/webhooks/list" (Referer:"https://fisheye.bln.native-instruments.de/admin/viewServerSettings.do") net.java.ao.sql.ActiveObjectSqlException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'fecru.AO_B434B9_WEB_HOOK' doesn't exist at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:114) at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.find(DelegatingActiveObjects.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ... Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'fecru.AO_B434B9_WEB_HOOK' doesn't exist
MySQL對lower_case_table_names使用區分大小寫的表名比較設置 (可能值爲'0')。可是,FishEye在表名 FE-4276中不一致-數據庫表OPEN的大小寫不一致。您能夠使用如下查詢確認設置: java
show variables like 'lower_case_table_names';
show variables like 'lower_case_table_names';
個人改法是在配置文件中加上這一行:mysql
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table XXX doesn't exist
mysql裏實際表名都是大寫web
嘗試在entity上標記表名大寫,實際測試無效,仍然找不到表spring
@Entity
@Data
@Table(name = "T_BASE_ORDER_PRINT_CLIENT")
public class MerchantPrinter {
@Id
@Column(name = "print_client_id")
private String id;
@Column(name = "merchant_id")
private String merchantId;
private String imei;
}
在spring jpa配置中增長physical-strategy配置解決問題
spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://XXX:3306/dbname
username: root
password: *******
schema:
jpa:
hibernate:
ddl-auto: none
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
show-sql: true
physical naming strategy :used to convert a 「logical name」 (either implicit or explicit) name of a table or column into a physical name (e.g. following corporate naming guidelines)
physical naming strategy:物理命名策略,用於轉換「邏輯名稱」(隱式或顯式)的表或列成一個物理名稱sql