-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Hibernate Exception while fetching objects via Axis
PostPosted: Fri Oct 10, 2003 3:16 am 
Newbie

Joined: Thu Oct 09, 2003 11:32 am
Posts: 6
Hello,
While fetching records from a database
I get following exception. Can someone please let me know what is going on, the record seems to be being read successfully but after that this is the error. Class under consideration, SccChanges, has been generated by middlegen and then modified by Apache Axis (SOAP implementation) to adds its get methods for Serialize and Deserialize. Looks like Axis modifications are throwing hibernate reflection off:

2003-10-09 22:18:33,807 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: hibernate/HibernateFactory
2003-10-09 22:18:33,807 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=402881f1f8246e4d00f8246e523c0000
2003-10-09 22:18:33,908 DEBUG [net.sf.hibernate.impl.SessionImpl] opened session
2003-10-09 22:18:33,908 DEBUG [net.sf.hibernate.transaction.JTATransaction] Looking for UserTransaction under: UserTransaction
2003-10-09 22:18:33,918 DEBUG [net.sf.hibernate.transaction.JTATransaction] Obtained UserTransaction
2003-10-09 22:18:33,918 DEBUG [net.sf.hibernate.transaction.JTATransaction] beginning new transaction
2003-10-09 22:18:33,918 DEBUG [net.sf.hibernate.impl.SessionImpl] find: from SccChanges
2003-10-09 22:18:33,948 DEBUG [net.sf.hibernate.hql.QueryTranslator] compiling query
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.SessionImpl] flushing session
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushing entities and processing referenced collections
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.SessionImpl] Processing unreferenced collections
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.SessionImpl] Scheduling collection removes/(re)creates/updates
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.SessionImpl] Dont need to execute flush
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.hql.QueryTranslator] HQL: from com.viewent.objects.SccChanges
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.hql.QueryTranslator] SQL: select sccchang0_.CHANGE_ID as CHANGE_ID, sccchang0_.ORGANIZATION_ID as ORGANIZA2_, sccchang0_.LAST_UPDATE_DATE as LAST_UPD3_, sccchang0_.LAST_UPDATED_BY as LAST_UPD4_, sccchang0_.CREATED_BY as CREATED_BY, sccchang0_.CREATION_DATE as CREATION6_, sccchang0_.CHANGE_NAME as CHANGE_N7_, sccchang0_.CHANGE_NAMESPACE as CHANGE_N8_, sccchang0_.CHANGE_REVISION as CHANGE_R9_, sccchang0_.CHANGE_CREATION_DATE as CHANGE_10_, sccchang0_.CHANGE_DISTRIBUTION_DATE as CHANGE_11_, sccchang0_.SUMMARY as SUMMARY, sccchang0_.DESCRIPTION as DESCRIP13_, sccchang0_.SOURCE_ID as SOURCE_ID, sccchang0_.USER_ID as USER_ID, sccchang0_.REASON_CODE as REASON_16_, sccchang0_.PRIORITY_CODE as PRIORIT17_ from VIEWENT.SCC_CHANGES sccchang0_
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.SessionFactoryImpl] prepared statement get: select sccchang0_.CHANGE_ID as CHANGE_ID, sccchang0_.ORGANIZATION_ID as ORGANIZA2_, sccchang0_.LAST_UPDATE_DATE as LAST_UPD3_, sccchang0_.LAST_UPDATED_BY as LAST_UPD4_, sccchang0_.CREATED_BY as CREATED_BY, sccchang0_.CREATION_DATE as CREATION6_, sccchang0_.CHANGE_NAME as CHANGE_N7_, sccchang0_.CHANGE_NAMESPACE as CHANGE_N8_, sccchang0_.CHANGE_REVISION as CHANGE_R9_, sccchang0_.CHANGE_CREATION_DATE as CHANGE_10_, sccchang0_.CHANGE_DISTRIBUTION_DATE as CHANGE_11_, sccchang0_.SUMMARY as SUMMARY, sccchang0_.DESCRIPTION as DESCRIP13_, sccchang0_.SOURCE_ID as SOURCE_ID, sccchang0_.USER_ID as USER_ID, sccchang0_.REASON_CODE as REASON_16_, sccchang0_.PRIORITY_CODE as PRIORIT17_ from VIEWENT.SCC_CHANGES sccchang0_
2003-10-09 22:18:33,978 DEBUG [net.sf.hibernate.impl.SessionFactoryImpl] preparing statement
2003-10-09 22:18:34,058 DEBUG [net.sf.hibernate.loader.Loader] processing result set
2003-10-09 22:18:34,088 DEBUG [net.sf.hibernate.type.LongType] returning '1' as column: CHANGE_ID
2003-10-09 22:18:34,088 DEBUG [net.sf.hibernate.loader.Loader] result row: 1
2003-10-09 22:18:34,088 DEBUG [net.sf.hibernate.loader.Loader] Initializing object from ResultSet: 1
2003-10-09 22:18:34,088 DEBUG [net.sf.hibernate.loader.Loader] Hydrating entity: com.viewent.objects.SccChanges#1
2003-10-09 22:18:34,088 DEBUG [net.sf.hibernate.type.LongType] returning '1' as column: ORGANIZA2_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.TimestampType] returning '08 October 2003 12:00:00' as column: LAST_UPD3_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.LongType] returning '1' as column: LAST_UPD4_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.LongType] returning '1' as column: CREATED_BY
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.TimestampType] returning '08 October 2003 12:00:00' as column: CREATION6_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.StringType] returning 'Test' as column: CHANGE_N7_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.StringType] returning 'Test1' as column: CHANGE_N8_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.StringType] returning 'Rev1' as column: CHANGE_R9_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.TimestampType] returning null as column: CHANGE_10_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.TimestampType] returning '09 October 2003 07:09:20' as column: CHANGE_11_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.StringType] returning null as column: SUMMARY
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.SerializableType] returning null as column: DESCRIP13_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.LongType] returning '1' as column: SOURCE_ID
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.LongType] returning '1' as column: USER_ID
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.StringType] returning null as column: REASON_16_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.type.StringType] returning null as column: PRIORIT17_
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.loader.Loader] done processing result set (1 rows)
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.impl.BatcherImpl] done closing: 0 open PreparedStatements, 0 open ResultSets
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.impl.SessionFactoryImpl] closing statement
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.loader.Loader] total objects hydrated: 1
2003-10-09 22:18:34,098 DEBUG [net.sf.hibernate.impl.SessionImpl] resolving associations for [com.viewent.objects.SccChanges#1]
2003-10-09 22:18:34,138 ERROR [STDERR] java.lang.ClassCastException: java.sql.Timestamp
at com.viewent.objects.SccChangesMetaClass0.setPropertyValues(<generated>)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:162)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1961)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:196)
at net.sf.hibernate.loader.Loader.find(Loader.java:620)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:928)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1343)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76)
at com.viewent.services.VulnerabilityManagerSoapBindingImpl.getVulnerabilities(VulnerabilityManagerSoapBindingImpl.java:38)
at com.viewent.services.VulnerabilityManagerSoapBindingSkeleton.getVulnerabilities(VulnerabilityManagerSoapBindingSkeleton.java:55)
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:324)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:402)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:309)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:333)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:854)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
rethrown as net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info): java.sql.Timestamp setter of com.viewent.objects.SccChanges.?
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:167)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1961)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:196)
at net.sf.hibernate.loader.Loader.find(Loader.java:620)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:928)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1343)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76)
at com.viewent.services.VulnerabilityManagerSoapBindingImpl.getVulnerabilities(VulnerabilityManagerSoapBindingImpl.java:38)
at com.viewent.services.VulnerabilityManagerSoapBindingSkeleton.getVulnerabilities(VulnerabilityManagerSoapBindingSkeleton.java:55)
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:324)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:402)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:309)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:333)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:854)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPip
2003-10-09 22:18:34,138 ERROR [STDERR] eline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.ClassCastException: java.sql.Timestamp
at com.viewent.objects.SccChangesMetaClass0.setPropertyValues(<generated>)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:162)
... 57 more


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 10, 2003 3:46 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
In your stack trace there is the line :

exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info): java.sql.Timestamp setter of com.viewent.objects.SccChanges

So in your 'hibernate.properties' file you can uncomment the line 'hibernate.cglib.use_reflection_optimizer false' and then rerun your program. Then you'll see the attribute that throw the exception because of an incompatible type in respect to Timestamp

Seb


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 10, 2003 11:16 am 
Newbie

Joined: Thu Oct 09, 2003 11:32 am
Posts: 6
I could not find how to do that in JBoss JMX configuration servic efile (I am using JMX instead of hibernate.properties).

Thanks[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 10, 2003 11:23 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Never done that but maybe
Code:
<attribute name="CglibUseReflectionOptimizer">false</attribute>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 10, 2003 11:36 am 
Newbie

Joined: Thu Oct 09, 2003 11:32 am
Posts: 6
rg.jboss.deployment.DeploymentException: No Attribute found with name: CglibUseReflectionOptimizer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 3:36 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Ok, when reading the source code for the jmx package it seems that the use of this property in jmx is not implemented. So you have different choices,

- Modify the hibernate source code to add this property in jmx
- Try to look if there is a way in jmx to specify a generic property. In the hibernate jmx service there is a setProperty method. Maybe you can pass the hibernate property 'hibernate.cglib.use_reflection_optimizer' by this way
- and maybe the easyest way is to use a standard config file to launch a test outside of jboss and find your problem this way (the property hibernate.cglib.use_reflection_optimizer can be set to true either with the hibernate.properties or hibernate.cfg.xml file)

Seb


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 8:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This property must be specified in a hibernate.properties!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.