【 以下文字转载自 Java 讨论区 】
发信人: LHX (门前那颗柿子树), 信区: Java
标 题: java 调试问题求助(lookup)
发信站: 水木社区 (Wed Sep 16 17:54:13 2009), 站内
写了junit,通过如下方式:
ApplicationContext context = new FileSystemXmlApplicationContext("/WebContent/WEB-INF/applicationContext.xml");
service = (MyService)context.getBean("myService");
service.doMyMethod();
完全可以debug进入service的实现中,一步一步调试。
但是对于Ejb的,
Hashtable ht = new Hashtable();
ht.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
ht.put("java.naming.provider.url", "t3://localhost:8001");
Context context = new InitialContext(ht)
service = (MyService) context.lookup("myService#com.mytest.IMyService");
server.doMyMethod()
在debug的时候,没办法进入service的实现中。怎么能进入呢?
对上面两种情况,使用eclipse带的emma插件进行覆盖率检查的时候,第一种情况可以统计正确,
但是第二种情况,根本就没有显示service实现里面被覆盖了多少。
如何解决呢?
thanks
--
FROM 16.130.9.*