2 Replies Latest reply on Nov 17, 2011 12:43 PM by Javier Fradiletti

    JBoss AS 7 ClassCastException when lookup from war oustide EAR

    Javier Fradiletti Newbie

      Hi!

      I have deployed an EAR with, among other components, some EJB statefull session beans.

      Then, from a WAR deployed as a sibling to the previous EAR, i perform a lookup to any of those beans and i get the following exception:

       

      Caused by: java.lang.ClassCastException: com.events.serviciosUI.autenticacion.ServicesAutenticacionRemote$$$view5 cannot be cast to com.events.serviciosUI.autenticacion.ServicesAutenticacionRemote

       

      The same lookup works fine if the WAR is deployed within the EAR.

       

      The error tells me that I am being served with a wrapper or view of the clas that does not implements ServicesAutentiaccionRemote. Why is that?

       

      I am using the GLOBAL JNDI name for JBoss AS 7 as described in manuals:

      "java:global/eventEAR/ServiciosUI/ServicesAutenticacion!com.events.serviciosUI.autenticacion.ServicesAutenticacionRemote"

       

      * Deployment that works:

      standalone

           |

           +- EAR.ear

                |

                +- ejb.jar

                |

                +- webapp1.war(doing lookup to a parent EAR.ear)

       

      * Deployment that does NOT works:

      standalone

           |

           +- EAR.ear

                |

                +- ejb.jar

           |

           +- webapp1.war (doing lookup to a sibling EAR.ear)

       

      Hope anyone can help.

       

      thanks,

       

      javier