开发者

CDI Activate producer packaged in jar

开发者 https://www.devze.com 2023-01-16 07:35 出处:网络
i have a producer, i want to put it in a jar, so that my diff war files can refer the same implementation

i have a producer, i want to put it in a jar, so that my diff war files can refer the same implementation

public class LogFactory {

  @Produces
  public Logger create开发者_如何学JAVALogger(InjectionPoint injectionPoint) {
    return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
  }
}

but it turns now, glassfish (3.0.1) can not auto discover the producer method

how to fix this?


I'm not 100% sure but is the JAR CDI enabled (i.e. does it have a beans.xml)?

0

精彩评论

暂无评论...
验证码 换一张
取 消