javax.naming.NameNotFoundException: Remote not bound 使用泛型接口怎么定义远程 接口

weixin_38087753 2014-11-09 01:45:30
   InitialContext ctx = new InitialContext();   userDao = (UserDao)ctx.lookup("UserDaoImpl/remote"); 这样可以访问   如果是是用泛型接口 private static UserService userService; 就报错 javax.naming.NameNotFoundException: Remote not bound  at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)  at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)  at org.jnp.server.NamingServer.getObject(NamingServer.java:543)  at org.jnp.server.NamingServer.lookup(NamingServer.java:296)  at org.jnp.server.NamingServer.lookup(NamingServer.java:270)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  at java.lang.reflect.Method.invoke(Method.java:606)  at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)  at sun.rmi.transport.Transport$1.run(Transport.java:177)  at sun.rmi.transport.Transport$1.run(Transport.java:174)  at java.security.AccessController.doPrivileged(Native Method)  at sun.rmi.transport.Transport.serviceCall(Transport.java:173)  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  at java.lang.Thread.run(Thread.java:744)  at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)  at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)  at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)  at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)  at javax.naming.InitialContext.lookup(InitialContext.java:411)  at test.UserServiceTest.setUpBeforeClass(UserServiceTest.java:27)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  at java.lang.reflect.Method.invoke(Method.java:606)  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)  at org.junit.runners.ParentRunner.run(ParentRunner.java:236)  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)  at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)   接口使用的是泛型怎么使用EJB  
...全文
24 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

476

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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