jimsons原创
第一个错 NextIdBean代码中的错误
此错误会造成部署发生错误不能完成,将<INSTALL>/j2eetutorial14/examples/bank/src/com/sun/ebank/ejb/util/目录下的NextIdBean.java文件打开,找到下面这行代码
public Object ejbCreate() throws CreateException { 
将方法ejbCreate()的返回类型由Object更改为String,再重新编译,并在deploytool中更新此文件,重新部署即可成功
第二个错 Web模块中的错误
打开Web客户端,输入用户名密码然后提交可能会抛出javax.servlet.jsp.JspTagException错误,请根据以下步骤进行更正:
1. 用文本编辑器新建java文档命名为CustomerHackFilter,保存到<INSTALL>/j2eetutorial14/examples/bank/src/com/sun/ebank/web目录下,内容如下:
package com.sun.ebank.web;import javax.servlet.*;
import javax.servlet.http.*;
import com.sun.ebank.util.Debug;
import com.sun.ebank.web.*;
import java.io.IOException;/**
 * this is a dumb hack.  update 4 seems to broken unless a
 * CustomerBean is placed in the request linked to the BeanManager. 
 * Naturally, we need to add a BeanManager to the session here,
 * doing some of the work the dispatcher should have done.
 */
public class CustomerHackFilter  implements Filter
{
    private FilterConfig filterConfig = null;
        public void init(FilterConfig filterConfig) 
        throws ServletException 
    {
        this.filterConfig = filterConfig;
    }    public void destroy() {
        this.filterConfig = null;
    }    public void doFilter(ServletRequest req, ServletResponse response,
                         FilterChain chain) 
        throws IOException, 
               ServletException 
    {
        HttpServletRequest request = (HttpServletRequest) req;
        HttpSession        session = request.getSession();        BeanManager beanManager =
            (BeanManager) session.getAttribute("beanManager");        if (beanManager == null) {
            Debug.print("hack - Creating bean manager.");
            beanManager = new BeanManager();
            session.setAttribute("beanManager", beanManager);
        }        CustomerBean customerBean = new CustomerBean();
        customerBean.setBeanManager(beanManager);
        request.setAttribute("customerBean", customerBean); 
        Debug.print("hack - added customerBean to request");        chain.doFilter(request, response);
    }
}
2. 重新编译源代码
3. 选中DukesBankWAR模块,编辑内容,找到com/sun/ebank/web/ CustomerHackFilter.class,将它添加到包中.
4. 选中DukesBankWAR模块,在Filter Mapping标签,点击Edit Filter List,在弹出的对话框中点击Add Filter,在Filter Class下拉列表中选中com.sun.ebank.web.CustomerHackFilter,Filter Name为CustomerHack,选择OK
5. 还是在这个标签在,点击Add,弹出 “Add Servlet Filter Mapping”,在Filter Name下拉列表中选CustomerHack,下面选中 “Filter this Servlet”,选OK
6.保存这个模块并重新部署运行即可修正错误

解决方案 »

  1.   

    (软件:J2EE1.4,JDK1.4,ANT1.6.3,struts不知道时候时候用)首先,我用ANT编译EJB的时候,说LIB IS NOT FOUND,但我已经在CLASSPATH添加了J2EE的LIB了还是不可以,于是我把J2EE的LIB复制到BANK源码的那个磁盘中,才编译成功。但在打包的时候他说我没有
    PACKAGE-EJB does not exist in this project ,我看了一下build.xml文件,的确没有这方面的部署信息。于是我把tutorial-1.3的bank例子的build.xml复制过来,可以打包了,但是又出现没有main方法的错误提示。我请大虾详细的说说怎么运行出tutorial1.4的bank这个例子。非常感谢。我真的急死了!
      

  2.   

    你j2eehome配置了没有啊
    classpath要加入j2ee的几个包
      

  3.   

    j2ee1.4与1.3有很大的不同,按照它的tutorial14里面的教程部署,再按我上面的方法改错就一定没问题,我之前已经部署成功了
      

  4.   

    RE: jimsons(路漫漫其修远兮)
    请问你可以留下QQ给我吗,我想详细问一下你,谢谢,或者请你加我QQ:14658879。非常感谢!!
      

  5.   

    jimsons(路漫漫其修远兮)
    你在哪里,等着联系你呢?请回复!谢谢
      

  6.   

    用TUTORIAL1.4的EAR文件部署,修改NextIdBean和Web模块中的错误可以部署,但是功能却用不了。怎么回事啊?jimsons(路漫漫其修远兮)
    你的功能可以用马?