当我尝试在JBOSS中部署启动 bean和默认拦截器(通过ejb-jar.xml)时,我得到了下面提到的错误。
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "jboss.j2ee:ear=plmislapp.ear,jar=islbl.jar,name=CALCacheBaseLoader,service=EJB3_endpoint" is missing the following dependencies:
Dependency "jboss.j2ee:ear=plmislapp.ear,jar=islbl.jar,name=CALCacheBaseLoader,service=EJB3" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.j2ee:ear=plmislapp.ear,jar=islbl.jar,name=CALCacheBaseLoader,service=EJB3' **")
DEPLOYMENTS IN ERROR:
Deployment "jboss.j2ee:ear=plmislapp.ear,jar=islbl.jar,name=CALCacheBaseLoader,service=EJB3" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.j2ee:ear=plmislapp.ear,jar=islbl.jar,name=CALCacheBaseLoader,service=EJB3' **
CALCacheBaseLoader 是我的启动bean
@Startup
@Singleton
@ExcludeDefaultInterceptors
public class CALCacheBaseLoader extends BaseBL {
private static final String CURRENT_CLASSNAME="CALCacheBaseLoader";
/**
* This is method is called by container during server startup.
* */
@PostConstruct
public void applicationStartup() {
logInfo(CURRENT_CLASSNAME, "START METHOD:> applicationStartup");
try{
new CALCacheManagerWithJBossCache();
}catch(Exception e){
logError(CURRENT_CLASSNAME, CacheConstant.EXCEPTION_WHILE_REGISTER_CACHE);
logStackTrace(CURRENT_CLASSNAME, "applicationStartup", CacheConstant.EXCEPTION_WHILE_REGISTER_CACHE, e);
}
logInfo(CURRENT_CLASSNAME, "END METHOD:> applicationStartup");
}
}
及以下是 ejb-jar.xml 中默认拦截器的配置。
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<interceptors>
<interceptor>
<interceptor-class>util.logger.SampleInterceptor</interceptor-class>
</interceptor>
</interceptors>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>*</ejb-name>
<interceptor-class>util.logger.SampleInterceptor</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
</ejb-jar>