Arquillian Testcases for Seam 3 @ConversationScoped class
bjoice1 Feb 22, 2012 12:23 AMArquillian Testcases for Seam 3 @ConversationScoped class fails if it has the following.
@Inject
private Conversation conversation;
is present in the class. If all these are removed the testcases work.
@PostConstruct
public void init() {
if (conversation.isTransient()) {
conversation.begin();
}
}
@Remove
public void destroy() {
log.debug("destroy()");
if (!conversation.isTransient()) {
conversation.end();
}
}
Please suggest a solution for the same.
error :
Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type @ConversationScoped
at org.jboss.weld.conversation.ConversationImpl.checkConversationActive(ConversationImpl.java:79)
at org.jboss.weld.conversation.ConversationImpl.isTransient(ConversationImpl.java:234)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:304)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:298)
at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:113)
at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
at org.jboss.weld.conversation.ConversationImpl_$$_javassist_98.isTransient(ConversationImpl_$$_javassist_98.java)
at com.corelogic.terradactyl.ejb.customer.CustomerAction.init(CustomerAction.java:418)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1006)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:61)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:390)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:373)
at com.sun.ejb.containers.StatefulSessionContainer.afterInstanceCreation(StatefulSessionContainer.java:742)
... 83 more
Feb 22, 2012 9:51:55 AM org.hibernate.impl.SessionFactoryImpl close
INFO: closing
classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@e1f52a
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 313.614 sec <<< FAILURE!
Thanks.