【发布时间】:2013-04-08 20:50:31
【问题描述】:
我遇到了异常:
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 sn-p:
<dependencyManagement>
...
<artifactId>jboss-javaee-6.0-with-infinispan</artifactId>
...
</dependencyManagement>
<dependencies>
...
<artifactId>infinispan-core</artifactId>
...
</dependencies>
【问题讨论】:
-
邮政编码。该异常非常简单,它找不到您要注入的内容。
-
卡尔·基尔登,感谢您的回复。
-
在下面的行中有一个警告“没有 bean 有资格注入到注入点 [JSR-299 §5.2.1]”:[code] @Inject public SeatAllocationService(EmbeddedCacheManager manager) {配置分配 = new ConfigurationBuilder() .transaction().transactionMode(TransactionMode.TRANSACTIONAL) .transactionManagerLookup(new JBossTransactionManagerLookup()) .lockingMode(LockingMode.PESSIMISTIC) .loaders().addFileCacheStore().purgeOnStartup(true) .build() ; manager.defineConfiguration(分配,分配); this.cache = manager.getCache(ALLOCATIONS); }
-
在 pom 我有
... jboss-javaee-6.0-with-infinispan 和infinispan-core 。附言抱歉格式:我没有找到如何以更好的格式发布代码源。
标签: dependency-injection persistence jboss7.x cdi