I have used the SortedSet instead of List and the OneToMany relation works when 
I write or update but when I retrieve my composite object it gives a 
ClassCastException on the TreeSet Compare. I do not know why as I have my 
object as a comparator and it implements a compare method??

        public boolean equals(Object obj )
  |     {
  |             boolean ret = false;
  |             if( obj == null ) return false;
  |             if( obj instanceof Counts )
  |             {       
  |                     Counts other = (Counts)obj;
  |                     if( this.id == other.id && 
  |                             this.wellNumber == other.wellNumber &&
  |                             this.cnts == other.cnts &&
  |                             this.milliSeconds == other.milliSeconds &&
  |                             this.timestamp.equals(other.timestamp))
  |                     {
  |                             ret = true;
  |                     }
  |             }
  | 
  |             return ret;
  |     }
  |     
  |     public int compare( Object arg0, Object arg1 )
  |     {
  |             int ret = -1;
  |             if( arg0 == null || arg1 == null ) return -1;
  |             
  |                     if( arg0 instanceof Counts && arg1 instanceof Counts )
  |                     {
  |                             Counts c1 = ( Counts ) arg0;
  |                             Counts c2 = ( Counts ) arg1;
  |                     
  |                             if( c1.cnts > c2.cnts ) ret = 1;
  |                             if( c1.cnts < c2.cnts ) ret = -1;
  |                             if( c1.equals(c2) ) ret = 0;
  |                     }
  |             
  |             return ret;
  |     }

14:07:00,176 ERROR [STDERR] javax.ejb.EJBException: 
java.lang.ClassCastException: com.theranos.abcs.reader.dmo.Counts
14:07:00,176 ERROR [STDERR]     at 
org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:199)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
14:07:00,176 ERROR [STDERR]     at $Proxy80.getAll(Unknown Source)
14:07:00,176 ERROR [STDERR]     at 
com.theranos.abcs.utils.LogParser.parse(LogParser.java:254)
14:07:00,176 ERROR [STDERR]     at 
com.theranos.abcs.reader.web.servlet.ReaderServer.parseLogs(ReaderServer.java:247)
14:07:00,176 ERROR [STDERR]     at 
com.theranos.abcs.reader.web.servlet.ReaderServer.doPost(ReaderServer.java:147)
14:07:00,176 ERROR [STDERR]     at 
com.theranos.abcs.reader.web.servlet.ReaderServer.doGet(ReaderServer.java:105)
14:07:00,176 ERROR [STDERR]     at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
14:07:00,176 ERROR [STDERR]     at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
14:07:00,176 ERROR [STDERR]     at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
14:07:00,176 ERROR [STDERR]     at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
14:07:00,176 ERROR [STDERR]     at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
14:07:00,176 ERROR [STDERR]     at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
14:07:00,176 ERROR [STDERR]     at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
14:07:00,176 ERROR [STDERR]     at 
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
14:07:00,176 ERROR [STDERR]     at java.lang.Thread.run(Unknown Source)
14:07:00,176 ERROR [STDERR] Caused by: java.lang.ClassCastException: 
com.theranos.abcs.reader.dmo.Counts
14:07:00,176 ERROR [STDERR]     at java.util.TreeMap.compare(Unknown Source)
14:07:00,176 ERROR [STDERR]     at java.util.TreeMap.put(Unknown Source)
14:07:00,176 ERROR [STDERR]     at java.util.TreeSet.add(Unknown Source)
14:07:00,176 ERROR [STDERR]     at java.util.AbstractCollection.addAll(Unknown 
Source)
14:07:00,176 ERROR [STDERR]     at java.util.TreeSet.addAll(Unknown Source)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.collection.PersistentSet.endRead(PersistentSet.java:273)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.engine.CollectionLoadContext.endLoadingCollection(CollectionLoadContext.java:183)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.engine.CollectionLoadContext.endLoadingCollections(CollectionLoadContext.java:268)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.engine.CollectionLoadContext.endLoadingCollections(CollectionLoadContext.java:249)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.Loader.endCollectionLoad(Loader.java:866)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:853)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.Loader.doQuery(Loader.java:717)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.Loader.loadCollection(Loader.java:1919)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:541)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1705)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:755)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:229)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.Loader.doList(Loader.java:2145)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.Loader.list(Loader.java:2024)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
14:07:00,192 ERROR [STDERR]     at 
org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:53)
14:07:00,192 ERROR [STDERR]     at 
com.theranos.abcs.reader.dao.MeasurementDaoImpl.getAll(MeasurementDaoImpl.java:86)
14:07:00,192 ERROR [STDERR]     at 
com.theranos.abcs.reader.ejb.MeasurementAccessorBean.getAll(MeasurementAccessorBean.java:113)
14:07:00,192 ERROR [STDERR]     at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:07:00,192 ERROR [STDERR]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
14:07:00,192 ERROR [STDERR]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
14:07:00,192 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Unknown 
Source)
14:07:00,192 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
14:07:00,192 ERROR [STDERR]     at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
14:07:00,192 ERROR [STDERR]     at 
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
14:07:00,192 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,208 ERROR [STDERR]     at 
org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
14:07:00,208 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,208 ERROR [STDERR]     at 
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
14:07:00,208 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,208 ERROR [STDERR]     at 
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
14:07:00,208 ERROR [STDERR]     at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
14:07:00,208 ERROR [STDERR]     at 
org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
14:07:00,208 ERROR [STDERR]     ... 39 more

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3953124#3953124

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3953124

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to