当前位置: 技术问答>java相关
EJB 问题 + apusic2.0{lookup}
来源: 互联网 发布时间:2015-09-27
本文导语: InitialContext ctx = new InitialContext(); Object objRef = ctx.lookup("java:comp/env/ejb/Hello"); HelloHome home=(HelloHome)javax.rmi.ProtableRemoteObject.narrow(objRef,HelloHome.class); Hello bean = home.create(); ———————...
InitialContext ctx = new InitialContext();
Object objRef = ctx.lookup("java:comp/env/ejb/Hello");
HelloHome home=(HelloHome)javax.rmi.ProtableRemoteObject.narrow(objRef,HelloHome.class);
Hello bean = home.create();
————————————————————————————————————
E:eeclasses>javac -classpath %classpath% HelloServlet.java
HelloServlet.java:14: cannot resolve symbol
symbol : class HelloHome
location: class HelloServlet
HelloHome home=(HelloHome)javax.rmi.ProtableRemoteObject.narrow(objRef,He
lloHome.class);
^
HelloServlet.java:14: cannot resolve symbol
symbol : class HelloHome
location: class HelloServlet
HelloHome home=(HelloHome)javax.rmi.ProtableRemoteObject.narrow(objRef,He
lloHome.class);
^
HelloServlet.java:14: cannot resolve symbol
symbol : class HelloHome
location: class HelloServlet
Object objRef = ctx.lookup("java:comp/env/ejb/Hello");
HelloHome home=(HelloHome)javax.rmi.ProtableRemoteObject.narrow(objRef,HelloHome.class);
Hello bean = home.create();
————————————————————————————————————
E:eeclasses>javac -classpath %classpath% HelloServlet.java
HelloServlet.java:14: cannot resolve symbol
symbol : class HelloHome
location: class HelloServlet
HelloHome home=(HelloHome)javax.rmi.ProtableRemoteObject.narrow(objRef,He
lloHome.class);
^
HelloServlet.java:14: cannot resolve symbol
symbol : class HelloHome
location: class HelloServlet
HelloHome home=(HelloHome)javax.rmi.ProtableRemoteObject.narrow(objRef,He
lloHome.class);
^
HelloServlet.java:14: cannot resolve symbol
symbol : class HelloHome
location: class HelloServlet
|
没有找到home和remote接口阿
是环境变量设定的问题阿
要把将类存放的位置放在classpath中,我也碰到了同样的错误阿,最后解决了
可以和我联系yuwolianxi@0733.com
我正在用apusic服务器
是环境变量设定的问题阿
要把将类存放的位置放在classpath中,我也碰到了同样的错误阿,最后解决了
可以和我联系yuwolianxi@0733.com
我正在用apusic服务器