Hi,
I started using Hibernate few days back and am facing few issues while using the caveatemptor sample application. Following are some steps I have performed so far, can someone provide advice on how to proceed?
(a) I used "ant exportddl" to generate the appl ddl statements
(b) Executed the ddl statements in DB2
(c) Created a J2EE project in WSAD (Websphere Application Developer) and imported appl source code
(d) Configuration the WSAD Test Server's Data Source
(e) Configured Hibernate to use the Data Source
(f) Developed sample servlet containing the code from "TestCaseWithData.initData()" method
(g) On running the servlet, I get the following exception:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
[10/15/04 11:17:38:338 IST] 51f5b586 SystemOut O 11:17:38,338 DEBUG [DbTest] Persisting cars
Hibernate: insert into CATEGORY (VERSION, NAME, CREATED, PARENT_CATEGORY_ID, CATEGORY_ID) values (?, ?, ?, ?, default)
[10/15/04 11:17:38:338 IST] 51f5b586 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -407, SQLState: 23502
[10/15/04 11:17:38:369 IST] 51f5b586 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [IBM][CLI Driver][DB2/NT] SQL0407N Assignment of a NULL value to a NOT NULL column "TBSPACEID=2, TABLEID=7, COLNO=4" is not allowed. SQLSTATE=23502
[10/15/04 11:17:38:384 IST] 51f5b586 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -407, SQLState: 23502
[10/15/04 11:17:38:384 IST] 51f5b586 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [IBM][CLI Driver][DB2/NT] SQL0407N Assignment of a NULL value to a NOT NULL column "TBSPACEID=2, TABLEID=7, COLNO=4" is not allowed. SQLSTATE=23502
[10/15/04 11:17:38:353 IST] 5e06b586 WebGroup E SRVE0026E: [Servlet Error]-[Unresolved compilation problems:
The constructor RuntimeException(String, Throwable) is undefined
The constructor RuntimeException(Throwable) is undefined
]: java.lang.Error: Unresolved compilation problems:
The constructor RuntimeException(String, Throwable) is undefined
The constructor RuntimeException(Throwable) is undefined
at org.hibernate.auction.exceptions.InfrastructureException.<init>(InfrastructureException.java:19)
at org.hibernate.auction.dao.CategoryDAO.makePersistent(CategoryDAO.java:89)
at DbTest.hiaChap3(DbTest.java:353)
at DbTest.doPost(DbTest.java:110)
at DbTest.doGet(DbTest.java:45)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
Category class exposes methods only for setting Name, ParentCategory, ChildCategory and CategoriedItem attributes. How will the "Created" and "Version" fields get updated?
Regards,
Dayanand
|