部署EJB报OpenEJBException异常

[2019-11-21 10:26:37] [WARNING] [core] [Error deploying application D:\TongWeb\deployment\itreasuryEJB]
com.tongweb.tongejb.OpenEJBException: Cannot Load jar D:\TongWeb\deployment\itreasuryEJB.  The number of beans deployed (166) does not match the number of beans actually in the jar (91).  Please redeploy this jar.
    at com.tongweb.tongejb.config.EjbJarInfoBuilder.buildInfo(EjbJarInfoBuilder.java:136)
    at com.tongweb.tongejb.config.ThorEjbJarInfoBuilder.buildInfo(ThorEjbJarInfoBuilder.java:15)
    at com.tongweb.tongejb.config.ThorAppInfoBuilder.build(ThorAppInfoBuilder.java:93)
    at com.tongweb.tongejb.config.ThorConfigurationFactory.configureApplication(ThorConfigurationFactory.java:896)
    at com.tongweb.twnt.thor.ThorWebtierWebAppBuilder.fireOpenEjbProcess(ThorWebtierWebAppBuilder.java:2587)
    at com.tongweb.twnt.thor.ThorWebtierWebAppBuilder.deployApplication(ThorWebtierWebAppBuilder.java:2371)
    at com.tongweb.deploy.TongWebDeployer.deploy(TongWebDeployer.java:212)
    at com.tongweb.deploy.commands.DeployCommand.deploy(DeployCommand.java:321)
    at com.tongweb.deploy.autodeploy.TongWebAutoDeployer.deployAll(TongWebAutoDeployer.java:66)
    at com.tongweb.deploy.autodeploy.TongWebAutoDeployTask.run(TongWebAutoDeployTask.java:223)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

这是因为实际的EJB个数与ejb-jar.xml中描述的个数不对应,所以部署失败,而weblogic会忽略此错误。

 解决办法:ejb-jar.xml,tongweb-ejb-jar.xml要与实际的EJB一一对应才可以。