You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Raffaele Sena (JIRA)" <ji...@apache.org> on 2007/08/29 03:11:30 UTC

[jira] Created: (JCR-1096) Problems with custom nodes in journal

Problems with custom nodes in journal
-------------------------------------

                 Key: JCR-1096
                 URL: https://issues.apache.org/jira/browse/JCR-1096
             Project: Jackrabbit
          Issue Type: Bug
          Components: clustering
    Affects Versions: 1.3.1
            Reporter: Raffaele Sena


I have an application that uses custom node types and I am having problems in a clustered configuration.

Issue 1: the following definition in a nodetype is incorrectly read from the journal:
  + * (nt:hierarchyNode) version

The * is stored in the journal as _x002a_ since it should be a QName and it gets escaped.
When read, the code ...core.nodetype.compact.CompactNodeTypeDefReader.doChildNodeDefinition does the following test:

        if (currentTokenEquals('*')) {
            ndi.setName(ItemDef.ANY_NAME); 
        } else {
            ndi.setName(toQName(currentToken));
        }

Since currentToken is _x002a_ and not * toQName(currentToken) is called but it fails.
I changed the test to:
        if (currentTokenEquals('*') || currentTokenEquals("_x002a_"))
            ....
and that fixes the problem.

Issue 2: when storing a nodeType in the journal the superclass nt:base is not store, but when reading I get an error saying the node should be a subclass of nt:base.

The code in...core.nodetype.compact.CompactNodeTypeDefWriter.writeSupertypes skips nt:base when writing the node.

When reading the nodetype definition from the journal the following exception is thrown:

Unable to deliver node type operation: [{http://www.adobe.com/acorn/repository/1.0}resource] all primary node types except nt:base itself must be (directly or indirectly) derived from nt:base

probably because nt:base is not re-added to the nodetype definition

 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1096) Problems with custom nodes in journal

Posted by "Raffaele Sena (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Raffaele Sena updated JCR-1096:
-------------------------------

    Description: 
I have an application that uses custom node types and I am having problems in a clustered configuration.

Issue 1: the following definition in a nodetype is incorrectly read from the journal:
  + * (nt:hierarchyNode) version

The * is stored in the journal as _x002a_ since it should be a QName and it gets escaped.
When read, the code ...core.nodetype.compact.CompactNodeTypeDefReader.doChildNodeDefinition does the following test:

        if (currentTokenEquals('*')) {
            ndi.setName(ItemDef.ANY_NAME); 
        } else {
            ndi.setName(toQName(currentToken));
        }

Since currentToken is _x002a_ and not * toQName(currentToken) is called but it fails.
I changed the test to:
        if (currentTokenEquals('*') || currentTokenEquals("_x002a_"))
            ....
and that fixes the problem.

Issue 2: when storing a nodeType in the journal the superclass nt:base is not store, but when reading I get an error saying the node should be a subclass of nt:base.

The code in...core.nodetype.compact.CompactNodeTypeDefWriter.writeSupertypes skips nt:base when writing the node.

When reading the nodetype definition from the journal the following exception is thrown:

Unable to deliver node type operation: [{http://namespace/app/repository/1.0}resource] all primary node types except nt:base itself must be (directly or indirectly) derived from nt:base

probably because nt:base is not re-added to the nodetype definition

 

  was:
I have an application that uses custom node types and I am having problems in a clustered configuration.

Issue 1: the following definition in a nodetype is incorrectly read from the journal:
  + * (nt:hierarchyNode) version

The * is stored in the journal as _x002a_ since it should be a QName and it gets escaped.
When read, the code ...core.nodetype.compact.CompactNodeTypeDefReader.doChildNodeDefinition does the following test:

        if (currentTokenEquals('*')) {
            ndi.setName(ItemDef.ANY_NAME); 
        } else {
            ndi.setName(toQName(currentToken));
        }

Since currentToken is _x002a_ and not * toQName(currentToken) is called but it fails.
I changed the test to:
        if (currentTokenEquals('*') || currentTokenEquals("_x002a_"))
            ....
and that fixes the problem.

Issue 2: when storing a nodeType in the journal the superclass nt:base is not store, but when reading I get an error saying the node should be a subclass of nt:base.

The code in...core.nodetype.compact.CompactNodeTypeDefWriter.writeSupertypes skips nt:base when writing the node.

When reading the nodetype definition from the journal the following exception is thrown:

Unable to deliver node type operation: [{http://www.adobe.com/acorn/repository/1.0}resource] all primary node types except nt:base itself must be (directly or indirectly) derived from nt:base

probably because nt:base is not re-added to the nodetype definition

 


I commented out the test for nt:base in writeSupertypes and now starting a new machine in the cluster from the journal works fine.

Since CompactNodeTypeDefWriter is only used in the journal this shouldn't generate any regression.

> Problems with custom nodes in journal
> -------------------------------------
>
>                 Key: JCR-1096
>                 URL: https://issues.apache.org/jira/browse/JCR-1096
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: clustering
>    Affects Versions: 1.3.1
>            Reporter: Raffaele Sena
>
> I have an application that uses custom node types and I am having problems in a clustered configuration.
> Issue 1: the following definition in a nodetype is incorrectly read from the journal:
>   + * (nt:hierarchyNode) version
> The * is stored in the journal as _x002a_ since it should be a QName and it gets escaped.
> When read, the code ...core.nodetype.compact.CompactNodeTypeDefReader.doChildNodeDefinition does the following test:
>         if (currentTokenEquals('*')) {
>             ndi.setName(ItemDef.ANY_NAME); 
>         } else {
>             ndi.setName(toQName(currentToken));
>         }
> Since currentToken is _x002a_ and not * toQName(currentToken) is called but it fails.
> I changed the test to:
>         if (currentTokenEquals('*') || currentTokenEquals("_x002a_"))
>             ....
> and that fixes the problem.
> Issue 2: when storing a nodeType in the journal the superclass nt:base is not store, but when reading I get an error saying the node should be a subclass of nt:base.
> The code in...core.nodetype.compact.CompactNodeTypeDefWriter.writeSupertypes skips nt:base when writing the node.
> When reading the nodetype definition from the journal the following exception is thrown:
> Unable to deliver node type operation: [{http://namespace/app/repository/1.0}resource] all primary node types except nt:base itself must be (directly or indirectly) derived from nt:base
> probably because nt:base is not re-added to the nodetype definition
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JCR-1096) Problems with custom nodes in journal

Posted by "Dominique Pfister (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominique Pfister reassigned JCR-1096:
--------------------------------------

    Assignee: Dominique Pfister

> Problems with custom nodes in journal
> -------------------------------------
>
>                 Key: JCR-1096
>                 URL: https://issues.apache.org/jira/browse/JCR-1096
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: clustering
>    Affects Versions: 1.3.1
>            Reporter: Raffaele Sena
>            Assignee: Dominique Pfister
>
> I have an application that uses custom node types and I am having problems in a clustered configuration.
> Issue 1: the following definition in a nodetype is incorrectly read from the journal:
>   + * (nt:hierarchyNode) version
> The * is stored in the journal as _x002a_ since it should be a QName and it gets escaped.
> When read, the code ...core.nodetype.compact.CompactNodeTypeDefReader.doChildNodeDefinition does the following test:
>         if (currentTokenEquals('*')) {
>             ndi.setName(ItemDef.ANY_NAME); 
>         } else {
>             ndi.setName(toQName(currentToken));
>         }
> Since currentToken is _x002a_ and not * toQName(currentToken) is called but it fails.
> I changed the test to:
>         if (currentTokenEquals('*') || currentTokenEquals("_x002a_"))
>             ....
> and that fixes the problem.
> Issue 2: when storing a nodeType in the journal the superclass nt:base is not store, but when reading I get an error saying the node should be a subclass of nt:base.
> The code in...core.nodetype.compact.CompactNodeTypeDefWriter.writeSupertypes skips nt:base when writing the node.
> When reading the nodetype definition from the journal the following exception is thrown:
> Unable to deliver node type operation: [{http://namespace/app/repository/1.0}resource] all primary node types except nt:base itself must be (directly or indirectly) derived from nt:base
> probably because nt:base is not re-added to the nodetype definition
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1096) Problems with custom nodes in journal

Posted by "Dominique Pfister (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominique Pfister resolved JCR-1096.
------------------------------------

    Resolution: Fixed

Fixed as suggested, thanks for reporting and the good analysis!

Just one small change: instead of checking for the special name '*' and its encoded value _x002a_ when reading back the node type definition, I left '*' unencoded when writing.

Fixed in revision 571394.

> Problems with custom nodes in journal
> -------------------------------------
>
>                 Key: JCR-1096
>                 URL: https://issues.apache.org/jira/browse/JCR-1096
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: clustering
>    Affects Versions: 1.3.1
>            Reporter: Raffaele Sena
>            Assignee: Dominique Pfister
>
> I have an application that uses custom node types and I am having problems in a clustered configuration.
> Issue 1: the following definition in a nodetype is incorrectly read from the journal:
>   + * (nt:hierarchyNode) version
> The * is stored in the journal as _x002a_ since it should be a QName and it gets escaped.
> When read, the code ...core.nodetype.compact.CompactNodeTypeDefReader.doChildNodeDefinition does the following test:
>         if (currentTokenEquals('*')) {
>             ndi.setName(ItemDef.ANY_NAME); 
>         } else {
>             ndi.setName(toQName(currentToken));
>         }
> Since currentToken is _x002a_ and not * toQName(currentToken) is called but it fails.
> I changed the test to:
>         if (currentTokenEquals('*') || currentTokenEquals("_x002a_"))
>             ....
> and that fixes the problem.
> Issue 2: when storing a nodeType in the journal the superclass nt:base is not store, but when reading I get an error saying the node should be a subclass of nt:base.
> The code in...core.nodetype.compact.CompactNodeTypeDefWriter.writeSupertypes skips nt:base when writing the node.
> When reading the nodetype definition from the journal the following exception is thrown:
> Unable to deliver node type operation: [{http://namespace/app/repository/1.0}resource] all primary node types except nt:base itself must be (directly or indirectly) derived from nt:base
> probably because nt:base is not re-added to the nodetype definition
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1096) Problems with custom nodes in journal

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1096:
-------------------------------

    Affects Version/s: 1.2.1
                       1.2.2
                       1.2.3
                       1.3
        Fix Version/s: 1.3.2

Merged to the 1.3 branch in revision 577868.

> Problems with custom nodes in journal
> -------------------------------------
>
>                 Key: JCR-1096
>                 URL: https://issues.apache.org/jira/browse/JCR-1096
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: clustering
>    Affects Versions: 1.2.1, 1.2.2, 1.2.3, 1.3, 1.3.1
>            Reporter: Raffaele Sena
>            Assignee: Dominique Pfister
>             Fix For: 1.3.2
>
>
> I have an application that uses custom node types and I am having problems in a clustered configuration.
> Issue 1: the following definition in a nodetype is incorrectly read from the journal:
>   + * (nt:hierarchyNode) version
> The * is stored in the journal as _x002a_ since it should be a QName and it gets escaped.
> When read, the code ...core.nodetype.compact.CompactNodeTypeDefReader.doChildNodeDefinition does the following test:
>         if (currentTokenEquals('*')) {
>             ndi.setName(ItemDef.ANY_NAME); 
>         } else {
>             ndi.setName(toQName(currentToken));
>         }
> Since currentToken is _x002a_ and not * toQName(currentToken) is called but it fails.
> I changed the test to:
>         if (currentTokenEquals('*') || currentTokenEquals("_x002a_"))
>             ....
> and that fixes the problem.
> Issue 2: when storing a nodeType in the journal the superclass nt:base is not store, but when reading I get an error saying the node should be a subclass of nt:base.
> The code in...core.nodetype.compact.CompactNodeTypeDefWriter.writeSupertypes skips nt:base when writing the node.
> When reading the nodetype definition from the journal the following exception is thrown:
> Unable to deliver node type operation: [{http://namespace/app/repository/1.0}resource] all primary node types except nt:base itself must be (directly or indirectly) derived from nt:base
> probably because nt:base is not re-added to the nodetype definition
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.