2

尝试使用 webflow 时,我不断收到以下错误:

{
    "failure":"true",
    "exception.message":"org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.springframework.webflow.action.ViewFactoryActionAdapter@200a5beb in state 'accountCannotLogInView' of flow 'login' -- action execution attributes were 'map[[empty]]'",
    "exception.stacktrace":"org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.springframework.webflow.action.ViewFactoryActionAdapter@200a5beb in state 'accountCannotLogInView' of flow 'login' -- action execution attributes were 'map[[empty]]'
    ...
    Caused by: java.lang.IllegalStateException: Exception occurred rendering view null
        at org.springframework.webflow.mvc.view.AbstractMvcView.render(AbstractMvcView.java:191)
        at org.springframework.webflow.action.ViewFactoryActionAdapter.doExecute(ViewFactoryActionAdapter.java:40)
        at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)
        at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)
        ... 66 more
    Caused by: java.lang.NullPointerException
        at org.springframework.webflow.mvc.servlet.ServletMvcView.doRender(ServletMvcView.java:50)
        at org.springframework.webflow.mvc.view.AbstractMvcView.render(AbstractMvcView.java:187)
        ... 69 more
    "
}

有谁知道这可能是什么原因?从我的登录 webflow.xml:

<action-state id="checkAccountType">
    <evaluate expression="lookupAccountTypeAction.lookup(flowScope.principal)" />
    <transition on="EMAIL" to="accountCannotLogInView" />
    <transition on="Login" to="checkAccountStatus" />
    <transition on="CONTACT" to="accountCannotLogInView" />
</action-state>

<end-state id="accountCannotLogInView" view="myAccountCannotLogInView"/>

从 default_views.properties:

myAccountCannotLogInView.(class)=org.springframework.web.servlet.view.JstlView
myAccountCannotLogInView.url=/WEB-INF/view/jsp/default/ui/myAccountCannotLogInView.jsp

从我的日志文件中:

2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.engine.EndState] - Entering state 'accountCannotLogInView' of flow 'login'
2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.execution.ActionExecutor] - Executing org.springframework.webflow.action.ViewFactoryActionAdapter@359d136a
2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.mvc.view.AbstractMvcView] - Rendering MVC [null] with model map [{flowRequestContext=[RequestControlContextImpl@55bf756b externalContext = org.springframework.webflow.mvc.servlet.MvcExternalContext@2bb4d74, currentEvent = EMAIL, requestScope = map['ticketGrantingTicketId' -> 'TGT-1-GxALVR7PEtbagbnRlStOTbHoRHlb61YVm1m2hvWx3pgWCEXgPb-cas01.example.org'], attributes = map[[empty]], messageContext = [DefaultMessageContext@cb5efc8 sourceMessages = map[[null] -> list[[empty]]]], flowExecution = [FlowExecutionImpl@3f5c0d33 flow = 'login', flowSessions = list[[FlowSessionImpl@419d87bc flow = 'login', state = 'accountCannotLogInView', scope = map['principal' -> sso_test_user, 'userInfoBean' -> com.mycompany.authentication.UserInfoBean@54394557[username=<null>,firstName=<null>,lastName=<null>,emailAddress=<null>,streetAddress=<null>,city=<null>,state=<null>,zip=<null>,country=<null>], 'changePasswordBean' -> com.mycompany.authentication.ChangePasswordBean(username=null, newPassword=null, confirmNewPassword=null), 'service' -> https://my.server.com:443/casauth/facade/norenew?idp=https://my.server.com/idp/externalAuthnCallback, 'credentials' -> [username: sso_test_user], 'warnCookieValue' -> false, 'ticketGrantingTicketId' -> 'TGT-1-GxALVR7PEtbagbnRlStOTbHoRHlb61YVm1m2hvWx3pgWCEXgPb-cas01.example.org']]]]], flashScope=map[[empty]], principal=sso_test_user, currentUser=null, userInfoBean=com.mycompany.authentication.UserInfoBean@54394557[username=<null>,firstName=<null>,lastName=<null>,emailAddress=<null>,streetAddress=<null>,city=<null>,state=<null>,zip=<null>,country=<null>], changePasswordBean=com.mycompany.authentication.ChangePasswordBean(username=null, newPassword=null, confirmNewPassword=null), service=https://my.server.com:443/casauth/facade/norenew?idp=https://my.server.com/idp/externalAuthnCallback, credentials=[username: sso_test_user], flowExecutionKey=e1s1, warnCookieValue=false, flowExecutionUrl=/authentication/login?username=%5BLjava.lang.String%3B%405b65afa5&submit=%5BLjava.lang.String%3B%4070eea883&_eventId=%5BLjava.lang.String%3B%4044796a61&service=%5BLjava.lang.String%3B%407f372965&lt=%5BLjava.lang.String%3B%407e7ee722&password=%5BLjava.lang.String%3B%403d78aa0f&execution=%5BLjava.lang.String%3B%403ce4de50, ticketGrantingTicketId=TGT-1-GxALVR7PEtbagbnRlStOTbHoRHlb61YVm1m2hvWx3pgWCEXgPb-cas01.example.org}]
2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.engine.impl.FlowExecutionImpl] - Attempting to handle [org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.springframework.webflow.action.ViewFactoryActionAdapter@359d136a in state 'accountCannotLogInView' of flow 'login' -- action execution attributes were 'map[[empty]]'] with root cause [java.lang.NullPointerException]
2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.engine.impl.FlowExecutionImpl] - Rethrowing unhandled flow execution exception

是的,该文件确实存在于该位置。这几天我一直在研究这个问题,所以如果有人有任何见解,我将不胜感激。

4

3 回答 3

2

正确答案是“用户错误”。我正在通过 maven 构建 CAS。我创建了配置文件来保存日志记录,然后错误地配置了它,因此 default_views.properties 文件不在配置文件中。结果,当 CAS 作为 maven 构建的一部分进行覆盖时,它包含基线 default_views.properties 而不是我的副本。

于 2013-09-09T16:18:05.037 回答
1

似乎您的属性未解析为您的 flow.xml。

定义硬编码的视图应该可以工作。

请参见此处:指定视图标识符

于 2013-08-28T15:36:11.080 回答
0

出现此问题的原因是:未找到 JSP 视图。

在 cas-servlet.xml 中,提及在“viewResolver”bean 中具有自定义 JSP 视图的基本名称的属性文件,如下所示:

<bean id="viewResolver"
    class="org.springframework.web.servlet.view.ResourceBundleViewResolver"
    p:order="0">
    <property name="basenames">
        <util:list>
            <value>${cas.viewResolver.basename}</value>
            <value>custom_view</value>
            <value>protocol_views</value>
        </util:list>
    </property>
</bean>

在 custom_view.properties 中,提及以下内容:

casRegisterView.(class)=org.springframework.web.servlet.view.JstlView
casRegisterView.url=/WEB-INF/view/jsp/default/ui/casRegisterView.jsp

这里的 JSP 视图是“casRegisterView.jsp”。将 custom_view.properties 放在 /src/main/resources 中。

于 2015-07-16T09:25:59.060 回答