客户端引用ejb时,需要指定ejb服务器的地址的
以weblogic为例,一般代码类似于
try
{
Properties prop=new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL,"t3://localhsot:7001");
Context ctx=new InitialContext(prop);
Object objref=ctx.lookup("xxxxxx");
}
.....
以weblogic为例,一般代码类似于
try
{
Properties prop=new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL,"t3://localhsot:7001");
Context ctx=new InitialContext(prop);
Object objref=ctx.lookup("xxxxxx");
}
.....
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货