Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java EE 综合讨论区 » EJB 3.0  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 请教EJB的一个问题
ancin





发贴: 5
积分: 0
于 2006-06-16 08:55 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
在EJB的Lookup JNDI的时候为什么会出现如此的错误呢。请各位英雄指教:

13:22:41,890 ERROR [STDERR] java.lang.ClassCastException
13:22:41,890 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
13:22:41,890 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
13:22:41,890 ERROR [STDERR] at org.apache.jsp.Myjsp.TestTree_jsp._jspService(TestTree_jsp.java:104)
13:22:41,890 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
13:22:41,890 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
13:22:41,890 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
13:22:41,890 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
13:22:41,890 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
13:22:41,890 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
13:22:41,890 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
13:22:41,890 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
13:22:41,890 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
13:22:41,890 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
13:22:41,890 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
13:22:41,890 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
13:22:41,890 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
13:22:41,890 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
13:22:41,890 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
13:22:41,890 ERROR [STDERR] Caused by: java.lang.ClassCastException: $Proxy85
13:22:41,890 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
13:22:41,890 ERROR [STDERR] ... 26 more

在我JSP的页面的一个简单Test代码段如下:
<%
try {
Context jndiContext = new InitialContext();
Object ref = jndiContext.lookup("TravelAgentHomeRemote");
TravelAgentHomeRemote home = (TravelAgentHomeRemote) PortableRemoteObject
.narrow(ref, TravelAgentHomeRemote.class);
TravelAgentRemote travelAgent = home.create();

String list[] = travelAgent.listCabins(1, 3);
for (int i = 0; i < list.length; i++) {
System.out.println(list[i]);
}

} catch (java.rmi.RemoteException re) {
re.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
}
%>
请高手指教;为什么会出现此错误呢。
谢谢。




CJSDNer6月14日北京聚会花絮

话题树型展开
人气 标题 作者 字数 发贴时间
10260 请教EJB的一个问题 ancin 4506 2006-06-16 08:55

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   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