我得到了例外:
WELD-001408 Unsatisfied dependencies for type [EmbeddedCacheManager] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.jboss.jdf.example.ticketmonster.service.SeatAllocationService(EmbeddedCacheManager)].
有没有人有提示?我已经确认beans.xml位于src \ main \ webapp \ WEB-INF中,我不会发布多个jar。这只是一个项目。
@Inject public SeatAllocationService(EmbeddedCacheManager manager) {
Configuration allocation = new ConfigurationBuilder()
.transaction()
.transactionMode(TransactionMode.TRANSACTIONAL)
.transactionManagerLookup(new JBossTransactionManagerLookup())
.lockingMode(LockingMode.PESSIMISTIC)
.loaders()
.addFileCacheStore()
.purgeOnStartup(true)
.build();
manager.defineConfiguration(ALLOCATIONS, allocation);
this.cache = manager.getCache(ALLOCATIONS);
}
POM片段:
<dependencyManagement>
...
<artifactId>jboss-javaee-6.0-with-infinispan</artifactId>
...
</dependencyManagement>
<dependencies>
...
<artifactId>infinispan-core</artifactId>
...
</dependencies>
答案 0 :(得分:2)
我的猜测是这是一个Infinispan类,你没有在类路径上使用Infinispan。