[jira] Created: (JCR-1653) NodeIdImpl is not really serializable

View: New views
5 Messages — Rating Filter:   Alert me  

[jira] Created: (JCR-1653) NodeIdImpl is not really serializable

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

NodeIdImpl is not really serializable
--------------------------------------

                 Key: JCR-1653
                 URL: https://issues.apache.org/jira/browse/JCR-1653
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-spi-commons
    Affects Versions: 1.5
            Reporter: Scott Cytacki


I've been trying to get jcr2spi - rmi - spi2jcr to work.

The error I'm seeing is reported as:
java.io.NotSerializableException: org.apache.jackrabbit.spi.commons.identifier.IdFactoryImpl

I believe I tracked this down.  It is because NodeIdImpl is implicitly referencing its containing instance IdFactoryImpl which is not serializable.

NodeIdImpl is attempted to be serialized, in my case, with the following stack:

at org.apache.jackrabbit.spi.rmi.client.ClientRepositoryService.getItemInfos(ClientRepositoryService.java:258)
at org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeState(WorkspaceItemStateFactory.java:94)
at org.apache.jackrabbit.jcr2spi.state.TransientISFactory.createNodeState(TransientISFactory.java:99)
at org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.doResolve(NodeEntryImpl.java:972)
at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.resolve(HierarchyEntryImpl.java:95)
at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.getItemState(HierarchyEntryImpl.java:212)
at org.apache.jackrabbit.jcr2spi.ItemManagerImpl.getItem(ItemManagerImpl.java:170)
at org.apache.jackrabbit.jcr2spi.SessionImpl.getRootNode(SessionImpl.java:216)

I think I must be doing something wrong, because it seems like this is a fundamental problem with doing jcr2spi - rmi - spi2jcr, and looking at the SVN history I don't see how this ever could have worked.  
So either session.getRootNode() has never been tested using jcr2spi - rmi - spi2jcr, or I've got something setup wrong.

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


[jira] Updated: (JCR-1653) NodeIdImpl is not really serializable

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/JCR-1653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Cytacki updated JCR-1653:
-------------------------------

    Attachment: jackrabbit-spi-commons-NodeId-Serializable-1.patch

The following patch fixes the error I was getting, and now things appear to work.  This patch is a little hacky.

It makes all the inner classes static, and uses a hack to deal with the getPathFactory instance method that they were using.


> NodeIdImpl is not really serializable
> --------------------------------------
>
>                 Key: JCR-1653
>                 URL: https://issues.apache.org/jira/browse/JCR-1653
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 1.5
>            Reporter: Scott Cytacki
>         Attachments: jackrabbit-spi-commons-NodeId-Serializable-1.patch
>
>
> I've been trying to get jcr2spi - rmi - spi2jcr to work.
> The error I'm seeing is reported as:
> java.io.NotSerializableException: org.apache.jackrabbit.spi.commons.identifier.IdFactoryImpl
> I believe I tracked this down.  It is because NodeIdImpl is implicitly referencing its containing instance IdFactoryImpl which is not serializable.
> NodeIdImpl is attempted to be serialized, in my case, with the following stack:
> at org.apache.jackrabbit.spi.rmi.client.ClientRepositoryService.getItemInfos(ClientRepositoryService.java:258)
> at org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeState(WorkspaceItemStateFactory.java:94)
> at org.apache.jackrabbit.jcr2spi.state.TransientISFactory.createNodeState(TransientISFactory.java:99)
> at org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.doResolve(NodeEntryImpl.java:972)
> at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.resolve(HierarchyEntryImpl.java:95)
> at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.getItemState(HierarchyEntryImpl.java:212)
> at org.apache.jackrabbit.jcr2spi.ItemManagerImpl.getItem(ItemManagerImpl.java:170)
> at org.apache.jackrabbit.jcr2spi.SessionImpl.getRootNode(SessionImpl.java:216)
> I think I must be doing something wrong, because it seems like this is a fundamental problem with doing jcr2spi - rmi - spi2jcr, and looking at the SVN history I don't see how this ever could have worked.  
> So either session.getRootNode() has never been tested using jcr2spi - rmi - spi2jcr, or I've got something setup wrong.

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


[jira] Commented: (JCR-1653) NodeIdImpl is not really serializable

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/JCR-1653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610562#action_12610562 ]

Marcel Reutegger commented on JCR-1653:
---------------------------------------

It used to work initially, but when the ItemId implementation stuff was moved to jackrabbit-spi-commons the serialization got broken.

> NodeIdImpl is not really serializable
> --------------------------------------
>
>                 Key: JCR-1653
>                 URL: https://issues.apache.org/jira/browse/JCR-1653
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 1.5
>            Reporter: Scott Cytacki
>         Attachments: jackrabbit-spi-commons-NodeId-Serializable-1.patch
>
>
> I've been trying to get jcr2spi - rmi - spi2jcr to work.
> The error I'm seeing is reported as:
> java.io.NotSerializableException: org.apache.jackrabbit.spi.commons.identifier.IdFactoryImpl
> I believe I tracked this down.  It is because NodeIdImpl is implicitly referencing its containing instance IdFactoryImpl which is not serializable.
> NodeIdImpl is attempted to be serialized, in my case, with the following stack:
> at org.apache.jackrabbit.spi.rmi.client.ClientRepositoryService.getItemInfos(ClientRepositoryService.java:258)
> at org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeState(WorkspaceItemStateFactory.java:94)
> at org.apache.jackrabbit.jcr2spi.state.TransientISFactory.createNodeState(TransientISFactory.java:99)
> at org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.doResolve(NodeEntryImpl.java:972)
> at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.resolve(HierarchyEntryImpl.java:95)
> at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.getItemState(HierarchyEntryImpl.java:212)
> at org.apache.jackrabbit.jcr2spi.ItemManagerImpl.getItem(ItemManagerImpl.java:170)
> at org.apache.jackrabbit.jcr2spi.SessionImpl.getRootNode(SessionImpl.java:216)
> I think I must be doing something wrong, because it seems like this is a fundamental problem with doing jcr2spi - rmi - spi2jcr, and looking at the SVN history I don't see how this ever could have worked.  
> So either session.getRootNode() has never been tested using jcr2spi - rmi - spi2jcr, or I've got something setup wrong.

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


[jira] Resolved: (JCR-1653) NodeIdImpl is not really serializable

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/JCR-1653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger resolved JCR-1653.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5

- Turned the ItemId implementations into static classes
- Added PathFactory parameter to constructors where needed. ItemIds don't need the factory anywhere else.
- Added serialVersionUID to NodeIdImpl and PropertyIdImpl
- Added test cases that check serializability
- Optimized ItemIdImpl.hashCode()

All tests in jackrabbit trunk ran successfully. I also successfully executed the tests in sandbox/spi/client against an SPI-RMI server.

svn revision: 674024

Thank you for reporting this issue.

> NodeIdImpl is not really serializable
> --------------------------------------
>
>                 Key: JCR-1653
>                 URL: https://issues.apache.org/jira/browse/JCR-1653
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 1.5
>            Reporter: Scott Cytacki
>             Fix For: 1.5
>
>         Attachments: jackrabbit-spi-commons-NodeId-Serializable-1.patch
>
>
> I've been trying to get jcr2spi - rmi - spi2jcr to work.
> The error I'm seeing is reported as:
> java.io.NotSerializableException: org.apache.jackrabbit.spi.commons.identifier.IdFactoryImpl
> I believe I tracked this down.  It is because NodeIdImpl is implicitly referencing its containing instance IdFactoryImpl which is not serializable.
> NodeIdImpl is attempted to be serialized, in my case, with the following stack:
> at org.apache.jackrabbit.spi.rmi.client.ClientRepositoryService.getItemInfos(ClientRepositoryService.java:258)
> at org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeState(WorkspaceItemStateFactory.java:94)
> at org.apache.jackrabbit.jcr2spi.state.TransientISFactory.createNodeState(TransientISFactory.java:99)
> at org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.doResolve(NodeEntryImpl.java:972)
> at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.resolve(HierarchyEntryImpl.java:95)
> at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.getItemState(HierarchyEntryImpl.java:212)
> at org.apache.jackrabbit.jcr2spi.ItemManagerImpl.getItem(ItemManagerImpl.java:170)
> at org.apache.jackrabbit.jcr2spi.SessionImpl.getRootNode(SessionImpl.java:216)
> I think I must be doing something wrong, because it seems like this is a fundamental problem with doing jcr2spi - rmi - spi2jcr, and looking at the SVN history I don't see how this ever could have worked.  
> So either session.getRootNode() has never been tested using jcr2spi - rmi - spi2jcr, or I've got something setup wrong.

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


[jira] Updated: (JCR-1653) NodeIdImpl is not really serializable

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/JCR-1653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger updated JCR-1653:
----------------------------------

    Affects Version/s:     (was: 1.5)
                       1.4

> NodeIdImpl is not really serializable
> --------------------------------------
>
>                 Key: JCR-1653
>                 URL: https://issues.apache.org/jira/browse/JCR-1653
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 1.4
>            Reporter: Scott Cytacki
>             Fix For: 1.5
>
>         Attachments: jackrabbit-spi-commons-NodeId-Serializable-1.patch
>
>
> I've been trying to get jcr2spi - rmi - spi2jcr to work.
> The error I'm seeing is reported as:
> java.io.NotSerializableException: org.apache.jackrabbit.spi.commons.identifier.IdFactoryImpl
> I believe I tracked this down.  It is because NodeIdImpl is implicitly referencing its containing instance IdFactoryImpl which is not serializable.
> NodeIdImpl is attempted to be serialized, in my case, with the following stack:
> at org.apache.jackrabbit.spi.rmi.client.ClientRepositoryService.getItemInfos(ClientRepositoryService.java:258)
> at org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeState(WorkspaceItemStateFactory.java:94)
> at org.apache.jackrabbit.jcr2spi.state.TransientISFactory.createNodeState(TransientISFactory.java:99)
> at org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.doResolve(NodeEntryImpl.java:972)
> at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.resolve(HierarchyEntryImpl.java:95)
> at org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.getItemState(HierarchyEntryImpl.java:212)
> at org.apache.jackrabbit.jcr2spi.ItemManagerImpl.getItem(ItemManagerImpl.java:170)
> at org.apache.jackrabbit.jcr2spi.SessionImpl.getRootNode(SessionImpl.java:216)
> I think I must be doing something wrong, because it seems like this is a fundamental problem with doing jcr2spi - rmi - spi2jcr, and looking at the SVN history I don't see how this ever could have worked.  
> So either session.getRootNode() has never been tested using jcr2spi - rmi - spi2jcr, or I've got something setup wrong.

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