return;
}
}
KieProject kProject = kieContainer.getKieProject();
KieBaseModel kBaseModel = null;
String kBaseQName = entry.getValue();
if ( StringUtils.isEmpty( kBaseQName )) {
kBaseModel = kProject.getDefaultKieBaseModel();
} else {
kBaseModel = kProject.getKieBaseModel( kBaseQName );
}
if ( kBaseModel == null ) {
log.error( "Annotation @KBase({}) found, but no KieBaseModel exist.\nEither the required kproject.xml does not exist, was corrupted, or mising the KieBase entry",
kBaseQName );
return;
}
if ( !kBaseModel.getScope().trim().equals( entry.getScope().getClass().getName() ) ) {
try {
if ( kBaseModel.getScope().indexOf( '.' ) >= 0 ) {
entry.setScope( (Class< ? extends Annotation>) Class.forName( kBaseModel.getScope() ) );
} else {
entry.setScope( (Class< ? extends Annotation>) Class.forName( "javax.enterprise.context." + kBaseModel.getScope() ) );
}
} catch ( ClassNotFoundException e ) {
log.error( "KieBaseModule {} overrides default annotation, but it was not able to find it {}\n{}",
new String[]{kBaseQName, kBaseModel.getScope(), e.getMessage()} );
}
}
KBaseBean bean = new KBaseBean( kBaseModel,
kieContainer,
entry.getKReleaseId(),