Error using outcome="pretty:clientView"

Splash Forums Rewrite Users Error using outcome="pretty:clientView"

This topic contains 6 replies, has 2 voices, and was last updated by  Christian Kaltepoth 12 hours, 30 minutes ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #27484

    esteveavi
    Participant

    Hi,

    I am getting the following error when using :

    17:26:26,636 ERROR [cat.tmb.tdo.ocicommerce.backoffice.exceptionhandling.handlers.LogExceptionHandler] (default task-17) LogException Handler: : java.lang.NullPointerException
    	at java.net.URLEncoder.encode(URLEncoder.java:204)
    	at com.sun.faces.context.UrlBuilder.addValuesToParameter(UrlBuilder.java:318)
    	at com.sun.faces.context.UrlBuilder.addParameters(UrlBuilder.java:127)
    	at com.sun.faces.context.ExternalContextImpl.encodeBookmarkableURL(ExternalContextImpl.java:1059)
    	at javax.faces.context.ExternalContextWrapper.encodeBookmarkableURL(ExternalContextWrapper.java:966)
    	at javax.faces.context.ExternalContextWrapper.encodeBookmarkableURL(ExternalContextWrapper.java:966)
    	at com.sun.faces.application.view.MultiViewHandler.getBookmarkableURL(MultiViewHandler.java:408)
    	at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272)
    	at org.ocpsoft.rewrite.faces.RewriteViewHandler.getBookmarkableURL(RewriteViewHandler.java:174)
    	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 org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeBegin(ExtValLazyRendererProxy.java:62)
    	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeBegin(ExtValRendererWrapper.java:212)
    	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:865)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854)
    	at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
    	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeChildren(ExtValLazyRendererProxy.java:69)
    	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeChildren(ExtValRendererWrapper.java:285)
    	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:890)
    	at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:85)
    	at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
    	at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeMarkup(OutputPanelRenderer.java:65)
    	at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeEnd(OutputPanelRenderer.java:41)
    	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeEnd(ExtValLazyRendererProxy.java:76)
    	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:358)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:920)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    	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:458)
    	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134)
    	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
    	at org.ocpsoft.rewrite.faces.RewriteViewHandler.renderView(RewriteViewHandler.java:196)
    	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 org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.render(DeltaSpikeLifecycleWrapper.java:111)
    	at javax.faces.lifecycle.LifecycleWrapper.render(LifecycleWrapper.java:92)
    	at org.apache.deltaspike.jsf.impl.listener.request.JsfClientWindowAwareLifecycleWrapper.render(JsfClientWindowAwareLifecycleWrapper.java:160)
    	at org.apache.myfaces.extensions.validator.core.startup.ExtValLifecycleWrapper.render(ExtValLifecycleWrapper.java:77)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
    	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
    	at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:78)
    	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
    	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    	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:266)
    	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:201)
    	at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:202)
    	at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:109)
    	at org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler.handleResult(HttpRewriteResultHandler.java:42)
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.rewrite(RewriteFilter.java:297)
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:198)
    	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at cat.tmb.tdo.ocicommerce.backoffice.view.filters.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:33)
    	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
    	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    	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:57)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
    	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    	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:285)
    	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)
    	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
    	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)
    	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
    	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:802)
    	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)
    

    I am using JBoss EAP 7 and rewrite-config-prettyfaces-3.4.1.Final, rewrite-integration-faces-3.4.1.Final and rewrite-servlet-3.4.1.Final.

    Can anybody help us?

    Thanks in advance.

    Regards,

    #27486

    Does this also happen if you use the plain view id in the outcome attribute like you would without using Rewrite?

    #27487

    esteveavi
    Participant

    Christian,

    Thanks for the reply. Tried what you said and the null pointer does not appear but the link doesn’t render.

    Thanks

    #27488

    What do you mean with “doesn’t render”? Is there no HTML output at all or just an broken href part?

    Could you also include the relevant part of the page and your configuration?

    #27489

    esteveavi
    Participant

    Hi Cristian,

    Thank you very much for your support.

    First I had:
    <h:link outcome=”pretty:clientView”>
    <f:param name=”entityId”
    value=”#{empresaBean.entity.client.id}” />
    <h:outputText id=”empresaBeanClient” value=”#{empresaBean.entity.client.codi} – #{empresaBean.entity.client.nom}” />
    </h:link>

    In pretty-config.xml:
    <url-mapping id=”clientView”>
    <pattern value=”/mestres/client/client/view/#{entityId: clientBean.entityId}”/>
    <view-id value=”/view/mestres/client/client/view.xhtml”/>
    </url-mapping>

    Then I get the null pointer.

    If I change:

    <h:link outcome=”clientView”>
    <f:param name=”entityId”
    value=”#{empresaBean.entity.client.id}” />
    <h:outputText id=”empresaBeanClient” value=”#{empresaBean.entity.client.codi} – #{empresaBean.entity.client.nom}” />
    </h:link>

    Then I get:
    09:52:16,135 WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-3) JSF1064: no se encuentra o sirve el recurso, /view/mestres/mestres/empresa/clientView.xhtml.
    09:52:16,135 WARNING [javax.enterprise.resource.webcontainer.jsf.renderkit] (default task-3) JSF1090: no se ha resuelto el tipo de navegación para el componente j_idt323.

    Salutacions,

    #27490

    Ah, OK. I think my last post was a bit misleading. With “plain view id” I was referring to the full plain JSF view id. Some you should use:

    <h:link outcome=”/view/mestres/client/client/view.xhtml”>
    ....
    </h:link>
    

    Using the Prettyfaces ID without the pretty: prefix won’t work.

    #27491

    BTW: If you are just starting to use Rewrite, you should consider dropping the PrettyFaces module and use the plain new Rewrite API. There is an migration guide available here:

    https://github.com/ocpsoft/rewrite/blob/master/documentation/src/main/asciidoc/migration/prettyfaces3.asciidoc

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

You must be logged in to reply to this topic.

Comments are closed.