0

I know that this issue was answered in this thread , but in my case, the JAR (who have the ManagedBean) and the WAR (who call the ManagedBean by resolve the view as resource inside the JAR) are packaged in an EAR.

I'm using: Weblogic 12c Version JSF jsf_2.0.0.0_2-1-20.jar (weblogic provide it)

The JAR contents the faces-config.xml in the right place, and looks like:

     0 Mon May 14 12:20:08 CST 2018 META-INF/
   125 Mon May 14 12:20:06 CST 2018 META-INF/MANIFEST.MF
     0 Mon May 14 12:20:06 CST 2018 META-INF/resources/
     0 Mon May 14 12:20:06 CST 2018 gt/
     0 Mon May 14 12:20:06 CST 2018 gt/com/
     0 Mon May 14 12:20:06 CST 2018 gt/com/leta/
     0 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/
     0 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/errorhandlers/
     0 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/pojos/
     0 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/utilities/
  4460 Mon May 14 12:20:06 CST 2018 META-INF/resources/menu.xhtml
  4403 Mon May 14 12:20:06 CST 2018 META-INF/resources/login.xhtml
   338 Mon May 14 12:20:06 CST 2018 META-INF/faces-config.xml
   922 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/errorhandlers/CustomExceptionHandlerFactorySisleta.class
  4381 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/errorhandlers/CustomExceptionHandlerSisLeta.class
 15480 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/utilities/FunctionsSecurity.class
  1146 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/utilities/FaceletsResourceResolver.class
 13435 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/utilities/Menu.class
  4158 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/utilities/FilterApp.class
  2746 Mon May 14 12:20:06 CST 2018 gt/com/leta/security/utilities/SessionListener.class
     0 Mon May 14 12:20:08 CST 2018 META-INF/maven/
     0 Mon May 14 12:20:08 CST 2018 META-INF/maven/gt.com.leta/
     0 Mon May 14 12:20:08 CST 2018 META-INF/maven/gt.com.leta/Security/
  5030 Mon May 14 10:57:24 CST 2018 META-INF/maven/gt.com.leta/Security/pom.xml                                                       
   105 Mon May 14 12:20:08 CST 2018 META-INF/maven/gt.com.leta/Security/pom.properties

The ManagedBean is this:

    /*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gt.com.late.security.;

import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import org.primefaces.context.RequestContext;
import org.primefaces.model.menu.DefaultMenuItem;
import org.primefaces.model.menu.DefaultMenuModel;
import org.primefaces.model.menu.DefaultSubMenu;

/**
 *
 * @author 
 */
@ManagedBean(name="menu", eager = true)
@SessionScoped
public class Menu {
    private String ...
    private String ....


    /**
     * Creates a new instance of Menu
     */
    public Menu() {
    }

    @PostConstruct
    public void init(){

    /*
         This does'nt trigger
    */
    }

}

The WAR use a FaceletsResourceResolver to get a view from the same JAR, and that works perfect!.

<context-param>
    <param-name>facelets.RESOURCE_RESOLVER</param-name>
    <param-value>com.example.FaceletsResourceResolver</param-value>
</context-param>

Is there a differens of how handle this mode, if i want it in an EAR?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
HAAO
  • 61
  • 11
  • Possible duplicate of [JBoss 7.1 Weld finds Managed Bean in a jar in the ear, but the war does not](https://stackoverflow.com/questions/11159479/jboss-7-1-weld-finds-managed-bean-in-a-jar-in-the-ear-but-the-war-does-not) – Kukeltje May 15 '18 at 05:24
  • @Kukeltje i see that Weld could be have the same behavior than weblogic, but i don't have any idea how to confirm it. Could you suggest me how can i do it? (By the way, sorry for the late). – HAAO May 22 '18 at 16:45
  • Sorry I have no weblogic nor any incentive to try running it – Kukeltje May 22 '18 at 17:16

0 Answers0