Hi there,
I am quiet frustrated with having a strange behavior I do not understand.

I have an EAR Application containing an EJB and a WAR.
In the EJB I have a small HelloWorld Class being remote and local.

I Call this class from the Servlet in the War. Which works perfectly fine.

Now when I change the Code in the HelloWorld Class (simply changing the 
returned text) and redeploy this EAR, I get a ClassCastException when calling 
this Object. 

When I hav the WAR deployed itself in a different ctxPath, that servlet keeps 
working fine.

My Bean:

  | @Stateless
  | @Local(MyDAO.class)
  | @LocalBinding(jndiBinding="EpgData/LocalDao")
  | @Remote(MyDAO.class)
  | @RemoteBinding(jndiBinding="EpgData/RemoteDao")
  | public class MyDAOImpl implements MyDAO {
  | 
  |     public String getObject() {
  |             // TODO Auto-generated method stub
  |             return "Hi There?! Someone";
  |     }
  | 
  | }
  | 

my servlet:

  |     public void doGet(HttpServletRequest arg0, HttpServletResponse arg1) 
throws ServletException, IOException {
  |             arg1.setContentType("text/html");
  |             PrintWriter out = arg1.getWriter();
  |             Context ctx;
  |             try {
  |                     ctx = new InitialContext();
  |                     
out.println("2----------------------------------------------------------------<br>");
  |                     Object o;
  |                     try {
  |                             o = ctx.lookup("EpgData/LocalDao");
  |                             MyDAO hello = (MyDAO)o;
  |                             out.println(hello.getObject());
  |                     } catch (NamingException e) {
  |                             // TODO Auto-generated catch block
  |                             out.println("Second: "+e);
  |                     }catch (ClassCastException e){
  |                             e.printStackTrace(out);
  |                             out.println(reflect(ctx.lookup("LOVE")));
  |                     }
  |                     
  |             } catch (NamingException e) {
  |                     // TODO Auto-generated catch block
  |                     out.println("Outer: "+e);
  |             }
  |     }
  | 
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977537#3977537

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977537
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to