Hi Alexandr! Do you like to use @ViewScoped in a CDI way or JSF way?
Let me explain: Initially javax.faces.bean.ViewScoped was _not_ a native CDI scope but one from the JSF container. (For JSF Managed Beans you would also need the @ManagedBean annotation. For now I assume that's not what you want but like to get those beans managed by CDI instead) For CDI: We re-used the annotation from JSF and provide an own CDI Context implementation for it. To activate this context you will also need to add the following two deltaspike dependencies: * deltaspike-jsf-module-api * deltaspike-jsf-module-impl Do you have those in your WAR/EAR already? LieGrue, strub > On Thursday, 23 October 2014, 14:30, Alexandr Denisenko > <[email protected]> wrote: > > Hello! I was very sorry, but we have a problem when using Deltaspike. In > > our > project, we decided to go out on the EJB to CDI, for easier testing. We are > using JSF 2.0 and most beans we javax.faces.bean.ViewScoped. We plugged > deltaspike-test-control-module-api and if you use standard Cdi Scoped > everything > is fine, but as soon as we include deltaspike-jsf-module-api and use > ViewScoped > tests are not carried out because of this error: "javax.enterprise.context > .ContextNotActiveException: WebBeans context with scope type > annotationViewScoped does not exist within current thread ". The error > occurs because FacesContext = null. Is there a way to get around this problem > by > using standard solutions? > > Confidentiality of content: This transmission contains information which may > be > confidential and/or privileged. The information is intended to be for the > exclusive use of the planned recipient. If you are not the intended > recipient, > be advised that any disclosure, copying, distribution or other use of this > information is strictly prohibited. If you have received this transmission in > error, please notify the sender immediately. >
