Glassfish 5.1 java.lang.IllegalStateException:应用程序验证失败。
EJB
@Stateless
public class DataAccessorBean {
public void persist(Object entity) {
}
}
JSF 支持 Bean
@Named
@ViewScoped
public class MyBackingBean implements Serializable {
@EJB
DataAccessorBean dataAccessorBean;
}
部署错误:
java.lang.IllegalStateException: Application validation fails for given application [my-web] for jndi-name []
at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:89)
at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:617)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:211)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:173)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:207)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:73)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:857)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:797)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:354)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:195)
如果从 Web 应用程序中删除 EJB bean,部署将成功。