:( I must be doing something wrong.

I even made very base interface (Calculator.java) like in the example but I am 
always getting the same error. Class Cast Exception.


please give me a hint what I am doing wrong. below all important code. (I had 
rather included it.)

thanks in advance

//baseBean.java
package beans;

public interface baseBean {
    public String hello();
}

//baseRemote.java
package beans;

import javax.ejb.Remote;
@Remote
public interface baseRemote extends baseBean{
    //public String hello();
}

//testBean
package beans;
import javax.ejb.Stateless;
@Stateless(name = "testBean")
public class testBean implements baseRemote {
    public testBean() {
    }

    public String hello() {
        return "Hello from bean";
    }
}

//index.jsp

  <%
      InitialContext ctx = new InitialContext();
      try {
          Object obj = ctx.lookup("testBean/remote");
          //baseRemote testRemote = (baseRemote) 
PortableRemoteObject.narrow(obj, baseRemote.class);
          baseBean bean = (baseBean)obj;
          out.print(bean.hello());
          //out.print(testRemote.hello());
      } catch (Exception e) {
         e.printStackTrace();
      }
  %>
  


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

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

Reply via email to