ejb jboss 和 client 的两种交互方式
来源:互联网 发布:运动香水知乎 编辑:程序博客网 时间:2024/06/03 17:17
1.
Properties props = new Properties();
props.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.provider.url", "localhost:1099");
props.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
InitialContext ctx;
ctx = new InitialContext(props);
TbVitalsignsservice service = (TbVitalsignsservice) ctx
.lookup("DGOFGH-RFID-ear/TbVitalsignsserviceBean/remote");
2.新建“ jndi.properties”文件 内容
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost\:1099
新建类‘
public class Util {
private static Properties properties;
private static InitialContext context;
static {
properties = new Properties();
try {
properties.load(Util.class.getResourceAsStream("jndi.properties"));
context = new InitialContext(properties);
} catch (IOException e) {
e.printStackTrace();
} catch (NamingException e) {
e.printStackTrace();
}
}
public static InitialContext getInitialContext() {
return context;
}
/*
* 曹飞龙TbVitalsignsservice
*/
public static VsInfo getvsinfoService() throws NamingException {
return (VsInfo) context.lookup("DGOFGH-RFID-ear/VsInfoBean/remote");
}
/*
* 曹飞龙TbVitalsignsservice
*/
public static TbVitalsignsservice getTbVitalsignsservicePadService()
throws NamingException {
return (TbVitalsignsservice) context
.lookup("DGOFGH-RFID-ear/TbVitalsignsserviceBean/remote");
}
}
servlet调用
try {
VsInfo vsinforef = com.sura.mnursing.config.Util.getvsinfoService();
vsinforef.savevs(null);
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- ejb jboss 和 client 的两种交互方式
- EJB中事务处理的两种方式
- 调用EJB的两种方式
- Qt和Javascript交互的两种方式
- node和angular交互的两种方式
- iOS和H5交互的两种方式
- vim和shell交互两种方式
- EJB会话bean查找和注入注解两种方式
- EJB和JBOSS的宏观理解
- JBoss中发布EJB 并编写Client
- JBoss 7 里一个EJB依赖其他jar的几种方式
- OpenStack Client客户端的两种身份验证方式
- 移动端常用的数据交互格式有xml和json两种方式
- android 与后台交互的两种方式xml和json
- PHP与Javascript的两种交互方式
- PHP与Javascript的两种交互方式
- PHP与Javascript的两种交互方式
- PHP与Javascript的两种交互方式
- [EXTJS] 下载文件错误 BADRESPONSE: illegal character
- HTML、CSS学习笔记(一)
- Loadrunner教程
- 自己写的一个批处理文件,自动更新svn文件 并自动用ant编译 调用jboss的run启动服务器
- 在jsp上显示pdf||网页直接打开PDF 在IE中显示pdf文档的方法及参数设置
- ejb jboss 和 client 的两种交互方式
- 用source insight宏自动加入或去除C注释
- 在VB中调用C/C++语言编写的dll,数组参数的传递
- ARM编译中的RO、RW和ZI DATA区段
- C++的反射
- C# The given key was not present in the dictionary.错误原因及解决办法。
- 四.Sql server修改语句
- 通向架构师的道路(第二天)之apache tomcat https应用
- Java程序员应该知道的10个调试技巧