1 Reply Latest reply on Jan 17, 2007 10:48 AM by Peter Johnson

    Class cast exception

    martin schouwenburg Newbie

      Just started with Ejb3 and created a a web-app that uses a ejb3 bean to do some validation on data. Its all local and running on the same server. I encounter a problem with the simpel lookup of the bean, instead of returning a reference to a object of the class it returns a proxy class (which contains seemingly correct info about the class i realy want).

      String name = OutlierBean.class.getSimpleName() + "/local";
      obj = context.lookup(name);
      OutlierBean bean = (OutlierBean)obj;

      Of course the cast gives an exception. I am wondering what I do wrong. Looked at tutorials etc. but the code I use seems ok. The bean seems to be deployed ( the jmx-console tells me at least).