java.lang.IllegalArgumentException: Url cannot be empty

Splash Forums Rewrite Users java.lang.IllegalArgumentException: Url cannot be empty

This topic contains 11 replies, has 3 voices, and was last updated by  Lincoln Baxter III 4 years, 6 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #18889

    LataGreemimax
    Participant

    Hi

    I’m trying to include prettyfaces in my project and have the following exception:

    java.lang.IllegalArgumentException: Url cannot be empty
    at com.sun.faces.context.UrlBuilder.<init>(UrlBuilder.java:86)
    at com.sun.faces.context.ExternalContextImpl.encodePartialActionURL(ExternalContextImpl.java:942)
    at com.sun.faces.renderkit.html_basic.FormRenderer.encodeBegin(FormRenderer.java:170)
    at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)
    at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:52)
    at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:43)
    at org.primefaces.component.dialog.DialogRenderer.encodeContent(DialogRenderer.java:173)
    at org.primefaces.component.dialog.DialogRenderer.encodeMarkup(DialogRenderer.java:103)
    ...

    web.xml


    ....
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <filter>
    <filter-name>Pretty Filter</filter-name>
    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
    </filter>

    <filter-mapping>
    <filter-name>Pretty Filter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <filter>
    <filter-name>HibernateFilter</filter-name>
    <filter-class>ch.futuretek.merkur.filter.HibernateSessionRequestFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>HibernateFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    ....


    backing bean


    ....
    @ManagedBean(name = "catalogIndex")
    @ViewScoped
    @URLMapping(id = "home", pattern = "/", viewId = "/public/index.jsf")
    public class CatalogIndex implements Serializable{
    ...


    and I’m still using the faces-config.xml navigation rules. I’m not sure if its wrong?


    ....
    <navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
    <from-outcome>login</from-outcome>
    <to-view-id>/login.jsf</to-view-id>
    <redirect />
    </navigation-case>
    ...


    Thanks for any help!

    naxxx

    #23157

    Your setup looks fine for me. I’ve no idea what this causing this exception.

    Could you tell us a bit more about your environment? Which container do you deploy to? Which version of Mojarra are you using? Which PrettyFaces version did you test with?

    If you are using PrettyFaces, you typically don’t need navigation rules any more. But still using them shouldn’t cause an exception like this.

    #23158

    LataGreemimax
    Participant

    Hi and thanks for the reply.

    I’m using the following core libs:

    javax.faces-2.1.11.jar

    hibernate-core-4.1.3.Final.jar

    prettyfaces-jsf2-3.3.3.jar

    primefaces-3.4.jar

    If you need more information about the evironment please let me know.

    #23159

    Hmmm. This is very weird. I had a look at the Mojarra sources. It looks like the ViewHandler returns null or an empty string in your case. My first guess is that it’s not the PrettyViewHandler that is causing this. Are you using any other JSF libraries? Or are using some own custom ViewHandler?

    I think some debugging would be helpful? Any chance that you can debug a bit and check why FormRenderer in line 166 gets an empty URL from the ViewHandler?

    Or could you create a minimal sample app that reproduces this. In this case I could help with the debugging.

    Thanks

    #23160

    LataGreemimax
    Participant

    I don’t have any custom ViewHandler.

    I’ve just Hibernate and the dependencies of it, Primefaces and many templates of it, Facelets and Prettyfaces.

    I try to upload the project but its 22.5mb. Can I share it in an other way?

    #23161

    22MB is a bit huge. Could you try to strip it down a bit? Or try to create a minimal empty webapp that reproduces it?

    BTW: What container do you deploy it to?

    #23162

    LataGreemimax
    Participant

    Ok thanks very much!!!

    I found the problem by striping the project.

    It was this lib:

    rewrite-integration-faces-1.1.0.Final.jar

    best regards

    naxxx

    #23163

    Ah, OK. So you had rewrite-integration-faces without rewrite-servlet on your classpath? I think this could really have caused some issue. Nice to hear you got it working. :)

    #23164

    LataGreemimax
    Participant

    No I had and still have the rewrite-servlet too…

    #23165

    I recently saw this bug pop up when writing the PF4 rewrite compatibility module. I haven’t been able to reproduce it again yet. Do you think it’s possible you could help us figure this out by uploading your stripped down example app?

    Thanks!

    ~Lincoln

    #23166

    LataGreemimax
    Participant

    Of course.

    I’m working on it.

    #23167

    Thanks!

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

You must be logged in to reply to this topic.

Comments are closed.