Outbound rule for Internationalize your URLs

Splash Forums Rewrite Users Outbound rule for Internationalize your URLs

Tagged: 

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

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #27104

    brnovais
    Participant

    Hi there, I have a little problem. Implementing the tutorial “Internationalize your URLs”, everything works just fine for Inbound rules. When I try to use tags such as h:link or h:outputLink in my XHTML page, I got a few exceptions.

    19:06:45,161 SEVERE [org.ocpsoft.rewrite.AbstractRewrite] (default task-1) Rewrite rule evaluation for event [OutboundRewrite [flow=UN_HANDLED, outboundURL=/accounts-0.0.1/signin.xhtml, dispatchResource=null]]
    Rule 0: .addRule(Join.path(“/{lang}/{path}”).to(“/{path}.xhtml”)).withPriority(50) defined at accounts.rewrite.ConfigurationProviderLocalized.getConfiguration(ConfigurationProviderLocalized.java:51)
    Rule 1: .addRule(Join.path(“/{lang}/{path}”).to(“/{path}.xhtml”)).withPriority(50) defined at accounts.rewrite.ConfigurationProviderLocalized.getConfiguration(ConfigurationProviderLocalized.java:51)

    19:06:45,161 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-1) Error Rendering View[/signin.xhtml]: org.ocpsoft.rewrite.exception.RewriteException: Error during [OutboundRewrite [flow=UN_HANDLED, outboundURL=/accounts-0.0.1/signin.xhtml, dispatchResource=null]] while executing rule [.addRule(Join.path(“/{lang}/{path}”).to(“/{path}.xhtml”)).withPriority(50)]
    at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.rewriteOutbound(DefaultHttpRewriteProvider.java:410) [rewrite-servlet-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.rewriteHttp(DefaultHttpRewriteProvider.java:92) [rewrite-servlet-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at org.ocpsoft.rewrite.servlet.http.HttpRewriteProvider.rewrite(HttpRewriteProvider.java:43) [rewrite-servlet-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.rewrite(HttpRewriteWrappedResponse.java:436) [rewrite-servlet-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.encodeURL(HttpRewriteWrappedResponse.java:395) [rewrite-servlet-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at com.sun.faces.context.ExternalContextImpl.encodeActionURL(ExternalContextImpl.java:604) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.application.view.MultiViewHandler.getBookmarkableURL(MultiViewHandler.java:407) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at org.ocpsoft.rewrite.faces.RewriteViewHandler.getBookmarkableURL(RewriteViewHandler.java:164) [rewrite-integration-faces-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at org.jboss.weld.jsf.ConversationAwareViewHandler.getBookmarkableURL(ConversationAwareViewHandler.java:132) [weld-core-jsf-2.2.4.Final.jar:2014-07-18 16:55]
    at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at com.sun.faces.renderkit.html_basic.OutcomeTargetRenderer.getEncodedTargetURL(OutcomeTargetRenderer.java:194) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.renderAsActive(OutcomeTargetLinkRenderer.java:158) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.encodeBegin(OutcomeTargetLinkRenderer.java:96) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:864) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at org.ocpsoft.rewrite.faces.RewriteViewHandler.renderView(RewriteViewHandler.java:186) [rewrite-integration-faces-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226) [rewrite-servlet-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:248) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:191) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:160) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler.handleResult(HttpRewriteResultHandler.java:41) [rewrite-servlet-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at org.ocpsoft.rewrite.servlet.RewriteFilter.rewrite(RewriteFilter.java:297) [rewrite-servlet-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:198) [rewrite-servlet-3.0.0.Alpha6.jar:3.0.0.Alpha6]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:259) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:246) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:75) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:165) [undertow-servlet-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:737) [undertow-core-1.1.0.Beta7.jar:1.1.0.Beta7]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]

    My rule is:

    .addRule(Join.path("/{lang}/{path}").to("/{path}.xhtml"))
    .where("path").transposedBy(LocaleTransposition.bundle("Routes", "lang"));

    Thanks in advance.

    #27114

    Hmmmm… Looks like Rewrite is swallowing the the actual root cause here:

    https://github.com/ocpsoft/rewrite/blob/ccff7625f109b2a9d33ec3aed394dc0dc51792ae/impl-servlet/src/main/java/org/ocpsoft/rewrite/servlet/impl/DefaultHttpRewriteProvider.java#L410

    Could you try to use your debugger to check what the root cause is?

    #27122

    brnovais
    Participant

    Yeah, sure. I can try to give you more information. I don’t know how to get the full stack trace without modifying your code.

    So, at LocaleTransposition:164 you (probably you 🙂 call:
    String targetLang = (String) Parameters.retrieve(context, this.languageParam);
    The problem here, is that targetLang is being returned as null. So, next line at translate, bundleMap is throwing a NullPointerException.

    Well, digging a little more, I found out that at DefaultParameterValueStore:73 is probably where the null is coming from. There we have a map = {}. I think that is happening because ContextBase:41 is returning an empty map.

    org.ocpsoft.rewrite.param.Parameters:24
    return ((ParameterValueStore) context.get(ParameterValueStore.class)).retrieve(((ParameterStore) context.get(ParameterStore.class)).get(string));

    #27123

    brnovais
    Participant

    Maybe it’s because you have a completely new context. At DefaultHttpRewriteProvider:200 you clear the context and create a new DefaultParameterValueStore. This newly created context doesn’t have any information about the language, which I believe should come from the Inbound parameter “lang”. Maybe request binding?

    I don’t know, just thinking about it here. If you need any new data, please let me know.

    Thank you.

    #27125

    This exeception happens during outbound rewriting. I think it is some h:link that is causing this.

    Do you have something like this in your page?

    <h:link outcome="/accounts-0.0.1/signin.xhtml">
      ...
    </h:link>
    

    If yes, could you try to add the language param like this:

    <h:link outcome="/accounts-0.0.1/signin.xhtml">
      <f:param name="lang" value="en" />
      ...
    </h:link>
    
    #27126

    brnovais
    Participant

    Yes, you’re correct. It’s happening only for outbound rewrite. And yes, if I remove the h:link it doesn’t cause the exception.

    So, adding the following code:

    <h:link outcome="/accounts-0.0.1/signin.xhtml" value="Test">
    	<f:param name="lang" value="en" />
    </h:link>

    The exception doesn’t happen, but the page shows the message: Test: this link is disabled because a navigation case could not be matched

    If I remove the context, the exception still happens:

    <h:link outcome="/signin.xhtml" value="Test">
    	<f:param name="lang" value="en" />
    </h:link>

    Do you have any working Internationalize your URLs outbound test? If so, it’s probably my environment.

    Thank you for your time.

    #27131

    So /accounts-0.0.1 is you application context path?

    #27133

    brnovais
    Participant

    That’s correct. I am using a development environment, so I have many application contexts, this is one of them.

    #27134

    You should not include the context path in the h:link. So this is correct:

    <h:link outcome="/signin.xhtml" value="Test">
    	<f:param name="lang" value="en" />
    </h:link>
    

    Could you post the stacktrace of the exception that you get when using this?

    #27135

    brnovais
    Participant

    Calling “C:\Program Files\Wildfly\wildfly-8.2.0.Final\bin\standalone.conf.bat”
    Setting JAVA property to “C:\Program Files\Java\jdk1.8.0_40\bin\java”
    ===============================================================================

    JBoss Bootstrap Environment

    JBOSS_HOME: “C:\Program Files\Wildfly\wildfly-8.2.0.Final”

    JAVA: “C:\Program Files\Java\jdk1.8.0_40\bin\java”

    JAVA_OPTS: “-Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MaxPermSize=256M -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman”

    ===============================================================================

    20:47:41,710 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
    20:47:41,912 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
    20:47:41,983 INFO [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.2.0.Final “Tweek” starting
    20:47:43,282 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
    20:47:43,299 INFO [org.xnio] (MSC service thread 1-5) XNIO version 3.3.0.Final
    20:47:43,307 INFO [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.3.0.Final
    20:47:43,325 INFO [org.wildfly.extension.io] (ServerService Thread Pool — 31) WFLYIO001: Worker ‘default’ has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
    20:47:43,332 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool — 32) JBAS010280: Activating Infinispan subsystem.
    20:47:43,340 INFO [org.jboss.as.naming] (ServerService Thread Pool — 40) JBAS011800: Activating Naming Subsystem
    20:47:43,346 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.
    20:47:43,351 INFO [org.jboss.as.jsf] (ServerService Thread Pool — 38) JBAS012615: Activated the following JSF Implementations: [main]
    20:47:43,352 INFO [org.jboss.as.security] (ServerService Thread Pool — 45) JBAS013171: Activating Security Subsystem
    20:47:43,354 INFO [org.jboss.as.webservices] (ServerService Thread Pool — 48) JBAS015537: Activating WebServices Extension
    20:47:43,357 INFO [org.jboss.as.security] (MSC service thread 1-16) JBAS013170: Current PicketBox version=4.0.21.Final
    20:47:43,375 INFO [org.jboss.as.connector.logging] (MSC service thread 1-11) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.9.Final)
    20:47:43,373 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool — 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
    20:47:43,390 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010417: Started Driver service with driver-name = h2
    20:47:43,400 INFO [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default]
    20:47:43,400 INFO [org.jboss.as.naming] (MSC service thread 1-13) JBAS011802: Starting Naming Service
    20:47:43,421 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool — 47) JBAS017502: Undertow 1.1.0.Final starting
    20:47:43,426 INFO [org.wildfly.extension.undertow] (MSC service thread 1-10) JBAS017502: Undertow 1.1.0.Final starting
    20:47:43,643 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool — 47) JBAS017527: Creating file handler for path C:\Program Files\Wildfly\wildfly-8.2.0.Final/welcome-content
    20:47:43,720 INFO [org.jboss.remoting] (MSC service thread 1-5) JBoss Remoting version 4.0.6.Final
    20:47:43,723 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017525: Started server default-server.
    20:47:43,733 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017531: Host default-host starting
    20:47:43,805 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) JBAS015012: Started FileSystemDeploymentService for directory C:\Program Files\Wildfly\wildfly-8.2.0.Final\standalone\deployments
    20:47:43,808 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of “accounts-0.0.1.war” (runtime-name: “accounts-0.0.1.war”)
    20:47:44,204 INFO [org.wildfly.extension.undertow] (MSC service thread 1-12) JBAS017519: Undertow HTTP listener default listening on /127.0.0.1:8080
    20:47:44,340 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-15) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
    20:47:44,473 INFO [org.jboss.ws.common.management] (MSC service thread 1-8) JBWS022052: Starting JBoss Web Services – Stack CXF Server 4.3.2.Final
    20:47:46,312 INFO [org.jboss.weld.deployer] (MSC service thread 1-12) JBAS016002: Processing weld deployment accounts-0.0.1.war
    20:47:46,369 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-12) HV000001: Hibernate Validator 5.1.3.Final
    20:47:46,569 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
    20:47:46,571 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)
    20:47:46,572 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: accounts-0.0.1.war
    20:47:46,606 INFO [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900: 2.2.6 (Final)
    20:47:46,637 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-15) JBAS010417: Started Driver service with driver-name = accounts-0.0.1.war_com.mysql.jdbc.Driver_5_1
    20:47:46,637 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) JBAS010417: Started Driver service with driver-name = accounts-0.0.1.war_com.mysql.fabric.jdbc.FabricMySQLDriver_5_1
    20:47:46,642 INFO [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016008: Starting weld service for deployment accounts-0.0.1.war
    20:47:47,588 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-8) Inicializando Mojarra 2.2.8-jbossorg-1 20140822-1131 para o contexto ‘/accounts-0.0.1’
    20:47:48,581 INFO [org.ocpsoft.rewrite.faces.RewritePhaseListener] (MSC service thread 1-8) RewritePhaseListener starting up.
    20:47:49,478 INFO [org.wildfly.extension.undertow] (MSC service thread 1-8) JBAS017534: Registered web context: /accounts-0.0.1
    20:47:49,565 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed “accounts-0.0.1.war” (runtime-name : “accounts-0.0.1.war”)
    20:47:49,578 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
    20:47:49,578 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
    20:47:49,579 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final “Tweek” started in 8143ms – Started 314 of 368 services (92 services are lazy, passive or on-demand)
    20:47:59,500 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) RewriteFilter starting up…
    20:47:59,524 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [5] org.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener [org.ocpsoft.rewrite.cdi.bridge.RewriteLifecycleEventBridge<-100>, org.ocpsoft.rewrite.cdi.bridge.RewriteLifecycleEventBridge<-100>, org.ocpsoft.rewrite.faces.FacesRewriteLifecycleListener<0>, org.ocpsoft.rewrite.servlet.impl.DefaultRewriteLifecycleListener<2147483647>, org.ocpsoft.rewrite.servlet.config.lifecycle.JoinRewriteLifecycleListener<2147483647>]
    20:47:59,524 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [3] org.ocpsoft.rewrite.servlet.spi.RequestCycleWrapper [org.ocpsoft.rewrite.cdi.bridge.RequestCycleWrapperBridge<0>, org.ocpsoft.rewrite.servlet.impl.HttpRewriteRequestCycleWrapper<0>, org.ocpsoft.rewrite.cdi.bridge.RequestCycleWrapperBridge<0>]
    20:47:59,524 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [3] org.ocpsoft.rewrite.spi.RewriteProvider [org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider<0>, org.ocpsoft.rewrite.cdi.bridge.RewriteProviderBridge<100>, org.ocpsoft.rewrite.cdi.bridge.RewriteProviderBridge<100>]
    20:47:59,525 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [1] org.ocpsoft.rewrite.servlet.spi.RewriteResultHandler [org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler<0>]
    20:47:59,525 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [1] org.ocpsoft.rewrite.servlet.spi.InboundRewriteProducer [org.ocpsoft.rewrite.servlet.impl.HttpInboundRewriteProducer<0>]
    20:47:59,525 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [1] org.ocpsoft.rewrite.servlet.spi.OutboundRewriteProducer [org.ocpsoft.rewrite.servlet.impl.HttpOutboundRewriteProducer<0>]
    20:47:59,526 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [0] org.ocpsoft.rewrite.servlet.spi.ContextListener []
    20:47:59,527 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [0] org.ocpsoft.rewrite.servlet.spi.RequestListener []
    20:47:59,527 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [0] org.ocpsoft.rewrite.servlet.spi.RequestParameterProvider []
    20:47:59,531 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [3] org.ocpsoft.rewrite.el.spi.ExpressionLanguageProvider [org.ocpsoft.rewrite.cdi.CdiExpressionLanguageProvider<10>, org.ocpsoft.rewrite.cdi.CdiExpressionLanguageProvider<10>, org.ocpsoft.rewrite.faces.FacesExpressionLanguageProvider<30>]
    20:47:59,534 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [1] org.ocpsoft.rewrite.spi.InvocationResultHandler [org.ocpsoft.rewrite.faces.NavigatingInvocationResultHandler<100>]
    20:47:59,535 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [2] org.ocpsoft.common.spi.ServiceEnricher [org.ocpsoft.rewrite.cdi.CdiServiceEnricher, org.ocpsoft.rewrite.cdi.CdiServiceEnricher]
    20:47:59,537 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [1] org.ocpsoft.rewrite.spi.ConfigurationCacheProvider [org.ocpsoft.rewrite.servlet.impl.ServletContextConfigurationCacheProvider<0>]
    20:47:59,540 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Loaded [1] org.ocpsoft.rewrite.config.ConfigurationProvider [org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>]
    20:47:59,545 INFO [org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider] (default task-1) Loaded [0] org.ocpsoft.rewrite.spi.RuleCacheProvider []
    20:47:59,601 INFO [org.ocpsoft.rewrite.param.DefaultParameterStore] (default task-1) Loaded [1] org.ocpsoft.rewrite.spi.GlobalParameterProvider [org.ocpsoft.rewrite.instance.WildcardParameterProvider<0>]
    20:47:59,634 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (default task-1) Rewrite 3.0.0-SNAPSHOT initialized.
    20:47:59,650 INFO [org.ocpsoft.rewrite.param.DefaultParameterValueStore] (default task-1) Loaded [1] org.ocpsoft.rewrite.spi.GlobalParameterProvider [org.ocpsoft.rewrite.instance.WildcardParameterProvider<0>]
    20:47:59,654 INFO [org.ocpsoft.rewrite.config.Log] (default task-1) INBOUND: /pt/entrar
    20:47:59,661 INFO [org.ocpsoft.rewrite.config.Log] (default task-1) INBOUND: /signin.xhtml
    20:47:59,948 ERROR [stderr] (default task-1) java.lang.NullPointerException
    20:47:59,948 ERROR [stderr] (default task-1) at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
    20:47:59,948 ERROR [stderr] (default task-1) at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:964)
    20:47:59,948 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.transposition.LocaleTransposition.translate(LocaleTransposition.java:82)
    20:47:59,948 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.transposition.LocaleTransposition.transpose(LocaleTransposition.java:165)
    20:47:59,949 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.transposition.LocaleTransposition.transpose(LocaleTransposition.java:47)
    20:47:59,949 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.param.DefaultParameterValueStore.submit(DefaultParameterValueStore.java:95)
    20:47:59,949 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.param.RegexParameterizedPatternParser$RegexParameterizedPatternMatchResult.submit(RegexParameterizedPatternParser.java:381)
    20:47:59,949 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.config.Path.evaluateHttp(Path.java:138)
    20:47:59,949 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.config.HttpCondition.evaluate(HttpCondition.java:44)
    20:47:59,949 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.config.And.evaluate(And.java:78)
    20:47:59,950 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.config.DefaultConditionBuilder$1.evaluate(DefaultConditionBuilder.java:46)
    20:47:59,950 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.config.rule.Join.evaluate(Join.java:224)
    20:47:59,950 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.config.RuleBuilder.evaluate(RuleBuilder.java:154)
    20:47:59,950 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.rewriteOutbound(DefaultHttpRewriteProvider.java:351)
    20:47:59,950 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.rewriteHttp(DefaultHttpRewriteProvider.java:92)
    20:47:59,950 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.http.HttpRewriteProvider.rewrite(HttpRewriteProvider.java:43)
    20:47:59,950 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.rewrite(HttpRewriteWrappedResponse.java:438)
    20:47:59,951 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.encodeURL(HttpRewriteWrappedResponse.java:397)
    20:47:59,951 ERROR [stderr] (default task-1) at com.sun.faces.context.ExternalContextImpl.encodeActionURL(ExternalContextImpl.java:604)
    20:47:59,951 ERROR [stderr] (default task-1) at com.sun.faces.application.view.MultiViewHandler.getBookmarkableURL(MultiViewHandler.java:407)
    20:47:59,951 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.faces.RewriteViewHandler.getBookmarkableURL(RewriteViewHandler.java:164)
    20:47:59,951 ERROR [stderr] (default task-1) at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272)
    20:47:59,951 ERROR [stderr] (default task-1) at org.jboss.weld.jsf.ConversationAwareViewHandler.getBookmarkableURL(ConversationAwareViewHandler.java:132)
    20:47:59,951 ERROR [stderr] (default task-1) at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272)
    20:47:59,951 ERROR [stderr] (default task-1) at com.sun.faces.renderkit.html_basic.OutcomeTargetRenderer.getEncodedTargetURL(OutcomeTargetRenderer.java:194)
    20:47:59,952 ERROR [stderr] (default task-1) at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.renderAsActive(OutcomeTargetLinkRenderer.java:158)
    20:47:59,952 ERROR [stderr] (default task-1) at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.encodeBegin(OutcomeTargetLinkRenderer.java:96)
    20:47:59,952 ERROR [stderr] (default task-1) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:864)
    20:47:59,952 ERROR [stderr] (default task-1) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854)
    20:47:59,952 ERROR [stderr] (default task-1) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    20:47:59,952 ERROR [stderr] (default task-1) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    20:47:59,952 ERROR [stderr] (default task-1) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
    20:47:59,952 ERROR [stderr] (default task-1) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
    20:47:59,953 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.faces.RewriteViewHandler.renderView(RewriteViewHandler.java:186)
    20:47:59,953 ERROR [stderr] (default task-1) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
    20:47:59,953 ERROR [stderr] (default task-1) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
    20:47:59,953 ERROR [stderr] (default task-1) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    20:47:59,953 ERROR [stderr] (default task-1) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    20:47:59,953 ERROR [stderr] (default task-1) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    20:47:59,953 ERROR [stderr] (default task-1) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    20:47:59,954 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
    20:47:59,954 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
    20:47:59,954 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
    20:47:59,954 ERROR [stderr] (default task-1) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
    20:47:59,954 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
    20:47:59,954 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
    20:47:59,955 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
    20:47:59,955 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    20:47:59,955 ERROR [stderr] (default task-1) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    20:47:59,955 ERROR [stderr] (default task-1) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    20:47:59,955 ERROR [stderr] (default task-1) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    20:47:59,955 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
    20:47:59,955 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:192)
    20:47:59,955 ERROR [stderr] (default task-1) at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:160)
    20:47:59,956 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler.handleResult(HttpRewriteResultHandler.java:41)
    20:47:59,956 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.RewriteFilter.rewrite(RewriteFilter.java:297)
    20:47:59,956 ERROR [stderr] (default task-1) at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:198)
    20:47:59,956 ERROR [stderr] (default task-1) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
    20:47:59,956 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
    20:47:59,957 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
    20:47:59,957 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
    20:47:59,957 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    20:47:59,957 ERROR [stderr] (default task-1) at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    20:47:59,957 ERROR [stderr] (default task-1) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    20:47:59,957 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
    20:47:59,957 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
    20:47:59,958 ERROR [stderr] (default task-1) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    20:47:59,958 ERROR [stderr] (default task-1) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
    20:47:59,958 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63)
    20:47:59,958 ERROR [stderr] (default task-1) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
    20:47:59,958 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
    20:47:59,958 ERROR [stderr] (default task-1) at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
    20:47:59,958 ERROR [stderr] (default task-1) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    20:47:59,958 ERROR [stderr] (default task-1) at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    20:47:59,958 ERROR [stderr] (default task-1) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    20:47:59,959 ERROR [stderr] (default task-1) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    20:47:59,959 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261)
    20:47:59,959 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247)
    20:47:59,959 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76)
    20:47:59,959 ERROR [stderr] (default task-1) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166)
    20:47:59,959 ERROR [stderr] (default task-1) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197)
    20:47:59,959 ERROR [stderr] (default task-1) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)
    20:47:59,959 ERROR [stderr] (default task-1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    20:47:59,960 ERROR [stderr] (default task-1) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    20:47:59,960 ERROR [stderr] (default task-1) at java.lang.Thread.run(Thread.java:745)

    20:51:54,602 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-15) JBAS010418: Stopped Driver service with driver-name = accounts-0.0.1.war_com.mysql.jdbc.Driver_5_1
    20:51:54,604 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-15) JBAS010418: Stopped Driver service with driver-name = accounts-0.0.1.war_com.mysql.fabric.jdbc.FabricMySQLDriver_5_1
    20:51:54,612 INFO [org.wildfly.extension.undertow] (MSC service thread 1-15) JBAS017535: Unregistered web context: /accounts-0.0.1
    20:51:54,628 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (MSC service thread 1-15) RewriteFilter shutting down…
    20:51:54,628 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (MSC service thread 1-15) RewriteFilter deactivated.
    20:51:54,637 INFO [org.wildfly.extension.undertow] (MSC service thread 1-16) JBAS017532: Host default-host stopping
    20:51:54,644 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010409: Unbound data source [java:jboss/datasources/ExampleDS]
    20:51:54,645 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016009: Stopping weld service for deployment accounts-0.0.1.war
    20:51:54,650 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-16) JBAS010418: Stopped Driver service with driver-name = h2
    20:51:54,669 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017521: Undertow HTTP listener default suspending
    20:51:54,670 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017520: Undertow HTTP listener default stopped, was bound to /127.0.0.1:8080
    20:51:54,671 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017506: Undertow 1.1.0.Final stopping
    20:51:54,773 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment accounts-0.0.1.war (runtime-name: accounts-0.0.1.war) in 196ms
    20:51:54,785 INFO [org.jboss.as] (MSC service thread 1-1) JBAS015950: WildFly 8.2.0.Final “Tweek” stopped in 194ms

    #27136

    And this only happens if you include this link in the page?

    <h:link outcome="/signin.xhtml" value="Test">
    	<f:param name="lang" value="en" />
    </h:link>
    

    I just want to make sure that this link is really the one causing this exception. Could you double check?

    #27137

    brnovais
    Participant

    Yes, I am positive. When I remove this part of the code, it works.
    Just created a new project. Full source code below.

    ConfigurationProviderLocalized.java

    @RewriteConfiguration
    public class ConfigurationProviderLocalized extends HttpConfigurationProvider {
    	@Override
    	public int priority() {
    		return 50;
    	}
    
    	@Override
    	public Configuration getConfiguration(ServletContext context) {
    		ConfigurationBuilder lReturnConfig = ConfigurationBuilder.begin();
    
    		lReturnConfig.addRule(Join.path("/{lang}/{path}").to("/{path}.xhtml"))
    		.where("path").transposedBy(LocaleTransposition.bundle("test.Routes", "lang"));
    
    		return lReturnConfig;
    	}
    }

    ConfigurationProviderDebug.java

    @RewriteConfiguration
    public class ConfigurationProviderDebug extends HttpConfigurationProvider {
    	@Override
    	public int priority() {
    		return 1;
    	}
    
    	@Override
    	public Configuration getConfiguration(ServletContext context) {
    		ConfigurationBuilder lReturnConfig = ConfigurationBuilder.begin();
    
    		lReturnConfig.addRule()
    		.when(Direction.isInbound().and(Path.matches("{path}")))
    		.perform(Log.message(Level.INFO, "INBOUND: {path}"))
    		.where("path").matches(".*");
    
    		lReturnConfig.addRule()
    		.when(Direction.isOutbound().and(Path.matches("{path}")))
    		.perform(Log.message(Level.INFO, "OUTBOUND: {path}"))
    		.where("path").matches(".*");
    
    		return lReturnConfig;
    	}
    }

    signin.xhtml

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
    	<h:head>
    		<meta charset="utf-8" />
    		<title>Test</title>
    	</h:head>
    	<h:body>
    		<h:link outcome="/signin.xhtml" value="Test">
    			<f:param name="lang" value="en" />
    		</h:link>
    	</h:body>
    </html>

    Routes_en.properties
    signin=signin

    Routes_pt.properties
    entrar=signin

    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    		http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    
    	<context-param>
    		<param-name>javax.faces.PROJECT_STAGE</param-name>
    		<param-value>Development</param-value>
    	</context-param>
    
    	<servlet>
    		<servlet-name>Faces Servlet</servlet-name>
    		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    	</servlet>
    
    	<servlet-mapping>
    		<servlet-name>Faces Servlet</servlet-name>
    		<url-pattern>*.xhtml</url-pattern>
    	</servlet-mapping>
    </web-app>

    pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    	<modelVersion>4.0.0</modelVersion>
    
    	<groupId>test</groupId>
    	<artifactId>accounts</artifactId>
    	<packaging>war</packaging>
    	<version>0.0.1</version>
    
    	<properties>
    		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    	</properties>
    
    	<build>
    		<plugins>
    			<plugin>
    				<groupId>org.apache.maven.plugins</groupId>
    				<artifactId>maven-compiler-plugin</artifactId>
    				<version>3.2</version>
    				<configuration>
    					<source>1.8</source>
    					<target>1.8</target>
    				</configuration>
    			</plugin>
    
    			<plugin>
    				<groupId>org.wildfly.plugins</groupId>
    				<artifactId>wildfly-maven-plugin</artifactId>
    				<version>1.0.2.Final</version>
    			</plugin>
    		</plugins>
    	</build>
    
    	<dependencies>
    		<dependency>
    			<groupId>junit</groupId>
    			<artifactId>junit</artifactId>
    			<version>4.12</version>
    			<scope>test</scope>
    		</dependency>
    
    		<dependency>
    			<groupId>javax.servlet</groupId>
    			<artifactId>javax.servlet-api</artifactId>
    			<version>3.1.0</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>javax.faces</groupId>
    			<artifactId>javax.faces-api</artifactId>
    			<version>2.2</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>javax.enterprise</groupId>
    			<artifactId>cdi-api</artifactId>
    			<version>1.2</version>
    			<scope>provided</scope>
    		</dependency>
    
    		<dependency>
    			<groupId>org.ocpsoft.rewrite</groupId>
    			<artifactId>rewrite-servlet</artifactId>
    			<version>3.0.0.Alpha6</version>
    			<scope>compile</scope>
    		</dependency>
    		<dependency>
    			<groupId>org.ocpsoft.rewrite</groupId>
    			<artifactId>rewrite-integration-faces</artifactId>
    			<version>3.0.0.Alpha6</version>
    			<scope>compile</scope>
    		</dependency>
    		<dependency>
    			<groupId>org.ocpsoft.rewrite</groupId>
    			<artifactId>rewrite-integration-cdi</artifactId>
    			<version>3.0.0.Alpha6</version>
    			<scope>compile</scope>
    		</dependency>
    	</dependencies>
    </project>
    #27138

    Hmmm. It’s difficult to tell what is going wrong here. I’ve just a guess. The transposition is applies while the parameter value is stored in the ParameterValueStore. So AFAIK the order of submissions is important here. The lang parameter must be submitted to the store BEFORE the path parameter is submitted.

    I remember Lincoln change something regarding evaluation ordering in the early 3.0.0.Alpha releases. Could you check if this also happens with 2.0.12.Final?

    #27139

    brnovais
    Participant

    Yeah, sure. Just cleaned maven and altered my pom.xml to:

    <dependency>
    	<groupId>org.ocpsoft.rewrite</groupId>
    	<artifactId>rewrite-servlet</artifactId>
    	<version>2.0.12.Final</version>
    	<scope>compile</scope>
    </dependency>
    <dependency>
    	<groupId>org.ocpsoft.rewrite</groupId>
    	<artifactId>rewrite-integration-faces</artifactId>
    	<version>2.0.12.Final</version>
    	<scope>compile</scope>
    </dependency>
    <dependency>
    	<groupId>org.ocpsoft.rewrite</groupId>
    	<artifactId>rewrite-integration-cdi</artifactId>
    	<version>2.0.12.Final</version>
    	<scope>compile</scope>
    </dependency>

    Unfortunately, the exception is still happening (I don’t know if is the same). But this time, Rewrite is not swallowing the root cause. Stack Trace:

    java.lang.NullPointerException
    	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
    	at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:964)
    	at org.ocpsoft.rewrite.transposition.LocaleTransposition.translate(LocaleTransposition.java:82)
    	at org.ocpsoft.rewrite.transposition.LocaleTransposition.transpose(LocaleTransposition.java:165)
    	at org.ocpsoft.rewrite.transposition.LocaleTransposition.transpose(LocaleTransposition.java:47)
    	at org.ocpsoft.rewrite.param.DefaultParameterValueStore.submit(DefaultParameterValueStore.java:68)
    	at org.ocpsoft.rewrite.param.RegexParameterizedPatternParser.matches(RegexParameterizedPatternParser.java:145)
    	at org.ocpsoft.rewrite.servlet.config.Path.evaluateHttp(Path.java:124)
    	at org.ocpsoft.rewrite.servlet.config.HttpCondition.evaluate(HttpCondition.java:44)
    	at org.ocpsoft.rewrite.config.And.evaluate(And.java:77)
    	at org.ocpsoft.rewrite.servlet.config.rule.Join.evaluate(Join.java:222)
    	at org.ocpsoft.rewrite.config.And.evaluate(And.java:77)
    	at org.ocpsoft.rewrite.config.RuleBuilder.evaluate(RuleBuilder.java:129)
    	at org.ocpsoft.rewrite.config.And.evaluate(And.java:77)
    	at org.ocpsoft.rewrite.config.RuleBuilder.evaluate(RuleBuilder.java:129)
    	at org.ocpsoft.rewrite.config.And.evaluate(And.java:77)
    	at org.ocpsoft.rewrite.config.RuleBuilder.evaluate(RuleBuilder.java:129)
    	at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.rewriteHttp(DefaultHttpRewriteProvider.java:165)
    	at org.ocpsoft.rewrite.servlet.http.HttpRewriteProvider.rewrite(HttpRewriteProvider.java:43)
    	at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.rewrite(HttpRewriteWrappedResponse.java:432)
    	at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.encodeURL(HttpRewriteWrappedResponse.java:391)
    	at com.sun.faces.context.ExternalContextImpl.encodeActionURL(ExternalContextImpl.java:604)
    	at com.sun.faces.application.view.MultiViewHandler.getBookmarkableURL(MultiViewHandler.java:407)
    	at org.ocpsoft.rewrite.faces.RewriteViewHandler.getBookmarkableURL(RewriteViewHandler.java:164)
    	at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272)
    	at org.jboss.weld.jsf.ConversationAwareViewHandler.getBookmarkableURL(ConversationAwareViewHandler.java:132)
    	at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272)
    	at com.sun.faces.renderkit.html_basic.OutcomeTargetRenderer.getEncodedTargetURL(OutcomeTargetRenderer.java:194)
    	at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.renderAsActive(OutcomeTargetLinkRenderer.java:158)
    	at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.encodeBegin(OutcomeTargetLinkRenderer.java:96)
    	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:864)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
    	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
    	at org.ocpsoft.rewrite.faces.RewriteViewHandler.renderView(RewriteViewHandler.java:186)
    	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
    	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
    	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:205)
    	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
    	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
    	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
    	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
    	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:192)
    	at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:160)
    	at org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler.handleResult(HttpRewriteResultHandler.java:41)
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.rewrite(RewriteFilter.java:268)
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:188)
    	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
    	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
    	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
    	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
    	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
    	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63)
    	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
    	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
    	at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261)
    	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247)
    	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76)
    	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166)
    	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197)
    	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)

    Component Tree:

    <UIViewRoot id="j_id1" inView="true" locale="pt_BR" renderKitId="HTML_BASIC" rendered="true" transient="false" viewId="/signin.xhtml">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <UIOutput id="j_idt2" inView="true" rendered="true" transient="false">
            <meta charset="utf-8"/> <title>Test</title>
        </UIOutput>
        <HtmlBody id="j_idt4" inView="true" rendered="true" transient="false">
            <HtmlOutcomeTargetLink disableClientWindow="false" disabled="false" id="j_idt5" inView="true" includeViewParams="false" outcome="/signin.xhtml" rendered="true" transient="false" value="Test">
                <UIParameter disable="false" id="j_idt6" inView="true" name="lang" rendered="true" transient="false" value="en"/>
            </HtmlOutcomeTargetLink>
        </HtmlBody>
        </html>
    </UIViewRoot>

    and, Scoped Variables (Request Parameters):

    Name	Value
    lang	pt
    path	signin
    #27140

    To be honest, I’ve absolutely no idea what is causing this. But I also don’t know much about the LocaleTransposition class. AFAIK it was a contribution from the community. See:

    https://github.com/ocpsoft/rewrite/issues/162

    My guess is (as already mentioned above), that the parameters are submitted to the store in the wrong order. That would explain it. However, the transposition seems to work for others I think. That’s the thing that is confusing.

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in to reply to this topic.

Comments are closed.