你的ejb代码似乎没有问题,可是你的client的代码呢?
贴出来看看?
还有ias的配置?
最好老老实实按照例子来做一遍的说。
贴出来看看?
还有ias的配置?
最好老老实实按照例子来做一遍的说。
解决方案 »
- 对于j2ee项目的保护,怎么防止客户随意复制
- Hibernate Bean转换
- 新人报道!求指教
- Hibernate操作数据库问题
- servlet中的常量问题
- 我是.NET程序员,想学习JAVA,问下各位大虾需要配置什么样的平台(J2EE)
- jndi问题!!!!!!!!!!!!!!!!!!!!!!!!!
- 大家快来,散分了,给建议就给分!!!
- 新手求救:按照Charly的《Windows2000下安装J2EE和部署J2EE应用程序》但无法部署程序,也没有报错!
- 【高分求解答】测试方法运行正常能够得到数据,放到Tomcat上边运行就不能够得到数据了
- 请问各位J2EE的开发环境都是什么?
- VisualAge & XML
哦
client代码如下:import javax.naming.*;
import javax.rmi.PortableRemoteObject;public class Client {
private TellerHome tellerHome = null; /**Construct the EJB test client*/
public Client() {
try {
//get naming context
Context ctx = new InitialContext(); //look up jndi name
Object ref = ctx.lookup("TellerHome"); //cast to Home interface
tellerHome = (TellerHome) PortableRemoteObject.narrow(ref, TellerHome.class); Teller teller = tellerHome.create();
int t = teller.getTellerNo();
System.out.println("Using Teller No is: " + t);
}
catch(Exception e) {
e.printStackTrace();
}
} //----------------------------------------------------------------------------
// Utility Methods
//---------------------------------------------------------------------------- public TellerHome getHome() {
return tellerHome;
}
/**Main method*/ public static void main(String[] args) {
Client client = new Client();
// Use the getHome() method of the client object to call Home interface
// methods that will return a Remote interface reference. Then
// use that Remote interface reference to access the EJB.
}
}在j2ee自带的server里就可以访问(属于本地访问吧?需不需要专门的for ias的访问
代码?),不过用ias就不行了。