1

次のようなダイアログを表示するリンクがあります。

<h:form>
    <div class="btn-alt" id="#signupStart">
        <h:commandLink action="#{signUpBean.displaySignUpScreenAction()}">#{msg['action.createaccount']}
        <f:ajax onevent="function(data) {if (data.status == 'success') {$('#signUpDialog').dialog('open');startGA();} }"  render=":signupform"/>
        </h:commandLink>
    </div>
</h:form>

<h:form id="signupform" title="#{msg['action.createaccount']}"><input type="hidden" autofocus="autofocus" />

    <div style="position: relative;">                       
        <h:inputText maxlength="50" id="txtFirstName" placeholder="#{msg['firstname']}" value="#{signUpBean.user.firstName}" styleClass="#{component.valid?'':'field-error'}" title="#{msg['firstname']}">
            <f:ajax event="blur" render="txtFirstName messages"/>                       
        </h:inputText>
    </div>

</h:form>

SignupBean:ビュー スコープです

public void displaySignUpScreenAction() {
        if (log.isDebugEnabled()) {
            log.debug("@displaySignUpScreenAction");
        }

        setCompany(new Company());
        setUser(new User());

    }

ダイアログの表示リンクをクリックすると、ユーザーオブジェクトを作成してからダイアログをレンダリングするため、バインディングは正常に動作するはずですが、実際には正常に動作しますが、運用サーバーではログに次のようなエラーが表示されることがあります。

value="#{signUpBean.user.firstName}": Target Unreachable, 'user' returned null] with root cause 
Jun 09 17:04:03 myapp i-e38b9c8c: javax.el.PropertyNotFoundException: Target Unreachable, 'user' returned null 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.el.parser.AstValue.getTarget(AstValue.java:147) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.el.parser.AstValue.getType(AstValue.java:81) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:171) 
Jun 09 17:04:03 myapp i-e38b9c8c: at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:98) 
Jun 09 17:04:03 myapp i-e38b9c8c: at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1046) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIInput.validate(UIInput.java:976) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIInput.executeValidate(UIInput.java:1249) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIInput.processValidators(UIInput.java:712) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIForm.processValidators(UIForm.java:253) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195) 
Jun 09 17:04:03 myapp i-e38b9c8c: at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76) 
Jun 09 17:04:03 myapp i-e38b9c8c: at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) 
Jun 09 17:04:03 myapp i-e38b9c8c: at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) 
Jun 09 17:04:03 myapp i-e38b9c8c: at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) 
Jun 09 17:04:03 myapp i-e38b9c8c: at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) 
Less

私は JSF 2.2 を使用しています。このエラーが時々発生する理由と解決方法を教えてください。

4

0 に答える 0