java.lang.IllegalStateException重定向到外部页面

时间:2019-06-17 21:39:31

标签: jsf

我正在尝试使用facesContext.redirect()重定向到jsf中的外部页面,但收到错误消息。

public void redirecionarProcessoPaiSemCaptura(Long codigoProcesso) {
        this.mBeanUtils.redirectPaginaExterna(this.propriedadesSistemaMbean.getUrlSistemaNovoSajAdv() + "/casos/processo/cadastro" + codigoProcesso);


public void redirectPaginaExterna(String pagina) {
        try {

    this.facesContext.getExternalContext().redirect(pagina);
        } catch (final IOException e) {
            MBeanUtils.LOGGER.error("Erro ao redirecionar pagina externa", e);
        }
    }
{

错误消息如下:

18:30:17,389 ERROR [br.com.softplan.pd.zion.faces.impl.ZionExceptionHandler] (default task-35) null: java.lang.IllegalStateException
    at com.sun.faces.context.ExternalContextImpl.redirect(ExternalContextImpl.java:661) [jsf-impl-2.2.8-23.jar:2.2.8-23]
    at br.com.softplan.unj.adv.view.jsf.commons.MBeanUtils.redirectPaginaExterna(MBeanUtils.java:143) [classes:]
    at br.com.softplan.unj.adv.view.jsf.commons.MBeanUtils$Proxy$_$$_WeldSubclass.redirectPaginaExterna(Unknown Source) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_161]
    at org.jboss.weld.interceptor.proxy.SimpleInterceptionChain.interceptorChainCompleted(SimpleInterceptionChain.java:51) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.finish(AbstractInterceptionChain.java:148) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:104) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:43) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:36) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:51) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at br.com.softplan.unj.adv.view.jsf.commons.MBeanUtils$Proxy$_$$_WeldSubclass.redirectPaginaExterna(Unknown Source) [classes:]
    at br.com.softplan.unj.adv.view.jsf.commons.MBeanUtils$Proxy$_$$_WeldClientProxy.redirectPaginaExterna(Unknown Source) [classes:]
    at br.com.softplan.unj.adv.view.jsf.managedbean.processo.ProcessoRelacionadoMbean.redirecionarProcessoPaiSemCaptura(ProcessoRelacionadoMbean.java:310) [classes:]
    at br.com.softplan.unj.adv.view.jsf.managedbean.processo.ProcessoRelacionadoMbean$Proxy$_$$_WeldSubclass.redirecionarProcessoPaiSemCaptura(Unknown Source) [classes:]
    at br.com.softplan.unj.adv.view.jsf.managedbean.processo.ProcessoRelacionadoMbean.editarProcesso(ProcessoRelacionadoMbean.java:298) [classes:]
    at br.com.softplan.unj.adv.view.jsf.managedbean.processo.ProcessoRelacionadoMbean$Proxy$_$$_WeldSubclass.editarProcesso(Unknown Source) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_161]
    at org.jboss.weld.interceptor.proxy.SimpleInterceptionChain.interceptorChainCompleted(SimpleInterceptionChain.java:51) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.finish(AbstractInterceptionChain.java:148) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:104) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:43) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:36) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:51) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
    at br.com.softplan.unj.adv.view.jsf.managedbean.processo.ProcessoRelacionadoMbean$Proxy$_$$_WeldSubclass.editarProcesso(Unknown Source) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_161]
    at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_161]
    at javax.el.ELUtil.invokeMethod(ELUtil.java:308) [jboss-el-api_3.0_spec-1.0.3.Final.jar:1.0.3.Final]
    at javax.el.BeanELResolver.invoke(BeanELResolver.java:537) [jboss-el-api_3.0_spec-1.0.3.Final.jar:1.0.3.Final]
    at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256) [jboss-el-api_3.0_spec-1.0.3.Final.jar:1.0.3.Final]
    at com.sun.el.parser.AstValue.invoke(AstValue.java:286) [javax.el-3.0.1-b05.jar:]
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304) [javax.el-3.0.1-b05.jar:]
    at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]

0 个答案:

没有答案