进几天在看EJB然后就找了一个简单的例子进行测试可是老出错!
最后才发现是jboos4.02自己到的问题郁闷啊!
我建立了一个简单的stateless EJB功能就是将小写的字符串转换为大写的字符串!
很简单的!可是老是调不通:出错信息为:
java.lang.ClassCastException
com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
org.apache.jsp.common_jsp.jspInit(common_jsp.java:28)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:78)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:155)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:315)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
开始我在百度里搜索后将所有的链接都看了一便遇到这个问题的人还不算多!
经过检索和测试发现都不对!无赖中就进google进行搜索才发现了一点线索
java技术论坛上有这么一个帖子:
http://forum.java.sun.com/thread.jspa?threadID=742861&messageID=4258493
是这么回答的:
The class files loaded on the Client side is mismatching the class files from the Server.
Ensure that the version of the class files are same and try again.
Thanks and regards,
Pazhanikanthan. P
我看了一下尽管不懂不过我猜测可能是版本的问题至于是java还是jboos就不清除了!
然后又在jboos的技术论坛上找到这么一个帖子:
http://staging.jboss.com/index.html?module=bb&op=viewtopic&p=3880890是这么回答的:
Hi, after reading a lot of articels now i new, that this is not a bug and i didn't make a mistake. the problem is, that there is a change of settings between jboss 4.0.2 RC1 and 4.0.2 Final, but i don't know what. it has something to do with classloading and virtual machines. everybody says this but nobody says what to do to resolve this problem :-( .
know i use jboss 4.0.3 RC1 and everything works fine.
Grüße aus Deutschland,
Sven
看后发现他说是jboos4.0.2有bug
然后我就在网上下载了jboos最新版4.0.4GA重新发布就成功了!^_^