【问题标题】:javax.el.PropertyNotFoundException: Target Unreachable, identifier bean resolved to nulljavax.el.PropertyNotFoundException:目标不可达,标识符 bean 解析为 null
【发布时间】:2016-03-09 14:49:40
【问题描述】:

当我尝试通过 Eclipse 部署我的应用程序时收到此错误消息,因为我通过 weblogic 控制台进行构建和安装包我的应用程序工作正常,但每次我从 Eclipse 部署我的应用程序时我的服务器正常但是当我尝试访问任何页面时都会收到此消息,如果有人可以帮助我,我将非常感激。下面是我的服务器日志。

我正在使用 weblogic 12 C bean 管理的 CDI。

<04/12/2015 11h48min22s BRST> <Warning> <javax.enterprise.resource.webcontainer.jsf.lifecycle> <BEA-000000> <#{productUI.resetTelaConsulta}: javax.el.PropertyNotFoundException: web/src/main/webapp/WEB-INF/template/menu.xhtml @31,127 action="#{productUI.resetTelaConsulta}": Target Unreachable, identifier 'productUI' resolved to null
javax.faces.FacesException: #{productUI.resetTelaConsulta}: javax.el.PropertyNotFoundException:web/src/main/webapp/WEB-INF/template/menu.xhtml @31,127 action="#{productUI.resetTelaConsulta}": Target Unreachable, identifier 'productUI' resolved to null
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:117)
    at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1251)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    Truncated. see log file for complete stacktrace
Caused By: javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: /web/src/main/webapp/WEB-INF/template/menu.xhtml @31,127 action="#{productUI.resetTelaConsulta}": Target Unreachable, identifier 'productUI' resolved to null
    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:94)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:101)
    at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1251)
    Truncated. see log file for complete stacktrace
Caused By: javax.el.PropertyNotFoundException: /web/src/main/webapp/WEB-INF/template/menu.xhtml @31,127 action="#{productUI.resetTelaConsulta}": Target Unreachable, identifier 'productUI' resolved to null
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:107)
    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:101)
    at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786)
    Truncated. see log file for complete stacktrac

管理豆:

/**
 * Managed-bean Product
 */
@Named
@SessionScoped
public class ProductUI extends AbstractUI {

    private static final long serialVersionUID = 3033815555702729279L;

    private static final String PRODUTO_CONSULTA = "/produto/produto_consulta.xhtml";


    @Inject
    private ProdutoCadastroUI produtoCadastroUI;
    @Inject
    private ProdutoOpcionalNovoUI produtoOpcionalNovoUI;

    /**
     * Construtor
     */
    public ProductUI() {
        searchProdutos = new ArrayList<Produto>();

        ServiceLocator serviceLocator = new ServiceLocator();
        produtoService = serviceLocator.lookupRemoteEJB(ProdutoService.class);
        tipoProdutoService = serviceLocator.lookupRemoteEJB(TipoProdutoService.class);
        generoService = serviceLocator.lookupRemoteEJB(GeneroService.class);
        canalService = serviceLocator.lookupRemoteEJB(CanalService.class);
        categoriaService = serviceLocator.lookupRemoteEJB(CategoriaService.class);
        ofertaService = serviceLocator.lookupRemoteEJB(OfertaService.class);
        opcionalService = serviceLocator.lookupRemoteEJB(OpcionalService.class);
        regraProdutoService = serviceLocator.lookupRemoteEJB(RegraProdutoService.class);
        disponibilidadeService = serviceLocator.lookupRemoteEJB(DisponibilidadeService.class);
        equipamentoService = serviceLocator.lookupRemoteEJB(EquipamentoService.class);
    }

    @PostConstruct
    public void init() {
        filter = new ProdutoFilter();
        tiposProduto = tipoProdutoService.findTiposProduto();
        generos = generoService.findGenerosAtivos();
        categorias = categoriaService.findCategoriasAtivas();
        produtos = produtoService.findProdutosAtivos();
    }

    /**
     * Reseta a tela de filtro
     */
    public String resetTelaConsulta() {
        init();
        return PRODUTO_CONSULTA;
    }

    //Get/set methods
}

【问题讨论】:

  • 请添加托管bean代码
  • 代码编辑@MahendranAyyarsamyKandiar
  • @Tiny 我已经阅读了该链接,但它对我没有帮助,此外,如果我通过 weblogic 控制台构建并安装为应用程序,我的问题只会发生在我从 eclipse 进行部署时,它工作正常。
  • 您是否也检查了步骤 1c?问题表明 Eclipse 完成的构建是错误的。

标签: jsf weblogic propertynotfoundexception


【解决方案1】:

我在 WL 12.1.3 中遇到了同样的问题:尝试通过 eclipse 将其部署为展开的存档(标准是虚拟应用程序)。

右键单击服务器 -> 属性 -> 展开主题 WebLogic -> 发布 -> 单击“发布为展开的存档”并应用更改

【讨论】:

  • 非常感谢@Slettal,它对我来说工作得很好!
  • 你能告诉我为什么引爆 EAR 会有影响吗?
  • @DenisMP 不幸的是,这是通过反复试验得出的。
猜你喜欢
  • 1970-01-01
  • 2014-02-10
  • 2015-05-18
  • 1970-01-01
  • 1970-01-01
  • 2016-02-15
  • 2020-09-28
  • 2014-08-24
  • 2018-10-23
相关资源
最近更新 更多