我正在尝试运行以下代码
@Component(name = "compname", immediate = true)
public class DemoComponent {
private static Log log = LogFactory.getLog(DemoComponent.class);
@Activate
protected void activate(ComponentContext context) {
try {
//my code
} catch (Exception e) {
//catch
}
if (log.isDebugEnabled()) {
log.debug("Demo component is activated ");
}
}
}
启动应用程序时,不会调用activate方法。我试过在try块内设置调试指针。同一项目中还有其他要激活的组件。