Topic: 第一个ejb,运行不成功,帮忙看看 |
Print this page |
1.第一个ejb,运行不成功,帮忙看看 | Copy to clipboard |
Posted by: shaman1979 Posted on: 2004-11-03 11:45 客户端调试代码: public class HelloClientTS { /** * */ public HelloClientTS() { super(); // TODO Auto-generated constructor stub } public static void main(String[] args) throws Exception{ Hashtable props = new Hashtable(); props.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put(InitialContext.PROVIDER_URL, "localhost:8080"); Context ctx = new InitialContext(props); Object obj = ctx.lookup("HelloHome"); HelloHome home = (HelloHome)PortableRemoteObject.narrow(obj,HelloHome.class); Hello hello = home.create(); System.out.println(hello.hello()); hello.remove(); } } 错误信息: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1119) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1196) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509) at javax.naming.InitialContext.lookup(InitialContext.java:347) at examples.HelloClientTS.main(HelloClientTS.java:44) 用的是myeclipse,jboss-3.2.5 开发和调试在同一台机器上. ejb-jar.xml : <ejb-jar> <enterprise-beans> <session> <ejb-name>Hello</ejb-name> <home>examples.HelloHome</home> <remote>examples.Hello</remote> <local-home>examples.HelloLocalHome</local-home> <local>examples.HelloLocal</local> <ejb-class>examples.HelloBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session> </enterprise-beans> </ejb-jar> 单步调试卡在 Object obj = ctx.lookup("HelloHome");这句 可以确定jboss服务已启动,ie中输入http://localhost:8080/jmx-console/可以看到jboss的显示。 查不出原因,有经验的帮忙指点.. 谢谢 |
2.Re:第一个ejb,运行不成功,帮忙看看 [Re: shaman1979] | Copy to clipboard |
Posted by: 21zxg Posted on: 2004-11-03 21:05 把 Object obj = ctx.lookup("HelloHome");改成Object obj = ctx.lookup("Hello"); |
3.Re:第一个ejb,运行不成功,帮忙看看 [Re: shaman1979] | Copy to clipboard |
Posted by: shaman1979 Posted on: 2004-11-05 14:48 多谢楼上,问题我自己已经解决了,你说的是一点,还有就是把 localhost:8080改成jnp:\\localhost:1099 |
4.Re:第一个ejb,运行不成功,帮忙看看 [Re: shaman1979] | Copy to clipboard |
Posted by: etrustzhang2004 Posted on: 2004-11-08 14:32 不是吧.不需要jnp:\\也可以 |
5.Re:第一个ejb,运行不成功,帮忙看看 [Re: shaman1979] | Copy to clipboard |
Posted by: zhaopeng309 Posted on: 2004-11-08 20:49 我靠 你用的是那个服务器啊 怎么端口是8080 和tomcat一样, 建议使用weblogic端口是7001另外 赶紧修改你的命名空间上下文的工厂CLASS 和URL再在合适的端口上查寻你部署的EJB 再看有没有问题 |
6.Re:第一个ejb,运行不成功,帮忙看看 [Re: shaman1979] | Copy to clipboard |
Posted by: jameszhang Posted on: 2004-11-09 10:21 他用的是JBOSS |
7.Re:第一个ejb,运行不成功,帮忙看看 [Re: jameszhang] | Copy to clipboard |
Posted by: nothing Posted on: 2004-11-09 10:41 .............. |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |