如何在pc甲上访问pc乙上的Ejb? 把ejb部署到电脑2上,把客户段部署到电脑1上,当然电脑1只有一个web服务器就足以,然后在客户段程序必须加上电脑2的ip。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 完全可以,EJB就是分布式的,就是一台在美国,另一台在中国都完全可以。 EJB本来就是分布式组件啊!只要你实现了远程接口即可! 可以,给出一个例子: private Context getInitialContext() throws Exception { //将localhost改成你要访问的机器名字,其它都一样; //前提是你要在那台机器上部署; String url = "t3://localhost:7001"; String user = "system"; String password = "11112163"; Properties properties = null; try { properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); properties.put(Context.PROVIDER_URL, url); if (user != null) { properties.put(Context.SECURITY_PRINCIPAL, user); properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password); } return new InitialContext(properties); } catch(Exception e) { log("Unable to connect to WebLogic server at " + url); log("Please make sure that the server is running."); throw e; } }得到Context后,就可以按标准步骤写了! 呵呵,EJB就是拿来干这种活的啊 问一下,这里为什么是t3,t3表示什么意思?String url = "t3://localhost:7001"; 找不到原因请高手指教 如何为枚举的下拉框付初始值 后台的类如何传到js中 有重名字段时,hibernate查询原生sql结果不正确或报错 JFreeChart 散点图 SSH整合失败,求救: Error listenerStart 急需技术人员! 有关无主键的数据库表的查询问题。 Struts的action中如何读取ApplicationResources.properties文件中的数据? oracle数据库执行更新删除都没问题,但就是插入不进,是怎么回事呀,坐等!!!!!!!!! 请问怎样设置JTable组件的列标题颜色 请问这个错误是什么原因引起的
private Context getInitialContext() throws Exception
{
//将localhost改成你要访问的机器名字,其它都一样;
//前提是你要在那台机器上部署;
String url = "t3://localhost:7001";
String user = "system";
String password = "11112163";
Properties properties = null;
try
{
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null)
{
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
} return new InitialContext(properties);
}
catch(Exception e)
{
log("Unable to connect to WebLogic server at " + url);
log("Please make sure that the server is running.");
throw e;
}
}
得到Context后,就可以按标准步骤写了!
String url = "t3://localhost:7001";