title: DefaultInstanceManager can not access a member of class with modifiers ""
body: <p>not sure whats wrong here, please assist.
  this is the exception :</p>
  
  <pre><code>SEVERE: Exception starting filter com.bannerplay.beans.LoginFilter
  java.lang.IllegalAccessException: Class org.apache.catalina.core.DefaultInstanceManager can not access a member of class com.bannerplay.beans.LoginFilter with modifiers ""
  at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
  at java.lang.Class.newInstance0(Unknown Source)
  at java.lang.Class.newInstance(Unknown Source)
  at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:134)
  at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:256)
  at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
  at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:103)
  at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
  at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
  at java.util.concurrent.FutureTask.run(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>login.xhtml</p>
  
  <pre><code>&lt;h:form&gt;
      Username : &lt;h:inputText value="#{loginBean.username}" /&gt;
      Password : &lt;h:inputSecret value="#{loginBean.password}" /&gt;
  &lt;h:commandButton value="Login" action="#{loginBean.checkLogin}" /&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>  &lt;filter&gt;
  &lt;filter-name&gt;LoginFilter&lt;/filter-name&gt;
  &lt;filter-class&gt;com.bannerplay.beans.LoginFilter&lt;/filter-class&gt;
    &lt;/filter&gt;
    &lt;filter-mapping&gt;
  &lt;filter-name&gt;LoginFilter&lt;/filter-name&gt;
  &lt;servlet-name&gt;FacesServlet&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/admin/*&lt;/url-pattern&gt;
    &lt;/filter-mapping&gt;
    &lt;welcome-file-list&gt;
       &lt;welcome-file&gt;/login.xhtml&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;servlet&gt;
         &lt;servlet-name&gt;FacesServlet&lt;/servlet-name&gt;
         &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
         &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
    ...
  </code></pre>
  
  <p>and LoginFilter.java</p>
  
  <pre><code>import java.io.IOException;
  import javax.servlet.Filter;
  import javax.servlet.FilterChain;
  import javax.servlet.FilterConfig;
  import javax.servlet.ServletException;
  import javax.servlet.ServletRequest;
  import javax.servlet.ServletResponse;
  import javax.servlet.annotation.WebFilter;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  
  
  @WebFilter("/admin/*")
  class LoginFilter implements Filter {
  @Override
  public void doFilter(ServletRequest request , ServletResponse response , FilterChain chain) throws ServletException, IOException {
      HttpSession session = ((HttpServletRequest) request).getSession();
      UserBean userBean = (UserBean) session.getAttribute("userBean");
      if (userBean != null) {
          User user = userBean.getUser();
          if (user == null) {
              ((HttpServletResponse) response).sendRedirect("/login.xhtml");
          } else
              chain.doFilter(request, response);
      } else
          ((HttpServletResponse) response).sendRedirect("/login.xhtml");
  }
  
  public void init(FilterConfig fc) {
  }
  
  public void destroy() {
  }
  }
  </code></pre>
  
  <p>I have no idea where this exception comes from,please shade some light on this issue. Thanks!</p>
  
  <p><strong>EDIT1:</strong> adding UserBean.java code :</p>
  
  <pre><code>import java.io.Serializable;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.SessionScoped;
  
  @ManagedBean
  @SessionScoped
  class UserBean implements Serializable {
  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  
  public User getUser() {
      return user;
  }
  
  public void setUser(User user) {
      this.user = user;
  }
  
  private User user;
  }
  </code></pre>
  
  <p>BTW,  SEVERE: Context [/projectName] startup failed due to previous errors</p>