Wyjątek javax.el.PropertyNotFoundException

0

Cześć, próbuję dodać do apki stronę na której można przejrzeć i wydrukować raport. Po uruchomieniu tego pola w GUI zostaje wyrzucony wyjątek javax.faces.FacesException: javax.el.PropertyNotFoundException: The class 'reports.view.pos.test.PosTestUIBean' does not have the property 'tPageHeader'. Teoretycznie można wywnioskować, że coś jest nie tak z setterami i getterami, ale wyglądają w porządku. Dalej sprawdziłem może literówka w <fw:label sid="tPageHeader" binding="#{posTestUIBean.tPageHeader}" ale też wygląda w porządku. Na tą chwilę nie mam pomysłu gdzie mogę szukać tego błędu. Dodam, że niestety używam IDE JDeveloper, (którego nie lubię ) i zacząłem się zastanawiać, ze to może IDE wprowadza mnie w błąd i problem leży zupełnie gdzie indziej. Jeśli ktoś miał podobny przypadek to proszę o jakąś wskazówkę. Może ktoś bardziej doświadczony ode mnie od razu wychwyci mój błąd :)


public class PosTestUIBean extends AbstractReportUIBean {
    
    
    
    private ISectionHeader tSearchCriteriaSH = createComponent(ISectionHeader.class);
    private IComboBoxDefault tIdentifierType = createComponent(IComboBoxDefault.class);
    private ITextFieldString tIdentifier = createComponent(ITextFieldString.class);
    private IButton tSearchBtn = createComponent(IButton.class);
    private IButton tDownloadBtn = createComponent(IButton.class);
    private ISectionHeader tResultSH = createComponent(ISectionHeader.class);
    private ITextFieldString tResultTestName = createComponent(ITextFieldString.class);
    private ITextFieldString tResultTestNip = createComponent(ITextFieldString.class);
    private ITextFieldString tResulTestNumber = createComponent(ITextFieldString.class);
    private IPanelTable tResultContentTable = createComponent(IPanelTable.class);
    private ILabel tPageHeader = createComponent(ILabel.class);
    
    public PosTestUIBean(){
        super();
    }
    
    public void doSetUp() throws RecoverableException {
        super.doSetUp();
        setComboBox(tIdentifierType, "TIDENTTYPE");
        tResultContentTable.setTableDescriptorID("M_POS_TEST");
        tResultContentTable.hideActionBar();
        getSecurityManager().setMandatory(tIdentifierType, true);
        getSecurityManager().setMandatory(tIdentifier, true);

        getSecurityManager().setVisible(tResultSH, false);

        getSecurityManager().setEnabled(tResulTestNumber, false);
        getSecurityManager().setEnabled(tResultTestName, false);
        getSecurityManager().setEnabled(tResultTestNip, false);

        tResultSH.setCollapsedByUser(false);
        tSearchCriteriaSH.setCollapsedByUser(false);

        adWaitPageToBtn(tSearchBtn);
       
    }
    
    private IUIDataObjectList<TestTO> searchtData() {
        String identifireType = tIdentifierType.getSelectedCode();
        String identifire = tIdentifier.getString();
        String userName = getUserName();
        IUIDataObjectList<TestTO> testTOList = getReportDao().getTestTO(identifireType, identifire,  userName);

        return testTOList;
    }
    
    protected IReportExport prepareDownload() {
        IReportExport rExport = null;
        IUIDataObjectList<TestTO> testTOList = 
        getTableData(tResultContentTable,TestTO.class);
    
        if (testTOList != null && 
            !testTOList.isEmpty()) {

            TestTO result = testTOList.get(0);
            ReportContent rContent = new ReportContent();
            ReportWrapper.setReportParameters(rContent, result);
            ReportWrapper.addReportFields(rContent, testTOList);
            rExport = ReportFactory.getInstance().create(rContent, ReportFiles.POS_TEST);
        }
        return rExport;
    }
    protected void clearSearchData() {
        getSecurityManager().setVisible(tResultSH, false);
        tResultTestName.setString("");
        tResulTestNumber.setString("");
        tResultTestNip.setString("");
        tResultContentTable.clearData();
    }

    public void search() {
        IUIDataObjectList<TestTO> testTOList = 
            searchtData();
        if (testTOList != null && 
            !testTOList.isEmpty()) {
            getSecurityManager().setVisible(tResultSH, true);
            TestTO to = testTOList.get(0);
            tResultTestName.setString(to.getTest3());
            tResulTestNumber.setString(to.getTest1());
            tResultTestNip.setString(to.getTest2());

            tResultContentTable.loadData(testTOList);
        } else {
            clearSearchData();
            showNotFoundResultMessasge();
        }

    }
    public void setSecurity() {
        ApplicationSecurityContext l_appSecurityContext = 
            new SecurityDataLoader().getApplnSecurityContext(null);
        setSecurityData("test", l_appSecurityContext);
    }

    protected void setDefaultLabels() {
        
        
       
        tSearchCriteriaSH.setLabel("Wyszukaj");
        tIdentifierType.setLabel("Wyszukaj po");
        tIdentifier.setLabel("Identyfikator");
        tSearchBtn.setLabel("Wyszukaj");
        tDownloadBtn.setLabel("Pobierz PDF");
        tResultSH.setLabel("Wyniki");
        tResultTestName.setLabel("Nazwa dostawcy");
        tResultTestNip.setLabel("NIP dostawcy");
        tResulTestNumber.setLabel("Numer dostawcy");
        tResultContentTable.setListTitle("Informacje o dostawcy");
        tPageHeader.setLabel("POS TEST");
        
    }
    protected String getTOName() {
        return null;
    }


    public void setTPageHeader(ILabel tPageHeader) {
        this.tPageHeader = tPageHeader;
    }

    public ILabel getTPageHeader() {
        return tPageHeader;
    }

    public void setTSearchCriteriaSH(ISectionHeader tSearchCriteriaSH) {
        this.tSearchCriteriaSH = tSearchCriteriaSH;
    }

    public ISectionHeader getTSearchCriteriaSH() {
        return tSearchCriteriaSH;
    }

    public void setTIdentifierType(IComboBoxDefault tIdentifierType) {
        this.tIdentifierType = tIdentifierType;
    }

    public IComboBoxDefault getTIdentifierType() {
        return tIdentifierType;
    }

    public void setTIdentifier(ITextFieldString tIdentifier) {
        this.tIdentifier = tIdentifier;
    }

    public ITextFieldString getTIdentifier() {
        return tIdentifier;
    }

    public void setTSearchBtn(IButton tSearchBtn) {
        this.tSearchBtn = tSearchBtn;
    }

    public IButton getTSearchBtn() {
        return tSearchBtn;
    }

    public void setTDownloadBtn(IButton tDownloadBtn) {
        this.tDownloadBtn = tDownloadBtn;
    }

    public IButton getTDownloadBtn() {
        return tDownloadBtn;
    }

    public void setTResultSH(ISectionHeader tResultSH) {
        this.tResultSH = tResultSH;
    }

    public ISectionHeader getTResultSH() {
        return tResultSH;
    }

    public void setTResultTestName(ITextFieldString tResultTestName) {
        this.tResultTestName = tResultTestName;
    }

    public ITextFieldString getTResultTestName() {
        return tResultTestName;
    }

    public void setTResultTestNip(ITextFieldString tResultTestNip) {
        this.tResultTestNip = tResultTestNip;
    }

    public ITextFieldString getTResultTestNip() {
        return tResultTestNip;
    }

    public void setTResulTestNumber(ITextFieldString tResulTestNumber) {
        this.tResulTestNumber = tResulTestNumber;
    }

    public ITextFieldString getTResulTestNumber() {
        return tResulTestNumber;
    }

    public void setTResultContentTable(IPanelTable tResultContentTable) {
        this.tResultContentTable = tResultContentTable;
    }

    public IPanelTable getTResultContentTable() {
        return tResultContentTable;
    }

    protected String getPageTitle() {
        return tPageHeader.getLabel();
    }
}
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
          xmlns:tiles="http://tiles.apache.org/tags-tiles"
          xmlns:trh="http://myfaces.apache.org/trinidad/html"
          xmlns:fw="http://java.sun.com/jsf/core">
 <f:verbatim>
  <![CDATA[
    <script language="javascript" type="text/javascript">
		function openLink( p_url ) {
			if ( processNavigation ) {
                processNavigation( p_url );
            } else {
                window.location.href = p_url;
            }
		}
	</script>
    ]]>
 </f:verbatim>
 <fw:panelGroup sid="tHeaderPG" layout="horizontal"
                inlineStyle="background-color:White;padding:5px;">
  <fw:image sid="tImageHeader" source="/images/magicianTest.png"/>
  <fw:label sid="tPageHeader" binding="#{posTestUIBean.tPageHeader}"
            inlineStyle="font-size:15px;font-weight:bold;"/>
 </fw:panelGroup>
 <fw:sectionHeader sid="tSearchCriteriaSH"
                   binding="#{posTestUIBean.tSearchCriteriaSH}">
  <center>
   <fw:panel sid="tReport" rows="3" maxColumns="2">
    <fw:comboBoxDefault sid="tIdentifierType"
                        binding="#{posTestUIBean.tIdentifierType}"/>
    <fw:textFieldString sid="tIdentifier"
                        binding="#{posTestUIBean.tIdentifier}"/>
    <fw:panelGroup sid="tReport" layout="horizontal">
     <fw:button sid="tSearchBtn"
                binding="#{posTestUIBean.tSearchBtn}"
                action="#{posTestUIBean.search}"/>
    </fw:panelGroup>
   </fw:panel>
  </center>
 </fw:sectionHeader>
 <fw:spacer sid="spacer1" height="5"/>
 <fw:sectionHeader sid="tResultSH"
                   binding="#{posTestUIBean.tResultSH}">
  <fw:button sid="tDownloadBtn"
             binding="#{posTestUIBean.tDownloadBtn}"
             action="#{posTestUIBean.download}"/>
  <fw:panel sid="tReport" rows="3" maxColumns="2">
   <fw:textFieldString sid="tResultTestName"
                       binding="#{posTestUIBean.tResultTestName}"/>
   <fw:textFieldString sid="tResultTestNip"
                       binding="#{posTestUIBean.tResultTestNip}"/>
   <fw:textFieldString sid="tResulTestNumber"
                       binding="#{posTestUIBean.tResulTestNumber}"/>
  </fw:panel>
  <fw:panelTable sid="tResultContentTable"
                 binding="#{posTestUIBean.tResultContentTable}"
                 inlineStyle="width:98%; margin:5px; height:300px;"/>
 </fw:sectionHeader>
</jsp:root>
 
0

Ciekawy problem. IMO wszystko wyglądało OK - zmusiłeś mnie do spojrzenia w specyfikacji :)

Nie do końca jestem pewien, ale:
"However to support the occasional use of all upper-case names, we check if the first two characters of the name are both upper case and if so leave it alone.".

Dlatego:
getTPageHeader może być interpretowany jako getTPAGEHEADER. Ewentualnie ta pierwsza mała litera może robić problemy - spróbuj zmienić nazwę na jakąś normalniejszą.

Swoją drogą to skąd użycie takich nazw w stylu "tPageHeader"?

0

Właśnie wypiłem poranną kawkę i zrobiłem refactor. Na wstepię wygląda obiecującą ponieważ wyrzuciło wyjątek "does not have the property 'tSearchCriteriaSH' ", co wróży, że błąd był w tej małej przebigłej literce 't'. Zrobię refactor reszty i dam znać czy się udało.
Użycie nazw tPageHeader "PageHeader" to oczywiście nagłówek strony a literka t to chwilowa nazwa na niegotowe pole (testowe).Poźniej jak wszytsko działa zmieniam ją na konkretną nazwę jakiegoś raportu np. "Client Contracts List" to cclPageHeader. Jeśli się uda to od dziś będę używał przedrostka np. "tralalala". Używałem 't' z czystego lenistwa. Kiedyś czytałem, że cecha dobrego programisty to lenistwo :)

0

Wszystko bangla, wielkie dzięki za pomoc, czasem dopada człowieka taki impas gdzie teoretycznie wszystko jest dobrze a i tak wywala :)

0

Fajnie, że zadziałało.

Co do lenistwa - to prawda. Dlatego mamy rozbudowane IDE, żeby korzystać z długich nazw zmiennych i nie musieć każdorazowo ich wklepywać.

1 użytkowników online, w tym zalogowanych: 0, gości: 1