-
1. Re: Hierarchical Remote Interface
aloubyansky Apr 29, 2004 1:49 AM (in response to ramiahbala)Could you please post the stacktrace and JBoss version?
-
2. Re: Hierarchical Remote Interface
ramiahbala Apr 29, 2004 5:01 AM (in response to ramiahbala)JBOSS Version: 3.2.0
Stack Trace:
java.lang.ClassCastException
$proxy0.findByPrimaryKey()
Please note, when the call is made from a remote client, there is no error / exception in the server. The exception occurs in the client.
When the call is made locally within the server, the same exception occurs within the server. The stack trace looks the same. -
3. Re: Hierarchical Remote Interface
aloubyansky Apr 30, 2004 1:54 AM (in response to ramiahbala)So is it thrown from the proxy class? Could you please post the whole stack?
-
4. Re: Hierarchical Remote Interface
ramiahbala Apr 30, 2004 5:03 AM (in response to ramiahbala)Yes, indeed. I can see only one of the below 2 reasons.
i) The proxy interface returned to the client implemented the return type of the findByPrimaryKey() method (Super interface)rather than the remote interface (Sub interface)configured in the deployment for the bean. This would result in the home proxy impl. trying to cast the remote proxy to the remote interface type which being a sub type, can cause ClassCastException to be thrown. But One would not expect an APP server to do it this way.
2) As we know, findBy() methods can return the remote interface type or a Collection of them. If there is a bug in the CMP findBy() implementation code, it might check whether the return type is Remote Interface, if not return a Collection.
Both of the above reasons may be absolutely my assumptions and not right. I am confident that it is to do with the findBy() implementation because create() works very well. -
5. Re: Hierarchical Remote Interface
darranl Apr 30, 2004 5:48 AM (in response to ramiahbala)ramiahbala,
Looks like you have missed the point of the previous post, loubyansky is asking for the full stack trace - the stack trace you have provided is useless. -
6. Re: Hierarchical Remote Interface
aloubyansky May 1, 2004 3:48 AM (in response to ramiahbala)"ramiahbala" wrote:
2) As we know, findBy() methods can return the remote interface type or a Collection of them. If there is a bug in the CMP findBy() implementation code, it might check whether the return type is Remote Interface, if not return a Collection.
This is the exact reason. It is fixed in JBoss3.2.4RC2. You can patch your JBoss version in org.jboss.ejb.EntityContainer in the server module.
Thanks. -
7. Re: Hierarchical Remote Interface
ramiahbala May 4, 2004 5:47 AM (in response to ramiahbala)Loubyansky, Thanks mate. Looks like i got to do the patch.
Could you let me know how patches are to be done with JBOSS 3.2.0?
I have done it with 2.4.1 before by placing the patch jars in /patch directory in jboss installation directory.
How different it is in JBOSS 3.2.0?
Darranl, i did not post the full stack trace because it was pretty much useless. The remote call results in only one line of stack trace $proxy0.findByPrimaryKey(). Thanks. -
8. Re: Hierarchical Remote Interface
aloubyansky May 5, 2004 4:09 AM (in response to ramiahbala)There is no patch directory now.
- fix the source code
- recompile the server module (you will find build.xml, .sh, .bat in the module directory)
- copy output/lib/jboss.jar to, e.g., server/default/lib overriding the old one.