JSF + Spring + Pretty Faces not working / starting

Splash Forums PrettyFaces Users JSF + Spring + Pretty Faces not working / starting

This topic contains 3 replies, has 2 voices, and was last updated by  Christian Kaltepoth 1 year, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26903

    m0nky
    Participant

    Hi!

    I have following configuration, but cant’ get PrettyFaces to work.

    Server Log:

    [0m13:40:31,316 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
    [0m[0m13:40:31,912 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
    [0m[0m13:40:32,079 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.2.0.Final "Tweek" starting
    [0m[0m13:40:33,651 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
    [0m[0m13:40:33,682 INFO  [org.xnio] (MSC service thread 1-5) XNIO version 3.3.0.Final
    [0m[0m13:40:33,694 INFO  [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.3.0.Final
    [0m[0m13:40:33,758 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
    [0m[0m13:40:33,803 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 31) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
    [0m[0m13:40:33,814 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
    [0m[0m13:40:33,826 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.9.Final)
    [0m[0m13:40:33,829 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) JBAS010417: Started Driver service with driver-name = h2
    [0m[0m13:40:33,814 INFO  [org.jboss.remoting] (MSC service thread 1-5) JBoss Remoting version 4.0.6.Final
    [0m[0m13:40:33,848 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem
    [0m[33m13:40:33,850 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
    [0m[0m13:40:33,859 INFO  [org.jboss.as.security] (MSC service thread 1-8) JBAS013170: Current PicketBox version=4.0.21.Final
    [0m[0m13:40:33,865 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem
    [0m[0m13:40:33,868 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [main]
    [0m[0m13:40:33,903 INFO  [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Service
    [0m[0m13:40:33,908 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]
    [0m[0m13:40:33,923 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
    [0m[0m13:40:33,946 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017502: Undertow 1.1.0.Final starting
    [0m[0m13:40:33,946 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017502: Undertow 1.1.0.Final starting
    [0m[0m13:40:34,261 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path /Library/wildfly-8.2.0.Final/welcome-content
    [0m[0m13:40:34,320 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) JBAS017525: Started server default-server.
    [0m[0m13:40:34,368 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017531: Host default-host starting
    [0m[0m13:40:34,575 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) JBAS017519: Undertow HTTP listener default listening on /127.0.0.1:8080
    [0m[0m13:40:35,155 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory /Library/wildfly-8.2.0.Final/standalone/deployments
    [0m[0m13:40:35,166 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
    [0m[0m13:40:36,540 INFO  [org.jboss.ws.common.management] (MSC service thread 1-5) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.2.Final
    [0mConnected to server
    [2015-02-21 01:40:36,599] Artifact Gradle : ITcareerPortal : ITcareerPortal-1.0.war (exploded): Artifact is being deployed, please wait...
    [0m13:40:36,633 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
    [0m[0m13:40:36,634 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
    [0m[0m13:40:36,635 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final "Tweek" started in 6414ms - Started 184 of 234 services (82 services are lazy, passive or on-demand)
    [0m[0m13:40:36,892 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "ITcareerPortal-1.0.war" (runtime-name: "ITcareerPortal-1.0.war")
    [0m[0m13:40:40,196 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment ITcareerPortal-1.0.war
    [0m[0m13:40:40,266 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-7) HV000001: Hibernate Validator 5.1.3.Final
    [0m[0m13:40:40,672 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.4)
    [0m[0m13:40:40,674 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016005: Starting Services for CDI deployment: ITcareerPortal-1.0.war
    [0m[0m13:40:40,715 INFO  [org.jboss.weld.Version] (MSC service thread 1-3) WELD-000900: 2.2.6 (Final)
    [0m[0m13:40:40,821 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) JBAS010417: Started Driver service with driver-name = ITcareerPortal-1.0.war_org.postgresql.Driver_9_4
    [0m[0m13:40:40,834 INFO  [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016008: Starting weld service for deployment ITcareerPortal-1.0.war
    [0m[0m13:40:47,336 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-7) Initializing Mojarra 2.2.8-jbossorg-1 20140822-1131 for context '/ITcareerPortal-1.0'
    [0m[0m13:40:49,924 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-7) Monitoring file:/Users/Thomas/Documents/IdeaProjects/ITcareerPortal/out/artifacts/ITcareerPortal/exploded/ITcareerPortal-1.0.war/WEB-INF/faces-config.xml for modifications
    [0m[0m13:40:50,005 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017534: Registered web context: /ITcareerPortal-1.0
    [0m[0m13:40:50,037 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "ITcareerPortal-1.0.war" (runtime-name : "ITcareerPortal-1.0.war")
    [0m[2015-02-21 01:40:50,064] Artifact Gradle : ITcareerPortal : ITcareerPortal-1.0.war (exploded): Artifact is deployed successfully
    [2015-02-21 01:40:50,064] Artifact Gradle : ITcareerPortal : ITcareerPortal-1.0.war (exploded): Deploy took 13,465 milliseconds

    Gradle:

        // PRETTY FACES
        compile 'org.ocpsoft.rewrite:rewrite-servlet:2.0.12.Final'
        compile 'org.ocpsoft.rewrite:rewrite-config-prettyfaces:2.0.12.Final'

    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app>
    
        <display-name>JavaServerFaces</display-name>
    
        <!-- Add Support for Spring -->
        <listener>
            <listener-class>
                org.springframework.web.context.ContextLoaderListener
            </listener-class>
        </listener>
        <listener>
            <listener-class>
                org.springframework.web.context.request.RequestContextListener
            </listener-class>
        </listener>
    
        <!-- Change to "Production" when you are ready to deploy -->
        <context-param>
            <param-name>javax.faces.PROJECT_STAGE</param-name>
            <param-value>Development</param-value>
        </context-param>
    
        <!-- Welcome page -->
        <welcome-file-list>
            <welcome-file>applicant_views/index.xhtml</welcome-file>
        </welcome-file-list>
    
        <!-- JSF Mapping -->
        <servlet>
            <servlet-name>facesServlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>facesServlet</servlet-name>
            <url-pattern>*.xhtml</url-pattern>
        </servlet-mapping>
    
    </web-app>
    • This topic was modified 1 year, 5 months ago by  m0nky.
    #26905

    There is no log entry that shows that Rewrite started up correctly.

    Try adding the required filters and listeners manually to your web.xml:

    http://www.ocpsoft.org/rewrite/docs/configuration/install

    #26906

    m0nky
    Participant

    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app>
    
        <display-name>JavaServerFaces</display-name>
    
        <!-- Pretty Faces -->
        <listener>
            <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletRequestListener</listener-class>
        </listener>
    
        <listener>
            <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener</listener-class>
        </listener>
    
        <filter>
            <filter-name>OCPsoft Rewrite Filter</filter-name>
            <filter-class>org.ocpsoft.rewrite.servlet.RewriteFilter</filter-class>
            <async-supported>true</async-supported>
        </filter>
        <filter-mapping>
            <filter-name>OCPsoft Rewrite Filter</filter-name>
            <url-pattern>/*</url-pattern>
            <dispatcher>FORWARD</dispatcher>
            <dispatcher>REQUEST</dispatcher>
            <dispatcher>INCLUDE</dispatcher>
            <dispatcher>ASYNC</dispatcher>
            <dispatcher>ERROR</dispatcher>
        </filter-mapping>
    
        <!-- Add Support for Spring -->
        <listener>
            <listener-class>
                org.springframework.web.context.ContextLoaderListener
            </listener-class>
        </listener>
        <listener>
            <listener-class>
                org.springframework.web.context.request.RequestContextListener
            </listener-class>
        </listener>
    
        <!-- Change to "Production" when you are ready to deploy -->
        <context-param>
            <param-name>javax.faces.PROJECT_STAGE</param-name>
            <param-value>Development</param-value>
        </context-param>
    
        <!-- Welcome page -->
        <welcome-file-list>
            <welcome-file>applicant_views/index.xhtml</welcome-file>
        </welcome-file-list>
    
        <!-- JSF Mapping -->
        <servlet>
            <servlet-name>facesServlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>facesServlet</servlet-name>
            <url-pattern>*.xhtml</url-pattern>
        </servlet-mapping>
    
    </web-app>

    Log

    /Library/wildfly-8.2.0.Final/bin/standalone.sh
    /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java -classpath "/Applications/IntelliJ IDEA 14.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA 14.app/Contents/lib/util.jar" -Dfile.encoding=UTF-8 com.intellij.rt.execution.CommandLineWrapper /private/var/folders/9s/117vg5vd1vxcr2281hw751b80000gn/T/classpath0.tmp com.intellij.javaee.oss.process.JavaeeProcess 57224 com.intellij.javaee.oss.jboss.agent.JBoss71Agent
    =========================================================================
    [2015-02-21 06:26:06,701] Artifact Gradle : ITcareerPortal : ITcareerPortal-1.0.war (exploded): Server is not connected. Deploy is not available.
    
    Detected server admin port: 9990
      JBoss Bootstrap Environment
    Detected server http port: 8080
    
      JBOSS_HOME: /Library/wildfly-8.2.0.Final
    
      JAVA: /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java
    
      JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
    
    =========================================================================
    
    [0m18:26:05,999 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
    [0m[0m18:26:06,576 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
    [0m[0m18:26:06,766 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.2.0.Final "Tweek" starting
    [0m[0m18:26:08,725 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
    [0m[0m18:26:08,751 INFO  [org.xnio] (MSC service thread 1-8) XNIO version 3.3.0.Final
    [0m[0m18:26:08,763 INFO  [org.xnio.nio] (MSC service thread 1-8) XNIO NIO Implementation Version 3.3.0.Final
    [0m[0m18:26:08,829 INFO  [org.jboss.remoting] (MSC service thread 1-8) JBoss Remoting version 4.0.6.Final
    [0m[0m18:26:08,834 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
    [0m[0m18:26:08,853 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 31) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
    [0m[0m18:26:08,855 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
    [0m[0m18:26:08,879 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [main]
    [0m[0m18:26:08,890 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.9.Final)
    [0m[0m18:26:08,893 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = h2
    [0m[0m18:26:08,906 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem
    [0m[33m18:26:08,907 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
    [0m[0m18:26:08,920 INFO  [org.jboss.as.security] (MSC service thread 1-7) JBAS013170: Current PicketBox version=4.0.21.Final
    [0m[0m18:26:08,925 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem
    [0m[0m18:26:08,975 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
    [0m[0m18:26:09,034 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017502: Undertow 1.1.0.Final starting
    [0m[0m18:26:09,034 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017502: Undertow 1.1.0.Final starting
    [0m[0m18:26:09,087 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
    [0m[0m18:26:09,093 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-5) JBAS015400: Bound mail session [java:jboss/mail/Default]
    [0m[0m18:26:09,278 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path /Library/wildfly-8.2.0.Final/welcome-content
    [0m[0m18:26:09,316 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) JBAS017525: Started server default-server.
    [0m[0m18:26:09,370 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017531: Host default-host starting
    [0m[0m18:26:09,636 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) JBAS017519: Undertow HTTP listener default listening on /127.0.0.1:8080
    [0m[0m18:26:09,813 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
    [0m[0m18:26:10,146 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory /Library/wildfly-8.2.0.Final/standalone/deployments
    [0mConnected to server
    [2015-02-21 06:26:11,471] Artifact Gradle : ITcareerPortal : ITcareerPortal-1.0.war (exploded): Artifact is being deployed, please wait...
    [0m18:26:11,667 INFO  [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.2.Final
    [0m[0m18:26:11,760 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
    [0m[0m18:26:11,761 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
    [0m[0m18:26:11,762 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final "Tweek" started in 6605ms - Started 184 of 234 services (82 services are lazy, passive or on-demand)
    [0m[0m18:26:11,898 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "ITcareerPortal-1.0.war" (runtime-name: "ITcareerPortal-1.0.war")
    [0m[0m18:26:16,558 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment ITcareerPortal-1.0.war
    [0m[0m18:26:16,647 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-7) HV000001: Hibernate Validator 5.1.3.Final
    [0m[0m18:26:17,341 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.4)
    [0m[0m18:26:17,345 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016005: Starting Services for CDI deployment: ITcareerPortal-1.0.war
    [0m[0m18:26:17,440 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.2.6 (Final)
    [0m[0m18:26:17,530 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = ITcareerPortal-1.0.war_org.postgresql.Driver_9_4
    [0m[0m18:26:17,544 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016008: Starting weld service for deployment ITcareerPortal-1.0.war
    [0m[0m18:26:25,106 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Initializing Mojarra 2.2.8-jbossorg-1 20140822-1131 for context '/ITcareerPortal-1.0'
    [0m[0m18:26:29,569 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Monitoring file:/Users/Thomas/Documents/IdeaProjects/ITcareerPortal/out/artifacts/ITcareerPortal/exploded/ITcareerPortal-1.0.war/WEB-INF/faces-config.xml for modifications
    [0m[0m18:26:29,889 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017534: Registered web context: /ITcareerPortal-1.0
    [0m[0m18:26:29,928 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "ITcareerPortal-1.0.war" (runtime-name : "ITcareerPortal-1.0.war")
    [0m[2015-02-21 06:26:29,959] Artifact Gradle : ITcareerPortal : ITcareerPortal-1.0.war (exploded): Artifact is deployed successfully
    [2015-02-21 06:26:29,959] Artifact Gradle : ITcareerPortal : ITcareerPortal-1.0.war (exploded): Deploy took 18,488 milliseconds
    

    Still no output 🙁

    #26907

    But there are also no log entries by Spring. Any problem with your logging?

    BTW: Your your web.xml looks a bit strange. Especially the root element. There is for example no version set. Have a look here for how a typical web.xml for Wildfly:

    http://antoniogoncalves.org/2013/06/04/java-ee-7-deployment-descriptors/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Comments are closed.