Anyone have any idea what is happening here?? I have some entity beans that have local and remote interfaces, they are referenced by a session bean and I have placed the local refs in the deployment desciptor like so;
<ejb-local-ref> <ejb-ref-name>ejb/FacultyLocalEJB</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <local-home>com.uni.faculty.FacultyHomeLocal</local-home> com.uni.faculty.FacultyLocal <ejb-link>FacultyEJB</ejb-link> </ejb-local-ref> <ejb-local-ref> <ejb-ref-name>ejb/StudentLocalEJB</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <local-home>com.uni.student.StudentHomeLocal</local-home> com.uni.student.StudentLocal <ejb-link>StudentEJB</ejb-link> </ejb-local-ref> <ejb-local-ref> <ejb-ref-name>ejb/SchoolLocalEJB</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <local-home>com.uni.school.SchoolHomeLocal</local-home> com.uni.school.SchoolLocal <ejb-link>SchoolEJB</ejb-link> </ejb-local-ref> <ejb-local-ref> <ejb-ref-name>ejb/AddressLocalEJB</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <local-home>com.uni.address.AddressHomeLocal</local-home> com.uni.address.AddressLocal <ejb-link>AddressEJB</ejb-link> </ejb-local-ref> But when I try to use them like; InitialContext jndiContext = new InitialContext(); Object obj = jndiContext.lookup("java:comp/env/ejb/FacultyLocalEJB"); FacultyHomeLocal facultyHome = (FacultyHomeLocal)obj; obj = jndiContext.lookup("java:comp/env/ejb/StudentLocalEJB"); StudentHomeLocal studentHome = (StudentHomeLocal)obj; obj = jndiContext.lookup("java:comp/env/ejb/SchoolLocalEJB"); SchoolHomeLocal schoolHome = (SchoolHomeLocal)obj; obj = jndiContext.lookup("java:comp/env/ejb/AddressLocalEJB"); AddressHomeLocal addressHome = (AddressHomeLocal)obj; I recieve the following exception; java.lang.ClassCastException: $Proxy364 at com.uni.dataFiller.DataFillerBean.initialize(DataFillerBean.java:36) This is because remote interfaces are being returned when Local one should be instead. To make things more irritating I only get the exception with some of the beans that have remote and Local interfaces and not with others and all works fine if I remove the remote interfaces to my entity beans. Cheers in advance View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3882494#3882494 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3882494 ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user