remote interface和Bean裡面的定義可能不同!!

解决方案 »

  1.   

    你只需要声明抛出NamingException异常就行了,因为你的程序块中并没有在异常处理也就是catch块中抛出其他两个异常,同时也没有调用抛出该异常的方法,所以不能声明该异常的抛出,所以,只要保留NamingException异常就行了。
      

  2.   

    我在测试BMP Bean里写的代码如下      //get naming context
          Context context = getInitialContext();      //look up jndi name
          Object ref = context.lookup("BMPBEANRemote");
          //look up jndi name and cast to Home interface
          bMPBEANRemoteHome = (BMPBEANRemoteHome) PortableRemoteObject.narrow(ref, BMPBEANRemoteHome.class);
          bMPBEANRemoteHome.ejbInsertAa11("1", "J");正常测试通过,但,在Session Bean 里写代码调用就出错!!!郁闷呀,,
    刚才改了一点还是一样,同样的错误,
              Context TX = new InitialContext();
              Object ref = TX.lookup("BMPBEANRemote");
              bMPBEANHome = (BMPBEANHome) javax.rmi.PortableRemoteObject.narrow(ref,
                            BMPBEANHome.class);          System.out.println("begin to insert...........");          bMPBEANHome.ejbInsertAa11(shancbz, xiwbz);错误如下:
        "JSEB.ejbgrpx": D:\bea\jdk131_08\bin\javaw -classpath "D:\bea\weblogic700\server\lib\weblogic.jar;D:\bea\weblogic700\server\lib\webservices.jar;C:\jdbc;"  weblogic.ejbc -keepgenerated -compiler D:/JBuilder8/bin/bcjW C:/jbProject/UserJmsSesEnbDB/JSEB.jar.jar C:/jbProject/UserJmsSesEnbDB/JSEB.jar"JSEB.ejbgrpx": ERROR: Error from ejbc: 
    "JSEB.ejbgrpx": In EJB SessBean, the throws clause for method insTableAa11(java.lang.String,java.lang.String) in the bean class contains exceptions which are NOT in the throws clause of the remote interface.
      

  3.   

    "JSEB.ejbgrpx": ERROR: ejbc found errors
    这四个错误一起出现,各位救救火吧,,
    我真的不知应该从何入手,,,
      

  4.   

    OK,解决了我把throws 去掉了,在代码里加了try,居然好用了,我再试试,不过好用了,很高兴,
    这就给分