| 发表于:2007-06-26 17:51:27 楼主 |
我将ejb发布到weblogic上,然后通过客户端call这个ejb,抛出classcastexception。在weblogic的jndi树中,我的ejb信息如下: settings for helloearhelloejb_jaragencybean_eo overview security this page displays details about this bound object. binding name: helloearhelloejb_jaragencybean_eo class: agency.agencybean_ff3n86_eoimpl_920_wlstub hash code: 327 tostring results: weblogic.rmi.internal.collocatedremoteref -hostid: '-8361332264705973729s::base_domain:adminserver ', oid: '327 ', channel: 'null ' 客户端程序是: private static final string wl_provider_url = "t3://localhost:7001 "; private static final string wl_initial_context_factory = "weblogic.jndi.wlinitialcontextfactory "; private static context initctx = null; try{ hashtable env = new hashtable(); env.put(context.initial_context_factory, wl_initial_context_factory); env.put(context.provider_url, wl_provider_url); initctx = new initialcontext(env); if(initctx == null) { system.out.println( "initial context failling! "); return; } object lookup = initctx.lookup( "helloearhelloejb_jaragencybean_eo "); object home = portableremoteobject.narrow(lookup,agencyhome.class); agency agency = ((agencyhome)home).create(); agency.getagencyname(); agency.findallapplicants(); }catch(namingexception ex){ system.err.println(ex); } 大家要帮忙啊! 在线等..... |
|
|
|
|