在Websphere上调用EJB2的远程接口
来源:互联网 发布:宁夏大学怎么样知乎 编辑:程序博客网 时间:2024/05/17 01:18
先部署ejb jar到websphere
在MyEclipse上新建调用ejb的项目,加入ejb接口,项目引用的jar包是
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/IBM"/>---IBM的JDK
<classpathentry kind="lib" path="D:/IBM/WebSphere/AppServer/runtimes/com.ibm.ws.admin.client_6.1.0.jar"/>
<classpathentry kind="lib" path="D:/IBM/WebSphere/AppServer/lib/j2ee.jar"/>
<classpathentry kind="lib" path="lib/ejb-remote.jar"/>--部署到websphere上而生成的jar包, 路径类似 AppSrv02\installedApps\testNode02Cell\ejb-remote_jar.ear\ejb-remote.jar
调用远程接口的代码如下:
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import ejb.remote.interfaces.AccessBean;
import ejb.remote.interfaces.AccessBeanHome;
public class TestRemote {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
AccessBeanHome accessHome = null;
AccessBean accessBean = null;
String JNDIName="ejb/AccessBean";
Properties p=new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
p.put(Context.PROVIDER_URL,"iiop://192.168.83.124:2810/");
InitialContext initContext;
try{
initContext=new InitialContext(p);
Object obj= initContext.lookup(JNDIName);
accessHome=(AccessBeanHome)PortableRemoteObject.narrow(obj, AccessBeanHome.class);
accessBean=accessHome.create();
accessBean.testRemoteEJB("lidong");
}
catch(Exception e){
e.printStackTrace();
}
}
}
- 在Websphere上调用EJB2的远程接口
- 调用部署在websphere上的EJB
- 在Websphere上,使用axis做成的客户端调用Webservice需要进行的配置
- websphere6.1开发、部署、远程调用EJB2.0
- Struts2部署在Websphere上的问题
- 在Android上使用Flamingo进行远程调用的实例
- 在远程电脑上的COM+应用程序调用
- 上一篇,在Websphere上使用Axis做的客户端调用Webservice要进行修改配置的原因
- 对EJB2.1几种接口的认识
- websphere ejb 远程/本地调用总结
- websphere ejb 远程/本地调用总结
- 高效简单的远程调用接口-starcore
- 远程调用服务器端的webservice接口
- C#winForm调用WebService的远程接口
- 远程调用webservice接口的实现方法
- [C#]winForm调用WebService的远程接口
- 在myeclipse上配置websphere
- jstl 在tomcat5以及webSphere上的部署
- Developing iPhone Apps with iOS4 SDK, Deploying to 3.x Devices : Base SDK and iPhone OS Deployment T
- 项目打包,在dos下运行
- 免费讲座:网站运营之人性、策略与实战
- PHP的时间加减的函数strtotime
- 编程的首要原则(s)是什么?
- 在Websphere上调用EJB2的远程接口
- 完美主义者适合当程序员?
- 适配器模式
- Call to undefined function curl_init解决方法
- Linux驱动修炼之道-SPI驱动框架源码分析(上)
- Silk的自有文件类型
- C# char和byte 以及string之间的转换问题
- Linux交叉编译(Android-NDK-r5)
- C++ 虚表深入理解