没有找到main方法,确认是否写了main方法,确认main的语法格式是否完全正确,包含大小写是否正确。

解决方案 »

  1.   

    客户端源码如下:
    package ejbtest;import javax.naming.*;
    import javax.rmi.PortableRemoteObject;public class EJBTestTestClient {
      private EJBTestHome eJBTestHome = null;  //Construct the EJB test client
      public EJBTestTestClient() {
        try {
          //get naming context
          Context ctx = new InitialContext();      //look up jndi name
          Object ref = ctx.lookup("EJBTest");      //cast to Home interface
          eJBTestHome = (EJBTestHome) PortableRemoteObject.narrow(ref, EJBTestHome.class);
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }  //----------------------------------------------------------------------------
      // Utility Methods
      //----------------------------------------------------------------------------  public EJBTestHome getHome() {
        return eJBTestHome;
      }
      //Main method  public static void main(String[] args) {
        try{
          EJBTestTestClient client = new EJBTestTestClient();
        }catch(Exception e){
          System.out.println("\n....\n");
          System.exit(1);    }
        // Use the getHome() method of the client object to call Home interface
        // methods that will return a Remote interface reference.  Then
        // use that Remote interface reference to access the EJB.
      }
    }几乎都是jbuilder自动生产
      

  2.   

    to   LiGun(中国心_HSK)路径怎么不对呢,我用jboss+tomcat
      

  3.   

    配置以下路径
    tools->config jdk->class->add->xxx.jar
      

  4.   

    另外classpath对你的Jbuilder环境不起作用
      

  5.   

    我以前也遇到过这个问题!建议在你的TestClient的main函数中设断点,单步跟踪,one by one的测试yourEJB的method,可以定位错误的位置,不要用自动生成的test函数全部一起测!
      

  6.   

    to renjordan(任我行) 
    我断点设在main函数那,可是运行它说cann't find main class,program will exit!是怎么回事呢,是不是没有指定。
    to : study_body(珍惜每一天) 
    在jbuilder中需要添加×××.jar吗?是什么jar
      

  7.   

    按照长理应该不用,但是还是实验一下,dt.jar,tools.jar
      

  8.   

    to study_body(珍惜每一天) 
    jbuilder 默认已经包含了
      

  9.   

    很明显,你的TestEJBClient没有main函数,赶紧写一个并确保从TestEJBClient开始运行!
      

  10.   

    run->configurations->Run->new->Application(Configuration name is "test client")->OK.
    然后运行看看如何?