javax.el.PropertyNotFoundException: Target Unreach

2019-09-05 07:17发布

问题:

I'm getting this error message just when I try to deploy my application through eclipse as I do a build and install the packages by weblogic console my app works fine, but everytime I deploy my app from eclipse my server up normally but I get this message when I try access any page, please if someone can help me I will be really thankful. Below follows my server log.

I'm using weblogic 12 C CDI for beans manage.

<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

ManageBean:

/**
 * 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
}

回答1:

I had the same problem for WL 12.1.3: Try to deploy it as exploded archive via eclipse (Standard is virtual application).

Right-Click on the Server -> Properties -> Expand the Topic WebLogic -> Publishing -> Click "Publish as an exploded archive" and apply the changes