aspose file tools*
The moose likes Object Relational Mapping and the fly likes Cannot save Dates in Toplink Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Cannot save Dates in Toplink" Watch "Cannot save Dates in Toplink" New topic
Author

Cannot save Dates in Toplink

Kosala Almeda
Greenhorn

Joined: Dec 06, 2008
Posts: 3
Entity Class


In above entiyy class I have over 20 fields all of them can be saved to database but not Dates
Either their type is java.sql.Date or java.util.Date.
Also works fine for null values (In DB its a nullable column)

I have written following code fragment in my Bean method.
It gets a PolicyDetail Object and Updates it back with same InceptionDate using a update query.


Bean



But it also gives an error.
GlassFish server log is




client acquired
TX binding to tx mgr, status=STATUS_ACTIVE
InceptionDate Mon Nov 09 00:00:00 IST 2009
UPDATE POLICY_DETAIL SET INCEPTIONDATE = ? WHERE ((TRANSACTIONID = ?) AND (POLICYID = ?))
bind => [2009-11-09, 123, 1]
LDR5207: EJBClassLoader EJBClassLoader :
doneCalled = true
doneSnapshot = EJBClassLoader.done() called ON EJBClassLoader :
urlSet = [URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/cayenne-1.2RC2.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/commons-beanutils-20030211.134440.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/commons-digester-2.0-javadoc.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/commons-digester-2.0-sources.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/commons-digester-2.0.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/commons-logging-1.0.4.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/freemarker-2.3.8.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/gwt-dev.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/gwt-math-2.1.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/gwt-math-server-2.1.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/gwt-servlet.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/gwt-user.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/jasperreports-3.6.0.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/jpa-annotations-source.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/log4j-1.2.15.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/ognl-2.6.11.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/ojdbc14.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/smartgwt-skins.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/smartgwt.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/toplink-essentials-agent.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/toplink-essentials.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/lib/xwork-2.0.4.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/UnderwriterEnterpriseApp-war_war/WEB-INF/classes/, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/UnderwriterEnterpriseApp-war_war/WEB-INF/lib/struts2-core-2.0.11.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/UnderwriterEnterpriseAppGWT_war/WEB-INF/classes/, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/UnderwriterEnterpriseApp-ejb_jar/, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/UnderwriterEnterpriseApp-ejb_jar/log4j-1.2.15.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/UnderwriterEnterpriseApp-ejb_jar/ojdbc14.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/UnderwriterEnterpriseApp-ejb_jar/toplink-essentials-agent.jar, URLEntry : file:/D:/Projects/UnderwriterEnterpriseApp/dist/gfdeploy/UnderwriterEnterpriseApp-ejb_jar/toplink-essentials.jar, URLEntry : file:/C:/Sun/AppServer/domains/domain1/generated/ejb/j2ee-apps/UnderwriterEnterpriseApp/]
doneCalled = false
Parent -> EJBClassLoader :
urlSet = []
doneCalled = false
Parent -> java.net.URLClassLoader@103de90
AT Fri Jan 22 20:59:29 IST 2010
BY :com.sun.enterprise.loader.EJBClassLoader.printStackTraceToString(EJBClassLoader.java:813)
com.sun.enterprise.loader.EJBClassLoader.done(EJBClassLoader.java:173)
com.sun.enterprise.server.AbstractLoader.done(AbstractLoader.java:353)
com.sun.enterprise.server.ApplicationLoader.unload(ApplicationLoader.java:268)
com.sun.enterprise.server.TomcatApplicationLoader.unload(TomcatApplicationLoader.java:213)
com.sun.enterprise.server.ExtendedApplicationLoader.unload(ExtendedApplicationLoader.java:262)
com.sun.enterprise.server.ApplicationManager.applicationUndeployed(ApplicationManager.java:525)
com.sun.enterprise.server.ApplicationManager.applicationUndeployed(ApplicationManager.java:703)
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:961)
com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:943)
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:467)
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:182)
com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:231)
com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStopEvent(ServerDeploymentTarget.java:332)
com.sun.enterprise.deployment.phasing.ApplicationStopPhase.runPhase(ApplicationStopPhase.java:136)
com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
com.sun.enterprise.deployment.phasing.PEDeploymentService.stop(PEDeploymentService.java:670)
com.sun.enterprise.deployment.phasing.PEDeploymentService.stop(PEDeploymentService.java:717)
com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.stop(ApplicationsConfigMBean.java:796)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:381)
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:364)
com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:477)
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
$Proxy1.invoke(Unknown Source)
com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
Parent -> EJBClassLoader :
urlSet = []
doneCalled = false
Parent -> java.net.URLClassLoader@103de90
was requested to find class oracle.sql.LdxLib after done was invoked from the following stack trace
java.lang.Throwable
at com.sun.enterprise.loader.EJBClassLoader.findClassData(EJBClassLoader.java:708)
at com.sun.enterprise.loader.EJBClassLoader.findClass(EJBClassLoader.java:628)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at oracle.jdbc.driver.OraclePreparedStatement.setDate(OraclePreparedStatement.java:10258)
at oracle.toplink.essentials.platform.database.oracle.OraclePlatform.setPrimitiveParameterValue(OraclePlatform.java:606)
at oracle.toplink.essentials.internal.databaseaccess.DatabasePlatform.setParameterValueInDatabaseCall(DatabasePlatform.java:1413)
at oracle.toplink.essentials.internal.databaseaccess.DatabasePlatform.setParameterValueInDatabaseCall(DatabasePlatform.java:1474)
at oracle.toplink.essentials.internal.databaseaccess.DatabasePlatform.setParameterValueInDatabaseCall(DatabasePlatform.java:1462)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:623)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:485)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:452)
at oracle.toplink.essentials.internal.sessions.AbstractSession.executeCall(AbstractSession.java:690)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:214)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:257)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.updateAll(DatasourceCallQueryMechanism.java:728)
at oracle.toplink.essentials.queryframework.UpdateAllQuery.executeDatabaseQuery(UpdateAllQuery.java:180)
at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:628)
at oracle.toplink.essentials.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:555)
at oracle.toplink.essentials.queryframework.ModifyAllQuery.executeInUnitOfWork(ModifyAllQuery.java:168)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2248)
at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:924)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.executeUpdate(EJBQueryImpl.java:397)
at net.ewisl.server.ejbs.PolicyIssuingServiceSessionBean.editPolicyDetails(PolicyIssuingServiceSessionBean.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2920)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4011)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:203)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:117)
at $Proxy677.editPolicyDetails(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:233)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
at net.ewisl.server.ejbs.__PolicyIssuingServiceSessionRemote_Remote_DynamicStub.editPolicyDetails(net/ewisl/server/ejbs/__PolicyIssuingServiceSessionRemote_Remote_DynamicStub.java)
at net.ewisl.server.ejbs._PolicyIssuingServiceSessionRemote_Wrapper.editPolicyDetails(net/ewisl/server/ejbs/_PolicyIssuingServiceSessionRemote_Wrapper.java)
at net.ewisl.server.GWTPolicyServiceImpl.editPolicyDetails(GWTPolicyServiceImpl.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:188)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
TX afterCompletion callback, status=ROLLEDBACK
release unit of work
initialize identitymaps
client released

Application Server 2.1

James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
The error seems to indicate that your JDBC driver is not configured correctly.

Parent -> EJBClassLoader :
urlSet = []
doneCalled = false
Parent -> java.net.URLClassLoader@103de90
was requested to find class oracle.sql.LdxLib after done was invoked from the following stack trace
java.lang.Throwable

Seems the oracle.sql.LdxLib class is somehow missing.


TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Cannot save Dates in Toplink