Project maven with JSF 1.2 does not publish in glassfish 4.1.2

0

I have a maven application that uses JSF 1.2, RichFaces 3.3.3, Hibernate 3.2.0, Glassfish 4.1.2, generated in eclipse mars. However when trying to upload the application to the server it gives the following error:

com.sun.faces.config.ConfigurationException: 
Source Document: jndi:/server/CA-Client/WEB-INF/faces-config.xml
Cause: Unable to create a new instance of 'caclient.listener.CtrPhaseListener': javax.faces.FacesException: caclient.listener.CtrPhaseListener
...
Caused by: javax.faces.FacesException: caclient.listener.CtrPhaseListener
....
Caused by: java.lang.ClassNotFoundException: caclient.listener.CtrPhaseListener
...
Exception during cleanup after start failed
org.apache.catalina.LifecycleException: Manager has not yet been started
...
ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: 
Source Document: jndi:/server/CA-Client/WEB-INF/faces-config.xml
Cause: Unable to create a new instance of 'caclient.listener.CtrPhaseListener': javax.faces.FacesException: caclient.listener.CtrPhaseListener

The project structure is:

src/main/java/caclient.listener.CtrPhaseListener.java

src/main/webapp/WEB-INF/faces-config.xml

faces-config.xml

<lifecycle>
    <phase-listener>caclient.listener.CtrPhaseListener</phase-listener>
</lifecycle>

CtrPhaseListener.class

public class CtrPhaseListener implements PhaseListener {

private static final String PASSED_PAGES = "/Login.jsp, /AlterarSenha.jsp";
private Date ultimoAcesso = null;

public void afterPhase(PhaseEvent event) {}

public void beforePhase(PhaseEvent event) {
    FacesContext ctx = event.getFacesContext();


    String paginaDestino = ctx.getViewRoot().getViewId();
    ctx = event.getFacesContext();
    HttpSession session = (HttpSession) ctx.getExternalContext().getSession(false);

    ultimoAcesso = (ultimoAcesso == null) ? new Date() : ultimoAcesso;

    SimpleDateFormat sdf = new SimpleDateFormat("HHmm");

    int mins = Integer.parseInt(sdf.format(new Date())) - Integer.parseInt(sdf.format(ultimoAcesso));

    if (/*mins > 10 || */session == null || session.getAttribute("sessionUser") == null) {
        if (!PASSED_PAGES.contains(paginaDestino) && paginaDestino.contains(".jsp")) {
            try {
                //se não existir direciona para a página de LOGIN
                ultimoAcesso = null;
                session.setAttribute("sessionUser", null);
                ctx.getExternalContext().redirect("faces/Login.jsp");
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }
    ultimoAcesso = new Date();
}

public PhaseId getPhaseId() {
    return PhaseId.APPLY_REQUEST_VALUES;
}
}

Is the problem due to the src / main / java folder that was created by Maven?

    
asked by anonymous 01.10.2018 / 19:38

0 answers