1 Reply Latest reply on Mar 2, 2011 4:49 AM by Martin Frey

    Target unreacheble problem..

    dhanaraja rajendiran Newbie
      HI i am getting Target unreacheble problem as follows....

      javax.el.PropertyNotFoundException: /officeManagement/inventory/addOrEditStock.jsp @30,54 value="#{stocksAction.admItem.name}": Target Unreachable, 'admItem' returned null on 'com.sec.ezeeAdmin.officeManagement.StockAction_$$_javassist_seam_19'
           at com.sun.facelets.el.TagValueExpression.getType(TagValueExpression.java:62)
           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:92)
           at javax.faces.component.UIInput.getConvertedValue(UIInput.java:942)
           at javax.faces.component.UIInput.validate(UIInput.java:868)
           at javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
           at javax.faces.component.UIInput.processValidators(UIInput.java:672)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
           at org.richfaces.component.UISwitchablePanel.processValidators(UISwitchablePanel.java:225)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
           at javax.faces.component.UIForm.processValidators(UIForm.java:235)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
           at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
           at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
           at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
           at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)


      And This is my action class-->>

      package com.sec.ezeeAdmin.officeManagement;

      import java.util.ArrayList;
      import java.util.Date;
      import java.util.HashMap;
      import java.util.Iterator;
      import java.util.List;
      import java.util.Map;

      import javax.persistence.EntityManager;

      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.AutoCreate;
      import org.jboss.seam.annotations.Begin;
      import org.jboss.seam.annotations.FlushModeType;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Out;
      import org.jboss.seam.annotations.Scope;
      import com.sec.ezeeAdmin.User;
      import com.sec.ezeeAdmin.configure.AdmOffices;
      import com.sec.ezeeAdmin.service.StockService;

      @Name("stocksAction")
      @Scope(ScopeType.CONVERSATION)
      public class StockAction {
           @In(create= true)
           EntityManager entityManager;
           
           @In
           User user;
           private Date date=new Date();
           
           
           
           private AdmItems admItem ;
           private int recordsPerPage=10;
           private String defaultTab = "general";
           private List<AdmItems> itemsList;
           Map<AdmOffices, Boolean> officesForRequest;
           public Map<AdmOffices, Boolean> getOfficesForRequest() {
                return officesForRequest;
           }

           public void setOfficesForRequest(Map<AdmOffices, Boolean> officesForRequest) {
                this.officesForRequest = officesForRequest;
           }

           public List<AdmItems> getItemsList() {
                return itemsList;
           }

           public void setItemsList(List<AdmItems> itemsList) {
                this.itemsList = itemsList;
           }

           public String getDefaultTab() {
                return defaultTab;
           }

           public void setDefaultTab(String defaultTab) {
                this.defaultTab = defaultTab;
           }

           public int getRecordsPerPage() {
                return recordsPerPage;
           }

           public void setRecordsPerPage(int recordsPerPage) {
                this.recordsPerPage = recordsPerPage;
           }

           public AdmItems getAdmItem() {
                return admItem;
           }

           public void setAdmItem(AdmItems admItem) {
                this.admItem = admItem;
           }
           
           public List<AdmItems> retrieveStockList()
           {
                StockService ss=new StockService(entityManager);
                return ss.retrieveStockList();
           }
           public void activeDeactive(AdmItems stocks) {          
                
                entityManager.flush();
           }
           
           
           public String editStocks(AdmItems stocks){
                System.out.println("i am in the edit");
                this.admItem=stocks;
                this.defaultTab = "general";
                //this.admItem = stocks;
                //this.admItem.setStartdate(date);
                this.selectItems(stocks);
                
                return "add-edit-stocks";
           }
           
           
           public void selectItems(AdmItems item) {
                this.itemsList = null;
                this.admItem=item;
                this.officesForRequest = new HashMap<AdmOffices, Boolean>();
                for(AdmOffices office:this.retrieveOffices() ) {
                     if(this.admItem.getOffices()!= null){
                          System.out.println("not null"+admItem.getOffices());
                          if(hasStockInList(this.admItem.getOffices(), office.getId())) {
                               officesForRequest.put(office, true);
                          } else {
                               officesForRequest.put(office, false);
                          }
                     }
                     else{
                          officesForRequest.put(office, false);
                     }
                     
                }
           }
           
           public List<AdmOffices> retrieveOffices(){
                StockService ss= new StockService(entityManager);
                System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"+ss.retrieveOffices().size());
                return ss.retrieveOffices();
           }
           
           public boolean hasStockInList(List<AdmOffices> list , long id){
                System.out.println("i am in the has stock list");
                for(AdmOffices office : list){
                     if(office.getId() == id){
                          return true;
                     }
                }
                return false;
           }
           
           @Begin(nested = true , flushMode = FlushModeType.MANUAL)
           public String addI(){
                this.admItem= new AdmItems();
                System.out.println("i am in the ljdslfkjasldf");
                this.defaultTab = "general";
                this.selectItems(admItem);
                return "add-edit-stocks";
           }
           
           public void confirmStocks(){
                 System.out.println("inside confirm mekjhasdfkjh");
                     this.confirmOffices();

                     if(this.admItem.getId() == 0){
                          this.admItem.setCreatedUser(user.getUsername());                     
                          this.admItem.setCreatedDate(date);     
                          entityManager.persist(this.admItem);
                     }
                     else {
                               this.admItem.setModifiedDate(date);
                               this.admItem.setModifiedUser(this.user.getUsername());
                               entityManager.merge(this.admItem);
                     }
                     entityManager.flush();
           }
           
           public void confirmOffices() {
                List<AdmOffices> selectedList = new ArrayList<AdmOffices>();
                Iterator<AdmOffices> iter = this.officesForRequest.keySet().iterator();
                while(iter.hasNext()) {
                     AdmOffices office = iter.next();
                     if(this.officesForRequest.get(office).equals(true)) {
                          selectedList.add(office);
                     }
                }
                this.admItem.setOffices(selectedList);
           }
           public String can_button()
             {
                  return "stockspage";
             }

           public User getUser() {
                return user;
           }

           public void setUser(User user) {
                this.user = user;
           }

           public Date getDate() {
                return date;
           }

           public void setDate(Date date) {
                this.date = date;
           }
      }


      In the above class i declared my pojo like this private AdmItems admItem ;

      In console it is showing that-->>javax.el.PropertyNotFoundException: /officeManagement/inventory/addOrEditStock.jsp @30,54 value="#{stocksAction.admItem.name}": Target Unreachable, 'admItem' returned null on 'com.sec.ezeeAdmin.officeManagement.StockAction_$$_javassist_seam_19'


      Please help me out from this problem !!!!!!!!!!!!!!