焊接@Inject接口
我是焊接新手。 我正在设置一个Seam 3项目战争打包。 我想发现picketlink安全管理,为了测试他的各种mamanger(在设置数据库和实体类之后),我创建了一个控制器(TestAction类),所以:
@Named("testAction")
@ConversationScoped
public class TestAction implements Serializable{
private static final long serialVersionUID = 1L;
@Inject
PersistenceManager persistenceManager;
public void createUser() throws IdentityException
{
persistenceManager.createUser("TEST_USER");
}
}
我的环境是jboss 6 Final。
启动时我得到:
WELD-001408 Unsatisfied dependencies for type [PersistenceManager] with qualifiers
[@Any] at enter injection point [[field] @Inject @Any
com.mycompany.myproject.action.TestAction.persistenceManager]
PersistenceManager 是一个带有带有参数的具体类的接口(IdentitySesionImpl)
我如何注入 PersistenceManager? WELD-001408 是什么意思?
问候
i'm new to weld.
I'm setup a seam 3 project war packaged.
I want to discover picketlink security management and in order to test his various mamanger (after setup the database and entity classes) i've created a controller (TestAction class) so:
@Named("testAction")
@ConversationScoped
public class TestAction implements Serializable{
private static final long serialVersionUID = 1L;
@Inject
PersistenceManager persistenceManager;
public void createUser() throws IdentityException
{
persistenceManager.createUser("TEST_USER");
}
}
My env is jboss 6 final.
On startup i got:
WELD-001408 Unsatisfied dependencies for type [PersistenceManager] with qualifiers
[@Any] at enter injection point [[field] @Inject @Any
com.mycompany.myproject.action.TestAction.persistenceManager]
PersistenceManager is an interface with a concrete class with a parameter (IdentitySesionImpl)
How can i Inject PersistenceManager?
What is the meaning of WELD-001408?
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定是否明白。您想使用 JPA 持久性管理器还是您自己创建的类?
如果它是 JPA 持久性管理器,则不必提供实现,只需在 persistence.xml 文件中配置 JPA。
如果是你的接口和类,我鼓励你更改它们的名称,因为它们很混乱。并且您应该检查您的实现是否是有效的 CDI Bean:没有构造函数的具体类,或者至少有一个没有参数的默认构造函数。
I'm not sure to understand. do you want to use JPA persistence Manager or is it a class you created by your own ?
If it's a JPA persistence manager, you don't have to provide an implementation but to configure JPA in persistence.xml file.
If it's you interface and class, I encourage you to change their names beacause they are quite confusing. And you should check if your implementation is a valid CDI Bean : concrete class with no constructor or at least a default constructor without parameters.