Jahia Install Forum > ERROR JahiaPreferencesJCRProv...

0 (0 Good)
0 (0 Bad)

ERROR JahiaPreferencesJCRProvider,

by  chumtp »  2011/06/07 20:56

Jahia 6.0.0 r25203

In file Log :

ERROR [http-9090-4] JahiaPreferencesJCRProvider, org.jahia.services.preferences.impl.JahiaPreferencesJCRProvider: InvalidQueryException ---> [content/users/01881922w/preferences/org.jahia.preferences.provider.toolbar/preference[(@name='bookmarks') and (@type='org.jahia.toolbar.bookmarks')]] is not valid.

javax.jcr.query.InvalidQueryException: Encountered "/" at line 1, column 34.
Was expecting one of:
<IntegerLiteral> ..."

Could help me, thank you

  • ERROR JahiaPreferencesJCRProvider,
    2011/07/04 15:20

    chumtp <p> Jahia 6.0.0 r25203<br /> <br /> In file Log :<br /> <br /> ERROR [http-9090-4] JahiaPreferencesJCRProvider, org.jahia.services.preferences.impl.JahiaPreferencesJCRProvider: InvalidQueryException ---&gt; [content/users/01881922w/preferences/org.jahia.preferences.provider.toolbar/preference[(@name=&#39;bookmarks&#39;) and (@type=&#39;org.jahia.toolbar.bookmarks&#39;)]] is not valid.<br /> <br /> javax.jcr.query.InvalidQueryException: Encountered &quot;/&quot; at line 1, column 34.<br /> Was expecting one of:<br /> &lt;IntegerLiteral&gt; ...&quot;<br /> <br /> Could help me, thank you</p>

  • Number of messages  1
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: ERROR JahiaPreferencesJCRProvider,

    by  pap@commaro.com »  2011/06/07 20:56

    Hello,

    this is a bug in Jahia which was present in the release you are using. The problem is that xpath does not allow names that start with a digit, like you do with the username -> 01881922w. 

    The solution is to properly encode the query. You can either switch to a newer Jahia release, or if you can recompile from source and want to just provide a quick patch, you can modify 

    /core/src/main/java/org/jahia/services/preferences/impl/JahiaPreferencesJCRProviders.java 

    and change the line

    return "content/users/" + principalName + "/preferences/";
    to
    return "content/users/" + org.apache.jackrabbit.util.ISO9075.encode(principalName) + "/preferences/";

    and also change this line

    StringBuffer prefPath = new StringBuffer(encodeXPath(xpathNode));

    to

    StringBuffer prefPath = new StringBuffer(xpathNode);

    Regards,
    Benjamin

    Benjamin Papez (pap@commaro.com)

    Number of messages  220
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page