This content has been marked as final.
Show 5 replies
-
1. Re: Deploy with two beans have same names inside two package
waynebaylor Sep 10, 2007 9:27 AM (in response to changemylife)if they have different package names, then they are considered different classes.
-
2. Re: Deploy with two beans have same names inside two package
changemylife Sep 10, 2007 10:13 PM (in response to changemylife)Hi!
Assume that both of clients call lookup method:BeanA bean = (BeanA)context.lookup("BeanABean/remote"); bean.add(1,2);
The first of client is ok, but the second of client is fail and received some errors:
.Exception in thread "main" java.lang.ClassCastException: $Proxy0
at client.ClientTest1.main(Client2.java:18)
Error at line:BeanA bean = (BeanA)context.lookup("BeanABean/remote");
I think that I must config my JBoss Server but I don't know where I do this. -
3. Re: Deploy with two beans have same names inside two package
waynebaylor Sep 11, 2007 10:58 AM (in response to changemylife)what is the fully qualified class name of BeanA in both clients? i think the lookup is returning one version and you are casting it to the other version.
-
4. Re: Deploy with two beans have same names inside two package
changemylife Sep 11, 2007 9:37 PM (in response to changemylife)Hi !
The first client:my.com.BeanA
The second client:
john.com.BeanA
I were tried:
InitialContext ctx = new InitialContext(); my.com.BeanA bean = (my.com.BeanA)ctx.lookup("BeanABean/remote"); bean.hello();
---> Ok!
but:InitialContext ctx1 = new InitialContext(); john.com.BeanA bean = (john.com.BeanA)ctx1.lookup("BeanABean/remote"); bean.hello();
---> error! -
5. Re: Deploy with two beans have same names inside two package
waynebaylor Sep 13, 2007 9:59 AM (in response to changemylife)right, which is completely normal. you can't map a JNDI name to two classes.
since JBoss does not use the package name as part of the default JNDI name, you will need to override it so your two classes get different JNDI names.