EJB3.0异常总结--- Need to specify class name in environment or system property,
来源:互联网 发布:web即时通讯源码 编辑:程序博客网 时间:2024/05/20 02:23
异常:
Need to specify class name in environment or system property, or
as an applet parameter, or in an application resource file:
java.naming.factory.initial
原因:
1.没有写入jndi.properties.
2.Need to specify class name in environment or system property. 的
意思就是找不到你的EJB环境变量. 换句话说就是你的客户在使用lookup
的时候. context没有设置对.
3.Need to specify class name in environment or system property, or
as an applet parameter, or in an application resource file:
java.naming.factory.initial
使用的是代码InitialContext
ctx=new InitialContext(props);的方式,不存在jndi配置文件不对的问
题,最后想起之前一个教程里的一句命名空间的话,于是登录jboss控制
台,找到部署的ejb,前面一个java提醒鸟我,将代码里lookup中参数前
面加上java:,搞定。
public class EjbClient {
public static void main(String[] args) {
Properties props=new Properties();
props.setProperty
("java.naming.factroy.initial","org.jnp.interfaces.NamingContextFact
ory");
props.setProperty
("java.naming.provider.url","localhost:1099");//或者
jnp://localhost...也可
props.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");//此行必须有
try{
InitialContext ctx=new InitialContext(props);
HelloWorld helloworld=(HelloWorld)ctx.lookup
("java:HelloWorldBean/remote");//前面的java是关键
System.out.println(helloworld.sayHello("jack"));
}catch(NamingException e){
System.out.println("error:"+e.getMessage());
}
}
}
Need to specify class name in environment or system property, or
as an applet parameter, or in an application resource file:
java.naming.factory.initial
原因:
1.没有写入jndi.properties.
2.Need to specify class name in environment or system property. 的
意思就是找不到你的EJB环境变量. 换句话说就是你的客户在使用lookup
的时候. context没有设置对.
3.Need to specify class name in environment or system property, or
as an applet parameter, or in an application resource file:
java.naming.factory.initial
使用的是代码InitialContext
ctx=new InitialContext(props);的方式,不存在jndi配置文件不对的问
题,最后想起之前一个教程里的一句命名空间的话,于是登录jboss控制
台,找到部署的ejb,前面一个java提醒鸟我,将代码里lookup中参数前
面加上java:,搞定。
public class EjbClient {
public static void main(String[] args) {
Properties props=new Properties();
props.setProperty
("java.naming.factroy.initial","org.jnp.interfaces.NamingContextFact
ory");
props.setProperty
("java.naming.provider.url","localhost:1099");//或者
jnp://localhost...也可
props.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");//此行必须有
try{
InitialContext ctx=new InitialContext(props);
HelloWorld helloworld=(HelloWorld)ctx.lookup
("java:HelloWorldBean/remote");//前面的java是关键
System.out.println(helloworld.sayHello("jack"));
}catch(NamingException e){
System.out.println("error:"+e.getMessage());
}
}
}
- EJB3.0异常总结--- Need to specify class name in environment or system property,
- javax.naming.NoInitialContextException: Need to specify class name in environment or system property
- javax.naming.NoInitialContextException: Need to specify class name in environment or system property
- WLS Exception: Need to specify class name in environment or system property Solution
- javax.naming.NoInitialContextException: Need to specify class name in environment or system property
- javax.naming.NoInitialContextException: Need to specify class name in environment or system property
- Need to specify class name in environment or system property, or as an applet parameter, or in an ap
- Need to specify class name in environment or system property, or as an applet parameter, or in an ap
- Need to specify class name in environment or system property, or as an applet parameter, or in a
- javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter,
- WEBSPHERE连接数据库测试错误Need to specify class name in environment or system property, or as an applet parameter, or in an application
- Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: j
- 在使用jetty配置jndi的时候报错“Need to specify class name in environment or system property, or as an applet pa
- javax.naming.NoInitialContextException: Need to specify class name in XXX解决
- The type or namespace name 'Windows' does not exist in the class or namespace 'System'
- How to rename ASM instances in RAC or clustered environment
- Attribute name invalid for tag property according to TLD 异常
- EJB3.0异常总结---Exception in thread "main" javax.naming.NameNotFoundException: StatelessEjbBean not bou
- C++中的内存分配
- CSS实现带箭头的DIV
- Linux socket send file
- 润乾打印控制解决方案
- 设计模式之代理模式
- EJB3.0异常总结--- Need to specify class name in environment or system property,
- Linux socket receive file
- C#:DataGridView中列类型使用时间控件和下拉列表的自动匹配
- Linux iSCSI Target Setup
- eclipse编辑器字体设置
- 数据结构学习之西南民大OJ<定期更新>
- C语言CGI程序--POST表单/GET表单处理
- Dijkstra 最短路径算法 图示与实现
- 利用adb shell 命令来查看启动动画