does anybody implement jGuard with jsf?

  • xRod

    Hi all,

    I tried implement jGuard using the example called "jguard-jsf-example-1.1.0-beta-4.war", downloaded from sourceforge site. But I made some adaptation based on the struts example.

    In the loggin's form, I define the "loggonProcess" action. This "loggonProcess" I declared in the jguardfilter.xml on the property loggonProcessURI. I'm dealing with xmlauthenticationmanager.

    Then, when I try to loggin the server launch an exception like:
    "ResourceRequested (loggonProcess) is not available"

    What is wrong here?. Does Anybody has an example?. I'm using tomcat 6.0.20, jee5 and jsf 1.2 with facelets.

    thanks in advance.


  • Charles Lescot
    Charles Lescot

    the jguard-sjsf-example contains an example of authentication.
    you should use the code "as is" to authenticate.
    with this jsf authentication, can you publish your stack trace or traces contained in your log file, with the net.sf.jguard log4j level enabled to debug?


  • xRod

    Hi Charles, thank you for your quick reply.

    I made some modification to the code for deploy. And, we those modifications I got this error from apache:

    State: HTTP 404 - /jguard-jsf-example-1.1.0-beta-4/logonProcess.jsp
    type: State's report
    message: /jguard-jsf-example-1.1.0-beta-4/logonProcess.jsp
    description: Resource requested (/jguard-jsf-example-1.1.0-beta-4/logonProcess.jsp) is not available.

    If I use the code "as is" the stack is the next:

    INFO: El escuchador "org.apache.myfaces.webapp.
    StartupServletContextListener" ya está configurado para este contexto. La definición duplicada ha sido ignorada.
    26-oct-2010 9:52:00 net.sf.jguard.core.authentication.manager.AuthenticationManagerFactory createAuthenticationManager
    INFO: authenticationManagerImpl=net.sf.jguard.ext.authentication.manager.HibernateAuthenticationManager
    26-oct-2010 9:52:01 org.apache.catalina.core.StandardContext start
    GRAVE: Error listenerStart
    GRAVE: Excepción enviando evento inicializado de contexto a instancia de escuchador de clase net.sf.jguard.jee.listeners.ContextListener
    java.lang.NoClassDefFoundError: org/hibernate/Session
            at java.lang.Class.getDeclaredConstructors0(Native Method)
            at java.lang.Class.privateGetDeclaredConstructors(
            at java.lang.Class.getConstructor0(
            at java.lang.Class.getConstructor(
            at net.sf.jguard.core.authentication.manager.AuthenticationManagerFactory.createAuthenticationManager(
            at net.sf.jguard.core.authentication.manager.AuthenticationHelper.initAuthentication(
            at net.sf.jguard.core.authentication.configuration.JGuardConfiguration$
            at Method)
            at net.sf.jguard.core.authentication.configuration.JGuardConfiguration.loadConfigDataAndAuthenticationManager(
            at net.sf.jguard.core.authentication.configuration.JGuardConfiguration.<init>(
            at net.sf.jguard.jee.listeners.ContextListener.initAuthentication(
            at net.sf.jguard.jee.listeners.ContextListener.contextInitialized(
            at org.apache.catalina.core.StandardContext.listenerStart(
            at org.apache.catalina.core.StandardContext.start(
            at org.apache.catalina.core.ContainerBase.addChildInternal(
            at org.apache.catalina.core.ContainerBase.addChild(
            at org.apache.catalina.core.StandardHost.addChild(
            at org.apache.catalina.startup.HostConfig.deployWAR(
            at org.apache.catalina.startup.HostConfig.deployWARs(
            at org.apache.catalina.startup.HostConfig.deployApps(
            at org.apache.catalina.startup.HostConfig.check(
            at org.apache.catalina.startup.HostConfig.lifecycleEvent(
            at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
            at org.apache.catalina.core.ContainerBase.backgroundProcess(
            at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(
            at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(
            at org.apache.catalina.core.ContainerBase$
    Caused by: java.lang.ClassNotFoundException: org.hibernate.Session
            at org.apache.catalina.loader.WebappClassLoader.loadClass(
            at org.apache.catalina.loader.WebappClassLoader.loadClass(
            … 28 more
    26-oct-2010 9:52:01 org.apache.catalina.core.StandardContext start
    GRAVE: Falló en arranque del Contexto  debido a errores previos

    I hope this is what you asked for.



  • Charles Lescot
    Charles Lescot

    this part of trace:
    "java.lang.NoClassDefFoundError: org/hibernate/Session"
    implies that you've configured an HibernateAuthenticationManager, but you've not put in your web-inf/lib an hibernate jar.
    you should put all the libraries present in the example in your web-inf/lib directory, to solve your issue.

    best regards,


  • xRod

    Hi Charles,
    Thank you for your comment. The jsf-example is working.
    Now, I have to implement in my project. Do you have any advice to do?, or what is the "best practices" in jGuard implementation. Is this question looks so general, I'll post again when something wrong happent.

    b. regards,