这是tomcat的问题
把class文件放在classes下的一个目录,并在该class文件前加入 package xxx;

解决方案 »

  1.   

    把checkEnrol放到一个包里.试试..
      

  2.   

    同样还有一个数据库操作的javabean也是直接存在classes目录下,在应用时没有出现问题,是为什么呢?
    错误代码表示的是我定义的javabean不可用是吗
      

  3.   

    如果一个javabean过程中还要调用另外一个javabean的方法,其中的引用声明是不是也是一样的呢
      

  4.   

    checkenrol过程中要连接数据库,
    public boolean hasLogin(String stu_id,String cour_id){   //该学生是否已经注册该课程
       boolean f=true;
       String sql="select stu_id,class_id "+
    "from enrol,classes "+
    "where stu_id='"+stu_id+"' "+
    "and classes.id=enrol.class_id "+
    "and cour_id='"+cour_id+"' ";
       sqlBean db =new sqlBean();
       try{
       ResultSet rs=db.executeQuery(sql);
       if(rs.next()){ f=false;}
       else{ f=true;}
       }catch(Exception e){ e.getMessage();}
       return f;
                              }
    其中的数据库操作是sqlbean定义的,上面有什么问题吗?