[jboss-user] [EJB 3.0] - Re: can not lookup session bean under Jboss 4.2.2GA and ejb3
yanlong11
do-not-reply at jboss.com
Wed Jan 16 07:17:20 EST 2008
Hi
thanks for your quick response.
actually I have already managed, somehow to get part of this work, unfortunately another error came up.
removing remotebinding gives same error
package beans;
import javax.ejb.Stateless;
import javax.ejb.Remote;
import org.jboss.annotation.ejb.RemoteBinding;
@Stateless(name = "testBean")
@Remote(test.class)
@RemoteBinding(jndiBinding="testBean")
public class testBean {
public testBean() {
}
public String hello() {
return "Hello from bean";
}
}
this is my bean, test.java is just interface with one method.
Context ctx = new InitialContext();
try {
Object obj = ctx.lookup("testBean");
testBean bean = (testBean)obj;
out.print(bean.hello());
} catch (Exception e) {
e.printStackTrace();
}
above is code from jsp, that is throwing ClassCast exception and now I really have no idea why.
as for JNDIView, I have there following line for my bean:
+- testBean (proxy: $Proxy96 implements interface beans.test,interface org.jboss.ejb3.JBossProxy)
after removing binding, jndi view gives following:
+- testBean (class: org.jnp.interfaces.NamingContext)
| +- remote (proxy: $Proxy129 implements interface beans.test,interface org.jboss.ejb3.JBossProxy)
how should I call hello() from jsp? where am I making mistake? and where can I learm something more from
thanks a lot for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120416#4120416
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120416
More information about the jboss-user
mailing list