TheConverter
想使用Config
由ConfigProducer
. ConfigProducer
WAR在哪里TheConverter
,但Config
在一个罐子里。可悲的是,似乎config
没有注入导致javax.ejb.EJBException: javax.persistence.PersistenceException: Error attempting to apply AttributeConverter
由 a 引起的NullPointerException
in TheConverter
。
我正在使用 WildFly 8.1.0,它使用 Weld 进行 CDI 注入。
我是在尝试做一些不可能的事情还是这意味着工作?
example.war
- ConfigProducer.class
@Produces Config
- WEB-INF/beans.xml (empty <beans></beans>)
- META-INF/persistence.xml
- WEB-INF/lib/entities.jar
- Config.class
- TheConverter.class
implements AttributeConverter
@Inject Config <-- FAIL
- TheEntity.class
- META-INF/beans.xml (empty <beans></beans>)
- META-INF/orm.xml