I have a UserService that fails with ClassNotFound when using ViewScoped but works with SessionScoped and I'm hoping someone can tell me why. My application mixes JSF2 with Spring.
The error I get is:
java.lang.ClassNotFoundException: com.dave.user.service.IUserService
The managed bean is
@ManagedBean(name="ClientMB")
@ViewScoped
public class ClientMB implements Serializable{
@ManagedProperty(value="#{UserService}")
IUserService userService;
public IUserService getUserService() {
return userService;
}
public void setUserService(IUserService userService) {
this.userService = userService;
}
The UserService is defined as
public class UserService implements Serializable, IUserService {
// UserDAO is injected...
IUserDAO userDAO;
}
The IUserService is just an interface:
public interface IUserService {
The declaration in ApplicationContext is
<bean id="UserService" class="com.dave.user.service.UserService">
<property name="userDAO" ref="UserDAO" />
</bean>
As I said, this works fine using SessionScoped, but fails when I change the managed bean to ViewScoped.