【发布时间】:2014-09-29 09:57:12
【问题描述】:
我正在处理接缝并尝试通过使用来注入接缝组件
@Name("myBeanClass")
@Scope(ScopeType.CONVERSATION)
public class MyBeanClass {
start();
}
并尝试通过使用下面来自另一个类的代码来使用上面的start()
@In(create = true, required = false, value = "myBeanClass")
protected MyBeanClass myBeanClass
public Class TestClass {
public void start() {
myBeanClass.start();
}
}
我什至尝试将MyBeanClass 中的范围类型更改为 sesson 等,但它仍然给我同样的感觉
12:34:43,233 WARN [org.jboss.seam.Component] [http-localhost%2F127.0.0.1-8080-2] Cannot create Seam component, scope is not active: favoriteManager(PAGE)
12:34:43,240 WARN [org.jboss.seam.Component] [http-localhost%2F127.0.0.1-8080-2] Cannot create Seam component, scope is not active: favoriteManager(PAGE)
12:34:53,081 ERROR [org.jboss.aspects.tx.TxPolicy] [http-localhost%2F127.0.0.1-8080-2] javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: myBeanClass.favoriteManager
12:34:53,093 ERROR [STDERR] [http-localhost%2F127.0.0.1-8080-2]
javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: orgUnitUpdateManager.favoriteManager
12:34:53,094 ERROR [STDERR] [http-localhost%2F127.0.0.1-8080-2] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:115)
12:34:53,094 ERROR [STDERR] [http-localhost%2F127.0.0.1-8080-2] at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
12:34:53,094 ERROR [STDERR] [http-localhost%2F127.0.0.1-8080-2] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
12:34:53,140 ERROR [STDERR] [http-localhost%2F127.0.0.1-8080-2] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
12:34:53,140 ERROR [STDERR] [http-localhost%2F127.0.0.1-8080-2] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
12:34:53,140 ERROR [STDERR] [http-localhost%2F127.0.0.1-8080-2] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
12:34:53,140 ERROR [STDERR] [http-localhost%2F127.0.0.1-8080-2] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
而且我还可以从同一类中注入其他类,并且只有在注入 myBeanClass 的情况下才会失败
如果我遗漏了什么,有人可以建议吗?
而且我确定 bean 名称和变量名称是相同的
【问题讨论】:
标签: seam