Enterprise1Home home = (Enterprise1Home) PortableRemoteObject.narrow(obj,Enterprise1Home.class);
Enterprise1 acct = home.create();这个是类型转化错误。
Enterprise1 acct = home.create();这个是类型转化错误。
调试欢乐多
private Organization org;
private ContactHome contactHome;
private CardIDEjbServiceHome cardHome ;
private CardIDEjbService card ;
private Contact contact;
private InitialContext ctx;
public OrgVO orgVO;
public UmInfo() throws Exception {
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL,"t3://10.13.72.159:7001");
ctx = new InitialContext(properties);
String jndi = "com/paic/epass/epasscms/biz/service/ejb/CardIDEjbService";
jndi ="ejb/epasscms/CardIDService";
Object jndiobj = ctx.lookup(jndi);
this.cardHome = (CardIDEjbServiceHome)PortableRemoteObject.narrow(jndiobj,
CardIDEjbServiceHome.class);
card = cardHome.create();
}
否则你的程序加载的时候会加载一个bean从而有了主接口,然后你通过home又create一个主接口,这两个主接口会有冲突。