Hi Dain / Bill, Yeah, you are right. It should have been hashCode() ;
I made this silly mistake and was unnecessarily troubling you guys. Thanks for the help. Saroj Message: 7 From: "Bill Burke" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: RE: [JBoss-user] Error using Custom Primary Key class in JBOSS 3, cmp 2 + Hypersonic Date: Wed, 10 Jul 2002 18:47:00 -0400 Reply-To: [EMAIL PROTECTED] Good catch Dain! Didn't see that at first and was shitting in my pants. That's probably the problem Kumar. Let us know!!! Bill > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Dain > Sundstrom > Sent: Wednesday, July 10, 2002 2:27 PM > To: [EMAIL PROTECTED] > Subject: Re: [JBoss-user] Error using Custom Primary Key class in JBOSS > 3, cmp 2 + Hypersonic > > > Everything looks good except you spelled hashCode incorrectly. You have: > > public int HashCode() > { > return customerId.hashCode(); > } > > You should have: > > public int hashCode() > { > return customerId.hashCode(); > } > > -dain > > Saroj Kumar wrote: > > Hi All, > > > > > > When I am using Custom Primary key with JBOSS 3 , CMP2 with HYPERSONIC > > then this error I am getting : > > > > This is the full stack trace ... > > > > [java] java.rmi.ServerException: RemoteException occurred in server > > thread; nested exception is: > > [java] Caught an unexpected exception while making contract! > > [java] java.rmi.ServerException: removing bean lock and it has tx > > set!; nested exception is: > > [java] java.lang.IllegalStateException: removing bean lock and it > > has tx set! > > [java] at > > sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292) > > [java] at sun.rmi.transport.Transport$1.run(Transport.java:148) > > [java] at java.security.AccessController.doPrivileged(Native > > Method) > > [java] at > > sun.rmi.transport.Transport.serviceCall(Transport.java:144) > > [java] at > > sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) > > [java] at > > sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.ja > > va:701) > > [java] at java.lang.Thread.run(Thread.java:536) > > [java] at > > sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRem > > oteCall.java:247) > > [java] at > > sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223 > > ) > > [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133) > > [java] at > > org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) > > [java] at > > org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvoker > > Proxy.java:128) > > [java] at > > org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:1 > > 08) > > [java] at > > org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.jav > > a:73) > > [java] at > > org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76) > > [java] at > > org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:116) > > [java] at > > org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76) > > [java] at $Proxy1.getCustomerId(Unknown Source) > > [java] at test_ejbs.make_Customer(test_ejbs.java:84) > > [java] at test_ejbs.<init>(test_ejbs.java:43) > > [java] at test_ejbs.main(test_ejbs.java:101) > > [java] Caused by: java.rmi.ServerException: removing bean lock and it > > has tx set!; nested exception is: > > [java] java.lang.IllegalStateException: removing bean lock and it > > has tx set! > > [java] at > > org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterce > > ptor.java:119) > > [java] at > > org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptor > > CMT.java:167) > > [java] at > > org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61) > > [java] at > > org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.jav > > a:129) > > [java] at > > org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166) > > [java] at > > org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) > > [java] at org.jboss.ejb.Container.invoke(Container.java:705) > > [java] at > > org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055) > > [java] at > > org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491) > > [java] at > > org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362 > > ) > > [java] at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown > > Source) > > [java] at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor > > Impl.java:25) > > [java] at java.lang.reflect.Method.invoke(Method.java:324) > > [java] at > > sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) > > [java] at sun.rmi.transport.Transport$1.run(Transport.java:148) > > [java] at java.security.AccessController.doPrivileged(Native > > Method) > > [java] at > > sun.rmi.transport.Transport.serviceCall(Transport.java:144) > > [java] at > > sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) > > [java] at > > sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.ja > > va:701) > > [java] at java.lang.Thread.run(Thread.java:536) > > [java] Caused by: java.lang.IllegalStateException: removing bean lock > > and it has tx set! > > [java] at > > org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedPess > > imisticEJBLock.java:469) > > [java] at > > org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:78) > > [java] at > > org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor > > .java:124) > > [java] at > > org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInt > > erceptor.java:69) > > [java] at > > org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterce > > ptor.java:96) > > [java] ... 19 more > > > > **************************** > > ** CustomPK *** > > **************************** > > > > I am using CustomPK like this: > > import java.io.*; > > > > public class CustomerPK implements Serializable > > { > > public String customerId ; > > > > public CustomerPK() > > { > > > > } > > > > public CustomerPK(String customerId) > > { > > this.customerId = customerId; > > } > > > > public String toString() > > { > > return customerId.toString(); > > } > > > > public int HashCode() > > { > > return customerId.hashCode(); > > } > > > > public boolean equals(Object obj) > > { > > if (obj instanceof CustomerPK) > > { > > CustomerPK c = (CustomerPK)obj; > > > > if (c.customerId == null) > > { > > return customerId == null; > > } > > > > return c.customerId.equals(customerId); > > } > > > > return false; > > } > > > > } > > > > > > TIA, > > Saroj > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Two, two, TWO treats in one. > > http://thinkgeek.com/sf > > _______________________________________________ > > JBoss-user mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Two, two, TWO treats in one. > http://thinkgeek.com/sf > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user --__--__-- Message: 8 Date: Wed, 10 Jul 2002 17:55:04 -0500 From: Dain Sundstrom <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Error using Custom Primary Key class in JBOSS 3, cmp 2 + Hypersonic Reply-To: [EMAIL PROTECTED] Bill this is always a problem with a custom primary key. Maybe you should add a hint to the exception message. This is definitely a faq question. -dain Bill Burke wrote: > Good catch Dain! Didn't see that at first and was shitting in my pants. > That's probably the problem Kumar. Let us know!!! > > Bill > > >>-----Original Message----- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED]]On Behalf Of Dain >>Sundstrom >>Sent: Wednesday, July 10, 2002 2:27 PM >>To: [EMAIL PROTECTED] >>Subject: Re: [JBoss-user] Error using Custom Primary Key class in JBOSS >>3, cmp 2 + Hypersonic >> >> >>Everything looks good except you spelled hashCode incorrectly. You have: >> >>public int HashCode() >>{ >> return customerId.hashCode(); >>} >> >>You should have: >> >>public int hashCode() >>{ >> return customerId.hashCode(); >>} >> >>-dain >> >>Saroj Kumar wrote: >> >>>Hi All, >>> >>> >>>When I am using Custom Primary key with JBOSS 3 , CMP2 with HYPERSONIC >>>then this error I am getting : >>> >>>This is the full stack trace ... >>> >>> [java] java.rmi.ServerException: RemoteException occurred in server >>>thread; nested exception is: >>> [java] Caught an unexpected exception while making contract! >>> [java] java.rmi.ServerException: removing bean lock and it has tx >>>set!; nested exception is: >>> [java] java.lang.IllegalStateException: removing bean lock and it >>>has tx set! >>> [java] at >>>sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292) >>> [java] at sun.rmi.transport.Transport$1.run(Transport.java:148) >>> [java] at java.security.AccessController.doPrivileged(Native >>>Method) >>> [java] at >>>sun.rmi.transport.Transport.serviceCall(Transport.java:144) >>> [java] at >>>sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4 60) >>> [java] at >>>sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport .ja >>>va:701) >>> [java] at java.lang.Thread.run(Thread.java:536) >>> [java] at >>>sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream Rem >>>oteCall.java:247) >>> [java] at >>>sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java: 223 >>>) >>> [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133) >>> [java] at >>>org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) >>> [java] at >>>org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvo ker >>>Proxy.java:128) >>> [java] at >>>org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav a:1 >>>08) >>> [java] at >>>org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor. jav >>>a:73) >>> [java] at >>>org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:7 6) >>> [java] at >>>org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:1 16) >>> [java] at >>>org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76) >>> [java] at $Proxy1.getCustomerId(Unknown Source) >>> [java] at test_ejbs.make_Customer(test_ejbs.java:84) >>> [java] at test_ejbs.<init>(test_ejbs.java:43) >>> [java] at test_ejbs.main(test_ejbs.java:101) >>> [java] Caused by: java.rmi.ServerException: removing bean lock and it >>>has tx set!; nested exception is: >>> [java] java.lang.IllegalStateException: removing bean lock and it >>>has tx set! >>> [java] at >>>org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte rce >>>ptor.java:119) >>> [java] at >>>org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep tor >>>CMT.java:167) >>> [java] at >>>org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6 1) >>> [java] at >>>org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor. jav >>>a:129) >>> [java] at >>>org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166) >>> [java] at >>>org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) >>> [java] at org.jboss.ejb.Container.invoke(Container.java:705) >>> [java] at >>>org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055) >>> [java] at >>>org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491) >>> [java] at >>>org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java: 362 >>>) >>> [java] at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown >>>Source) >>> [java] at >>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sor >>>Impl.java:25) >>> [java] at java.lang.reflect.Method.invoke(Method.java:324) >>> [java] at >>>sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) >>> [java] at sun.rmi.transport.Transport$1.run(Transport.java:148) >>> [java] at java.security.AccessController.doPrivileged(Native >>>Method) >>> [java] at >>>sun.rmi.transport.Transport.serviceCall(Transport.java:144) >>> [java] at >>>sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4 60) >>> [java] at >>>sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport .ja >>>va:701) >>> [java] at java.lang.Thread.run(Thread.java:536) >>> [java] Caused by: java.lang.IllegalStateException: removing bean lock >>>and it has tx set! >>> [java] at >>>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedP ess >>>imisticEJBLock.java:469) >>> [java] at >>>org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:78) >>> [java] at >>>org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep tor >>>.java:124) >>> [java] at >>>org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreation Int >>>erceptor.java:69) >>> [java] at >>>org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte rce >>>ptor.java:96) >>> [java] ... 19 more >>> >>>**************************** >>>** CustomPK *** >>>**************************** >>> >>>I am using CustomPK like this: >>>import java.io.*; >>> >>>public class CustomerPK implements Serializable >>>{ >>> public String customerId ; >>> >>> public CustomerPK() >>> { >>> >>> } >>> >>> public CustomerPK(String customerId) >>> { >>> this.customerId = customerId; >>> } >>> >>> public String toString() >>> { >>> return customerId.toString(); >>> } >>> >>> public int HashCode() >>> { >>> return customerId.hashCode(); >>> } >>> >>> public boolean equals(Object obj) >>> { >>> if (obj instanceof CustomerPK) >>> { >>> CustomerPK c = (CustomerPK)obj; >>> >>> if (c.customerId == null) >>> { >>> return customerId == null; >>> } >>> >>> return c.customerId.equals(customerId); >>> } >>> >>> return false; >>> } >>> >>>} >>> >>> >>>TIA, >>>Saroj >>> >>> >>> >>> >>>------------------------------------------------------- >>>This sf.net email is sponsored by:ThinkGeek >>>Two, two, TWO treats in one. >>>http://thinkgeek.com/sf >>>_______________________________________________ >>>JBoss-user mailing list >>>[EMAIL PROTECTED] >>>https://lists.sourceforge.net/lists/listinfo/jboss-user >> >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Two, two, TWO treats in one. >>http://thinkgeek.com/sf >>_______________________________________________ >>JBoss-user mailing list >>[EMAIL PROTECTED] >>https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Two, two, TWO treats in one. > http://thinkgeek.com/sf > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user -- xxxxxxxxxxxxxxxxxxxxxxxx Dain Sundstrom Chief Architect JBossCMP JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx --__--__-- _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user End of JBoss-user Digest ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek PC Mods, Computing goodies, cases & more http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user