Advertisement
Guest User

Untitled

a guest
Nov 19th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.66 KB | None | 0 0
  1. Exception in thread "main" javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
  2. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.employee' doesn't exist
  3. Error Code: 1146
  4. Call: INSERT INTO employee (FIRST_NAME, LAST_NAME) VALUES (?, ?)
  5. bind => [abc,def]
  6. Query: InsertObjectQuery(com.example.entities.Employee@ee1ede)
  7. at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:157)
  8. at com.example.dao.BaseDao.commitAndClose(BaseDao.java:41)
  9. at com.example..dao.BaseDao.persist(BaseDao.java:29)
  10. at com.example..dao.EmployeeDao.createEmployee(EmployeeDao.java:29)
  11. at com.example.Main.main(KITMain.java:27)
  12. Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
  13. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.employee' doesn't exist
  14. Error Code: 1146
  15. Call: INSERT INTO employee (FIRST_NAME, LAST_NAME) VALUES (?, ?)
  16. bind => [ram, mohan]
  17. Query: InsertObjectQuerycom.example.entities.Employee@ee1ede)
  18. at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331)
  19. at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:900)
  20. at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:962)
  21. at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:631)
  22. at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:558)
  23. at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1991)
  24. at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:298)
  25. at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242)
  26. at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
  27. at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:377)
  28. at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:165)
  29. at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:180)
  30. at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:489)
  31. at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80)
  32. at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90)
  33. at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:301)
  34. at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
  35. at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899)
  36. at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:798)
  37. at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108)
  38. at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)
  39. at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
  40. at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1793)
  41. at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1775)
  42. at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1726)
  43. at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:226)
  44. at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:125)
  45. at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:4196)
  46. at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1441)
  47. at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1531)
  48. at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:277)
  49. at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1169)
  50. at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:132)
  51. ... 4 more
  52. Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.employee' doesn't exist
  53. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  54. at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  55. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  56. at java.lang.reflect.Constructor.newInstance(Unknown Source)
  57. at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
  58. at com.mysql.jdbc.Util.getInstance(Util.java:384)
  59. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
  60. at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4232)
  61. at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4164)
  62. at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
  63. at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
  64. at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2838)
  65. at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082)
  66. at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2334)
  67. at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2262)
  68. at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2246)
  69. at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:890)
  70.  
  71. <class>com.example.entities.Employee</class>
  72. <properties>
  73.  
  74. <!-- derby -->
  75.  
  76. <!-- <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"
  77. /> <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"
  78. /> <property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/test"
  79. /> <property name="javax.persistence.jdbc.user" value="app" /> <property
  80. name="javax.persistence.jdbc.password" value="admin" /> -->
  81.  
  82.  
  83. <!-- mysql -->
  84.  
  85. <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
  86. <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/test" />
  87. <property name="javax.persistence.jdbc.user" value="root" />
  88. <property name="javax.persistence.jdbc.password" value="" />
  89.  
  90. <!-- EclipseLink should create the database schema automatically -->
  91. <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
  92. <property name="eclipselink.ddl-generation.output-mode"
  93. value="database" />
  94.  
  95. <!-- Configure simple SQL logging for demonstration. -->
  96. <property name="eclipselink.logging.level" value="FINE" />
  97. <property name="eclipselink.logging.thread" value="false" />
  98. <property name="eclipselink.logging.session" value="false" />
  99. <property name="eclipselink.logging.exceptions" value="false" />
  100. <property name="eclipselink.logging.timestamp" value="false" />
  101.  
  102.  
  103. </properties>
  104. </persistence-unit>
  105.  
  106. package com.example.entities;
  107.  
  108. import java.io.Serializable;
  109.  
  110. import javax.persistence.Column;
  111. import javax.persistence.Entity;
  112. import javax.persistence.GeneratedValue;
  113. import javax.persistence.GenerationType;
  114. import javax.persistence.Id;
  115. import javax.persistence.Table;
  116.  
  117. /**
  118. *
  119. * @author ddd
  120. */
  121. @Entity
  122. @Table(name = "employee")
  123. public class Employee implements Serializable {
  124.  
  125.  
  126.  
  127. @Id
  128. @GeneratedValue(strategy = GenerationType.IDENTITY)
  129. @Column(name = "EMP_ID")
  130. private String employeeId;
  131.  
  132. @Column(name = "FIRST_NAME")
  133. private String firstName;
  134.  
  135. @Column(name = "LAST_NAME")
  136. private String lastName ;
  137.  
  138. public String getEmployeeId() {
  139. return employeeId;
  140. }
  141.  
  142. public void setEmployeeId(String employeeId) {
  143. this.employeeId = employeeId;
  144. }
  145.  
  146. public String getFirstName() {
  147. return firstName;
  148. }
  149. public String getLastName() {
  150. return lastName;
  151. }
  152. public void setFirstName(String firstName) {
  153. this.firstName = firstName;
  154. }
  155. public void setLastName(String lastName) {
  156. this.lastName = lastName;
  157. }
  158.  
  159. }
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167. [EL Config]: metadata: The access type for the persistent class [class de.allianz.kit.server.persistence.entities.Employee] is set to [FIELD].
  168. [EL Config]: metadata: The alias name for the entity class [class de.allianz.kit.server.persistence.entities.Employee] is being defaulted to: Employee.
  169. [EL Info]: EclipseLink, version: Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5
  170. [EL Fine]: connection: Detected database platform: org.eclipse.persistence.platform.database.MySQLPlatform
  171. [EL Config]: connection: Connection(3278348)--connecting(DatabaseLogin(
  172. platform=>MySQLPlatform
  173. user name=> "root"
  174. datasource URL=> "jdbc:mysql://localhost:3306/test"
  175. ))
  176. [EL Config]: connection: Connection(5863106)--Connected: jdbc:mysql://localhost:3306/test
  177. User: root@localhost
  178. Database: MySQL Version: 5.6.17
  179. Driver: MySQL Connector Java Version: mysql-connector-java-5.1.30 ( Revision: alexander.soklakov@oracle.com-20140310090514-8xt1yoht5ksg2e7c )
  180. [EL Info]: connection: file:/C:/myworkspace/kit_ws/com.example.server.persistence/classes/_kit login successful
  181. [EL Fine]: sql: Connection(5863106)--DROP TABLE employee
  182. [EL Fine]: sql: SELECT 1
  183. [EL Warning]: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
  184. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'test.employee'
  185. Error Code: 1051
  186. Call: DROP TABLE employee
  187. Query: DataModifyQuery(sql="DROP TABLE employee")
  188. [EL Fine]: sql: Connection(5863106)--DROP TABLE employee
  189. [EL Fine]: sql: SELECT 1
  190. [EL Warning]: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
  191. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'test.employee'
  192. Error Code: 1051
  193. Call: DROP TABLE employee
  194. Query: DataModifyQuery(sql="DROP TABLE employee")
  195. [EL Fine]: sql: Connection(5863106)--DROP TABLE employee
  196. [EL Fine]: sql: SELECT 1
  197. [EL Warning]: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
  198. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'test.employee'
  199. Error Code: 1051
  200. Call: DROP TABLE employee
  201. Query: DataModifyQuery(sql="DROP TABLE employee")
  202. [EL Fine]: sql: Connection(5863106)--DROP TABLE employee
  203. [EL Fine]: sql: SELECT 1
  204. [EL Warning]: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
  205. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'test.employee'
  206. Error Code: 1051
  207. Call: DROP TABLE employee
  208. Query: DataModifyQuery(sql="DROP TABLE employee")
  209. [EL Fine]: sql: Connection(5863106)--DROP TABLE employee
  210. [EL Fine]: sql: SELECT 1
  211. [EL Warning]: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
  212. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'test.employee'
  213. Error Code: 1051
  214. Call: DROP TABLE employee
  215. Query: DataModifyQuery(sql="DROP TABLE employee")
  216. [EL Fine]: sql: Connection(5863106)--CREATE TABLE employee (EMP_ID VARCHAR(255) AUTO_INCREMENT NOT NULL, FIRST_NAME VARCHAR(255), LAST_NAME VARCHAR(255), PRIMARY KEY (EMP_ID))
  217. [EL Fine]: sql: SELECT 1
  218. [EL Warning]: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
  219. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Incorrect column specifier for column 'EMP_ID'
  220. Error Code: 1063
  221. Call: CREATE TABLE employee (EMP_ID VARCHAR(255) AUTO_INCREMENT NOT NULL, FIRST_NAME VARCHAR(255), LAST_NAME VARCHAR(255), PRIMARY KEY (EMP_ID))
  222. Query: DataModifyQuery(sql="CREATE TABLE employee (EMP_ID VARCHAR(255) AUTO_INCREMENT NOT NULL, FIRST_NAME VARCHAR(255), LAST_NAME VARCHAR(255), PRIMARY KEY (EMP_ID))")
  223. [EL Fine]: sql: Connection(5863106)--INSERT INTO employee (FIRST_NAME, LAST_NAME) VALUES (?, ?)
  224. bind => [ram, mohan]
  225. [EL Fine]: sql: SELECT 1
  226. [EL Warning]: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
  227. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.employee' doesn't exist
  228. Error Code: 1146
  229.  
  230. CREATE TABLE employee (EMP_ID VARCHAR(255) AUTO_INCREMENT NOT NULL, FIRST_NAME VARCHAR(255), LAST_NAME VARCHAR(255), PRIMARY KEY (EMP_ID))
  231.  
  232. Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Incorrect column specifier for column 'EMP_ID'
  233. Error Code: 1063
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement