title: Liferay 6.1 with Glassfish 3.1.2: IllegalStateException: Must call associate() before calling activate()
body: <p>I want to ask what is wrong with my code. I was having problems regarding <strong>IllegalStateException</strong> in my project. My set up is as follows:</p>
  
  <ul>
  <li>Netbeans 7.2.1 + JSF 2</li>
  <li>Liferay 6.1 GA2 bundled with Glassfish 3.1.2 </li>
  <li>Primefaces 3.5</li>
  </ul>
  
  <p>I use the 'Entity from Database' function to generate my entities.</p>
  
  <p>I have been trying to find the solution for this for a long time and I always get info about issues in jboss. But most posts are about 1 ~ 2 years old and some of them said that it was already resolved.</p>
  
  <p>Here are my codes:</p>
  
  <p><strong>PleaseBean.java</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>package please.bean;
  
  import java.io.Serializable;
  import java.util.List;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.ViewScoped;
  import javax.faces.model.DataModel;
  import javax.faces.model.ListDataModel;
  import please.model.CoopProspect;
  import please.util.CoopProspectFacade;
  
  
  @ManagedBean(name="pleaseBean")
  @ViewScoped
  public class PleaseBean implements Serializable {
      private static final long serialVersionUID = 1L;
      private CoopProspect prospect;
      private CoopProspect[] selectedProspects;
      private CoopProspect selectedProspect;
      private List&lt;CoopProspect&gt; prospectList;
      private List&lt;CoopProspect&gt; filteredProspect;
      private transient DataModel&lt;CoopProspect&gt; prospectModel;
      private CoopProspectFacade prospectFacade;
  
  
      public PleaseBean() {
          prospect = new CoopProspect();
          prospectList = prospectFacade.findAll();
          prospectModel = new ListDataModel&lt;CoopProspect&gt;(prospectList);
      }
  
      public String create() {
          prospectFacade.create(prospect);
          prospect = new CoopProspect();
          refreshList();
          return "";
      }
  
      public void editMode() {
          prospect = selectedProspect;
      }
  
      public void refreshList() {
          prospectList = prospectFacade.findAll();
          prospectModel = new ListDataModel&lt;CoopProspect&gt;(prospectList);
      }
  
  
      public void save() {
          editMode();
          prospectFacade.edit(prospect);
          prospect = new CoopProspect();
      }
  
      public void delete() {
          prospectFacade.remove(selectedProspects);
          refreshList();
      }
  
      public List&lt;CoopProspect&gt; getProspectList() {
          return prospectList;
      }
  
  
      public void setFilteredProspectList(List&lt;CoopProspect&gt; filteredProspect) {
          this.filteredProspect = filteredProspect;
      }
  
      public List&lt;CoopProspect&gt; getFilteredProspectList() {
          return filteredProspect;
      }
  
      public DataModel&lt;CoopProspect&gt; getProspectModel() {
          if (prospectModel == null) {
              prospectModel = new ListDataModel&lt;CoopProspect&gt;(prospectList);
          }
          return prospectModel;
      }
  
      public CoopProspect getProspect() {
          if (prospect == null) {
              prospect = new CoopProspect();
          }
          return prospect;
      }
  
      public CoopProspect[] getSelectedProspects() {
          return selectedProspects;
      }
  
      public void setSelectedProspects(CoopProspect[] selectedProspects) {
          this.selectedProspects = selectedProspects;
      }
  
      public CoopProspect getSelectedProspect() {
          if (selectedProspect == null) {
              selectedProspect = new CoopProspect();
          }
          return selectedProspect;
      }
  
      public void setSelectedProspect(CoopProspect selectedProspect) {
          this.selectedProspect = selectedProspect;
      }
  
  }
  </code></pre>
  
  <hr>
  
  <p><strong>AbstractFacade.java</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>/*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package please.util;
  
  import java.util.List;
  import javax.persistence.EntityManager;
  import javax.persistence.Query;
  import javax.persistence.criteria.CriteriaQuery;
  import javax.persistence.criteria.Root;
  
  /**
   *
   * @author mis
   */
  public abstract class AbstractFacade&lt;T&gt; {
      private Class&lt;T&gt; entityClass;
  
      public AbstractFacade(Class&lt;T&gt; entityClass) {
          this.entityClass = entityClass;
      }
  
      protected abstract EntityManager getEntityManager();
  
      public void create(T entity) {
          getEntityManager().persist(entity);
      }
  
      public void edit(T entity) {
          getEntityManager().merge(entity);
      }
  
      public void remove(T entity) {
          getEntityManager().remove(getEntityManager().merge(entity));
      }
  
      public boolean remove(T[] entities) {
          for(T entity: entities) {
              getEntityManager().remove(getEntityManager().merge(entity));
          }
          return true;
      }
  
      public T find(Object id) {
          return getEntityManager().find(entityClass, id);
      }
  
      public List&lt;T&gt; findAll() {
          CriteriaQuery cq =
                  getEntityManager().getCriteriaBuilder().createQuery();
          cq.select(cq.from(entityClass));
          return getEntityManager().createQuery(cq).getResultList();
      }
  
      public List&lt;T&gt; findRange(int[] range) {
          CriteriaQuery cq =
                  getEntityManager().getCriteriaBuilder().createQuery();
          cq.select(cq.from(entityClass));
          Query q = getEntityManager().createQuery(cq);
          q.setMaxResults(range[1] - range[0]);
          q.setFirstResult(range[0]);
          return q.getResultList();
      }
  
      public int count() {
          CriteriaQuery cq =
                  getEntityManager().getCriteriaBuilder().createQuery();
          Root&lt;T&gt; rt = cq.from(entityClass);
          cq.select(getEntityManager().getCriteriaBuilder().count(rt));
          Query q = getEntityManager().createQuery(cq);
          return ((Long) q.getSingleResult()).intValue();
      }
  }
  </code></pre>
  
  <hr>
  
  <p><strong>CoopProspectFacade.java</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>/*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package please.util;
  
  import javax.ejb.Stateless;
  import javax.persistence.EntityManager;
  import javax.persistence.PersistenceContext;
  import please.model.CoopProspect;
  
  @Stateless
  public class CoopProspectFacade extends AbstractFacade&lt;CoopProspect&gt; {
      @PersistenceContext(unitName = "please1PU")
      private EntityManager em;
  
      @Override
      protected EntityManager getEntityManager() {
          return em;
      }
  
      public CoopProspectFacade() {
          super(CoopProspect.class);
      }
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Index.xhtml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
  &lt;f:view xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:p="http://primefaces.org/ui"&gt;
      &lt;h:head/&gt;
      &lt;h:body&gt;
          &lt;h:form id="adform"&gt;
                  &lt;p:panelGrid styleClass="nameruna" &gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="datepros" value="Date: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:calendar id="datepros" value="#{pleaseBean.prospect.prosDate}" readonlyInput="true" required="true" pattern="MM/dd/yyyy"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel  for="fname" value="Firstname: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="fname" value="#{pleaseBean.prospect.firstName}" required="true" size="25" maxlength="25"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="mname" value="Middlename: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="mname" value="#{pleaseBean.prospect.middleName}" size="20" maxlength="20"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="lname" value="Lastname: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="lname" value="#{pleaseBean.prospect.lastName}" required="true" size="20" maxlength="20"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="gender" value="Gender: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:selectOneRadio id="gender" required="true" value="#{pleaseBean.prospect.gender}"&gt;
                                  &lt;f:selectItem itemLabel="Male" itemValue="M"/&gt;
                                  &lt;f:selectItem itemLabel="Female" itemValue="F"/&gt;
                              &lt;/p:selectOneRadio&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="bday" value="Date of birth: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:calendar id="bday" 
                                          value="#{pleaseBean.prospect.birthdate}" 
                                          navigator="true" 
                                          readonlyInput="true" 
                                          pattern="MM/dd/yyyy" 
                                          yearRange="c-100:c+0"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="cntno" value="Contact number: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="cntno" value="#{pleaseBean.prospect.contactNumber}" size="12" maxlength="12"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="los" value="Length of stay is two years? "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:selectBooleanCheckbox id="los" value="#{pleaseBean.prospect.lengthOfStay}"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="natl" value="Nationality: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="natl" value="#{pleaseBean.prospect.nationality}" required="true" size="8" maxlength="8"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="orgu" value="Organizational Unit: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:selectOneMenu id="orgu" required="true" value="#{pleaseBean.prospect.ouCode}"&gt;
                                  &lt;f:selectItem itemLabel="PT01" itemValue="PT01"/&gt;
                              &lt;/p:selectOneMenu&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;h2&gt;
                              &lt;h:outputText value="ADDRESS"/&gt;
                              &lt;/h2&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="street" value="Street/Phase: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="street" value="#{pleaseBean.prospect.street}" size="60" maxlength="60"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="bgy" value="Barangay: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="bgy" value="#{pleaseBean.prospect.barangay}" size="50" maxlength="50"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="city" value="City/Municipality: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="city" value="#{pleaseBean.prospect.cityMun}" size="50" maxlength="50"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="regn" value="Region: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="regn" value="#{pleaseBean.prospect.region}" size="50" maxlength="50"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:outputLabel for="provnc" value="Province: "/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;p:inputText id="provnc" value="#{pleaseBean.prospect.province}" size="50" maxlength="50"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                      &lt;p:row&gt;
                          &lt;p:column&gt;
                              &lt;p:commandButton actionListener="#{pleaseBean.create}"
                                               value="Submit"
                                               onclick="adform.reset()"
                              /&gt;
                          &lt;/p:column&gt;
                      &lt;/p:row&gt;
                  &lt;/p:panelGrid&gt;
              &lt;/h:form&gt;
      &lt;/h:body&gt;
  &lt;/f:view&gt;
  </code></pre>
  
  <hr>
  
  <p>Stack Trace</p>
  
  <pre class="lang-default prettyprint-override"><code>2013-03-07T06:11:31.122+0000|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=177;_ThreadName=Thread-2;|ApplicationDispatcher[/please1-portlet] PWC1231: Servlet.service() for servlet please1 Servlet threw exception
  javax.portlet.faces.BridgeException: java.lang.IllegalStateException: Must call associate() before calling activate()
      at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:193)
      at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:85)
      at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:112)
      at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:255)
      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
      at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:204)
      at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
      at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
      at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
      at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:111)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:807)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:671)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:626)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:556)
      at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:534)
      at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:607)
      at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:359)
      at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1174)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:807)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:671)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:626)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:556)
      at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:53)
      at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
      at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
      at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:5158)
      at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:5116)
      at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1557)
      at com.liferay.portal.action.RenderPortletAction.execute(RenderPortletAction.java:92)
      at com.liferay.portal.action.UpdateLayoutAction.addPortlet(UpdateLayoutAction.java:334)
      at com.liferay.portal.action.UpdateLayoutAction.getJSON(UpdateLayoutAction.java:287)
      at com.liferay.portal.struts.JSONAction.execute(JSONAction.java:75)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:176)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
      at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:560)
      at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:335)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
      at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:216)
      at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
      at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: java.lang.IllegalStateException: Must call associate() before calling activate()
      at org.jboss.weld.context.AbstractConversationContext.activate(AbstractConversationContext.java:200)
      at org.jboss.weld.jsf.WeldPhaseListener.activateConversations(WeldPhaseListener.java:108)
      at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:85)
      at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at com.liferay.faces.bridge.lifecycle.LifecycleWrapper.execute(LifecycleWrapper.java:35)
      at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:185)
      ... 138 more
  </code></pre>
  
  <hr>
  
  <p>Can anyone help me?</p>
  
  <p>Note: This is NOT a good coding example and must not be emulated by anyone.</p>