帮忙看看关于jBoss的问题

snake_eye 2003-09-24 08:56:48
我按照这篇文章做的
http://www.csdn.net/develop/Read_Article.asp?Id=17216
现在客户段运行时候出错
javax.naming.NameNotFoundException: Example not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
orImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:46
0)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.
java:701)
at java.lang.Thread.run(Thread.java:536)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamR
emoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:2
23)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at examples.ExampleClient.main(ExampleClient.java:31)
是不是myfirst.jar的目录放错了我放到deploy目录下了啊!
...全文
54 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
marlang 2003-09-30
  • 打赏
  • 举报
回复
if(您有时间) {
我的Email:malang333@hotmail.com;
} else {
我good luck!;
}
thank u 先;
snake_eye 2003-09-25
  • 打赏
  • 举报
回复
终于成功了感谢listlike
snake_eye 2003-09-24
  • 打赏
  • 举报
回复
我的客户段是这样的:
package examples;

import javax.naming.*;

import javax.rmi.PortableRemoteObject;

import java.util.Properties;

public class ExampleClient {

public ExampleClient() {

super();

}

public static void main(String[] args){

try{

Properties props =new Properties();

props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");

props.put(Context.PROVIDER_URL,"192.168.0.99:1099");

Context ctx = new InitialContext(props);

System.out.println("start ejb client test");

Object obj=ctx.lookup("Example");

ExampleHome home = (ExampleHome)PortableRemoteObject.narrow(obj,ExampleHome.class);

Example example = home.create();

System.out.println(example.example());

example.remove();

}catch(Exception e)

{

e.printStackTrace();

}

}

}

那里有问题啊?
franne 2003-09-24
  • 打赏
  • 举报
回复
你的JNDI初始化上下文出错了,你应该检查一下
pinecone 2003-09-24
  • 打赏
  • 举报
回复
在初始化你的 Context的时候,写上正确的名目录服务的地址。
或者写个属性文件,然后用 不带参数的 InitialContext。
pinecone 2003-09-24
  • 打赏
  • 举报
回复
myfirst.jar 没有放错。
可能是你的命名目录服务器的地址配置错误了。

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧