专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > JBoss

请高手指教:JBoss+Eclipse+Myeclipse学写EJB解决思路

发布时间:2010-06-14 16:56:08 文章来源:www.iduyao.cn 采编人员:星星草
请高手指教:JBoss+Eclipse+Myeclipse学写EJB
刚开始学用JBoss+Eclipse+Myeclipse学写EJB代码,一个很简单程序出现了问题:
客户端的JSP文件:
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%@ page import="test.*,javax.naming.*" %>
<%
try {
InitialContext ctx = new InitialContext();
ChinaRemote hello=(ChinaRemote)ctx.lookup("China/remote");
         out.print(hello.Say("现在时间:"));
out.print(new java.util.Date());

}catch(NamingException e)
{
out.print(e.getMessage());
}
%>
注:其中test是另一个工程中包含ChinaRemote和China类的包

总是报错:The import test cannot be resolved
          ChinaRemote cannot be resolved to a type

但很奇怪的是最后浏览器能产生正确的网页!

另外一个相似的程序——-产生的网页总是提示:remote not bound

还请请高手指教!
------解决方案--------------------
InitialContext ctx = new InitialContext();
ChinaRemote chinese wholesalers=(ChinaRemote)ctx.lookup("China/remote");
        out.print(hello.Say("现在时间:"));
out.print(new java.util.Date());

}catch(NamingException e)
{
out.print(e.getMessage());

------解决方案--------------------
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: