Primefaces FileUpload and Prettfaces Error

Splash Forums PrettyFaces Users Primefaces FileUpload and Prettfaces Error

This topic contains 31 replies, has 5 voices, and was last updated by  Lincoln Baxter III 7 years, 11 months ago.

Viewing 15 posts - 16 through 30 (of 32 total)
  • Author
    Posts
  • #20324

    xuzhike
    Participant

    Hi, Kency, maybe you can create a simple web project, and copy web.xml and pretty-config.xml from Lincoln’s test project. that’s my way.:) it really works.

    #20325

    Yeah that’ll work. Just make sure you have all the dependencies listed in the pom.xml file!

    #20326

    kency
    Participant

    i think i should try with maven, i following xuzhike way but it not solve problem, i’ll try with maven

    #20327

    xuzhike
    Participant

    Hi, Kency, which primefaces version are you using? please try the 2.1.0 or 2.2 RC. try the simpliest project as Lincoln’s test one and use tomcat6.

    I did NOT test it in GF.

    #20328

    kency
    Participant

    i use GF :) and Primefaces 2.2RC and JSF 2.0 :)

    #20329

    parindam
    Participant

    Hi,

    I have prettyfaces and primefaces in my application.

    I have tried to configure it same as http://ocpsoft.com/wp-content/uploads/2010/11/pretty-prime-test.zip

    In my pretty-config.xml, I get the following error message. Am I doing anything wrong ?

    cvc-complex-type.2.1: Element ‘view-id’ must have no character or element information item [children], because the type’s content type is

    empty.


    My pretty-config.xml is as follows.

    <pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.1.1″

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”

    xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.1.1

    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.1.1.xsd“>

    <!– Begin Example RewriteRules

    // These are custom rewrite-rules, and are probably not necessary for your application.

    <rewrite match=”^/old-url/(w+)/$” substitute=”/new_url/$1/” redirect=”301″ />

    –>

    <url-mapping id=”brand”>

    <pattern value=”/brand/#{ brandID : buyBacking.selectedBrandID }/” />

    <view-id> /faces/brand/buyBrand.xhtml </view-id>

    </url-mapping>

    Thanks,

    Arindam.

    #20330

    parindam
    Participant

    Hi,

    I have prettyfaces and primefaces in my application.

    I have tried to configure it same as http://ocpsoft.com/wp-content/uploads/2010/11/pretty-prime-test.zip

    In my pretty-config.xml, I get the following error message. Am I doing anything wrong ?

    cvc-complex-type.2.1: Element ‘view-id’ must have no character or element information item [children], because the type’s content type is

    empty.


    My pretty-config.xml is as follows.

    <pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.1.1″

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”

    xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.1.1

    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.1.1.xsd“>

    <!– Begin Example RewriteRules

    // These are custom rewrite-rules, and are probably not necessary for your application.

    <rewrite match=”^/old-url/(w+)/$” substitute=”/new_url/$1/” redirect=”301″ />

    –>

    <url-mapping id=”brand”>

    <pattern value=”/brand/#{ brandID : buyBacking.selectedBrandID }/” />

    <view-id> /faces/brand/buyBrand.xhtml </view-id>

    </url-mapping>

    Thanks,

    Arindam.

    #20331

    Hey Arindam,

    I think your configuration is correct. Do you get the error from Eclipse? It seems like Eclipse is validating the PrettyFaces configuration against the schema. Perhaps the schema is not correct regarding the view-id.

    I think you can ignore the error or remove the xsi:schemaLocation attribute from your file. The configuration should work like expected at runtime.

    I’ll check the XSD so this will get fixed in the next release.

    Christian

    #20332

    parindam
    Participant

    Thank you Christian.

    You are right. I am getting these errors from eclipse.

    I’ll check it out your suggestion to ignore them.

    I am using prettyfaces 3.2.0 jar. when I change this to 3.2.0 as follows in pretty-config.xml, I get 2 errors from eclipse,

    1. cvc-elt.1: Cannot find the declaration of element ‘pretty-config’.

    2. Referenced file contains errors (http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.2.0.xsd). For more information, right click on the message in the Problems View and select “Show Details…”


    <pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.2.0″

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”

    xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.2.0

    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.2.0.xsd“>

    #20333

    It really looks like the current PrettyFaces XSD file is broken.

    I think you should temporarily remove the xsi:schemaLocation attribute from pretty-config. This way Eclipse won’t validate the file.

    However we should review the XSD file so that this doesn’t happen in the future any more.

    #20337

    I’ve gone ahead and updated the file, if you clear the eclipse cache, it should be working now. Sorry for this rather brainless oversight :)

    ~Lincoln

    Domdorn found the issue:

    hmm... this is not working on the forum for some reason.. thats my post:

    Its because the
    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.2.0.xsd
    xsd file still references the 3.1.1 as the namespace, thus
    http://ocpsoft.com/prettyfaces/3.2.0 is a namespace not bound to any
    rules and thus eclipse complaints.

    solution:
    update the file
    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.2.0.xsd

    to start with
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://ocpsoft.com/prettyfaces/3.2.0"
    xmlns="http://ocpsoft.com/prettyfaces/3.2.0">

    instead of

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://ocpsoft.com/prettyfaces/3.1.1"
    xmlns="http://ocpsoft.com/prettyfaces/3.1.1">

    #20338

    @parindam,

    When you are able, could you please verify that the errors no longer appear in Eclipse once the cache has been cleared?

    Thanks,

    Lincoln

    #20339

    parindam
    Participant

    @lincoln

    Sorry for my late reply..

    yes, after clearing the cache and changing the version to 3.2.0, I do not see these errors now. But, the error changed to the following location.

    [cvc-complex-type.2.1: Element ‘view-id’ must have no character or element information item [children], because the type’s content type is empty.]

    <url-mapping id=”brand”>

    <pattern value=”/brand/#{ brandID : buyBacking.selectedBrandID }/” />

    <view-id> /faces/brand/buyBrand.xhtml </view-id>

    </url-mapping>

    @Christian

    If I remove the xsi:schemaLocation, I only get the following warning and the above error goes off.

    [No grammar constraints (DTD or XML schema) detected for the document.]

    Thanks again for your prompt response.

    #20340
    #20341

    The XSD is correct – the docs are out of date; however, both should work just fine in version 3.2.0 (no promises about future versions.)

Viewing 15 posts - 16 through 30 (of 32 total)

You must be logged in to reply to this topic.

Comments are closed.