1 2 Previous Next 16 Replies Latest reply on May 20, 2010 1:51 AM by Randall Hauch

    Using the infinispan connector, not serializable

    John Ament Master

      well this is turning into a fun trip

       

      I'm trying to use the infinispan connector at this point to work with objects, rather than files.

       

      Due to https://jira.jboss.org/jira/browse/ISPN-355 I'm using Infinispan 4.1 Alpha 1 for my testing.  After a bit of tinkering, I got it running except that I now get the following exception:

       

      Caused by: org.infinispan.marshall.NotSerializableException: org.modeshape.graph.connector.map.DefaultMapNode
      Caused by: an exception which occurred:
              in object org.modeshape.graph.connector.map.DefaultMapNode@d39c8a70
                      -> toString =  (0b72e239-8b8e-4a2d-b7b5-4de0e4d56f84)
              in object org.infinispan.container.entries.ImmortalCacheEntry@73914e00
                      -> toString = ImmortalCacheEntry{cacheValue=ImmortalCacheValue{value= (0b72e239-8b8e-4a2d-b7b5-4de0e4d56f84)}} ImmortalCacheEntry{key=0b72e239-8b8e-4a2d-b7b5-4de0e4d56f84}
              in object org.infinispan.loaders.bucket.Bucket@7be68f43
                      -> toString = Bucket{entries={0b72e239-8b8e-4a2d-b7b5-4de0e4d56f84=ImmortalCacheEntry{cacheValue=ImmortalCacheValue{value= (0b72e239-8b8e-4a2d-b7b5-4de0e4d56f84)}} ImmortalCacheEntry{key=0b72e239-8b8e-4a2d-b7b5-4de0e4d56f84}}, bucketName='-744715664'}

       

      Doesn't seem quite right that DefaultMapNode is not serializable.

        • 1. Re: Using the infinispan connector, not serializable
          Randall Hauch Master

          No, it not right. DefaultMapNode definitely needs to be serializable. Bugger. I'll log a defect.

           

          BTW, the Infinispan connector is working well so far with Infinispan 4.1.0.Alpha1?

          • 2. Re: Using the infinispan connector, not serializable
            John Ament Master

            Well, it started at least.

             

            other than that, since I can't do CRUD operations yet due to this issue I couldn't even begin to fathom.

             

            I'll update my local copy too with the objects mentioned.  hopefully nothing breaks.

            • 3. Re: Using the infinispan connector, not serializable
              Randall Hauch Master

              On second hand, I'm not sure DefaultMapNode can be serializable, because it has a direct reference to the parent and children. I believe this means that the serialized form of every node will contain the entire graph. I need a few minutes to switch contexts, and then I'll look at this and get it working.

              • 5. Re: Using the infinispan connector, not serializable
                John Ament Master

                that could be an issue.  tell me, when you were testing how did you have infinispan configured?  I'm just using this:

                 

                <?xml version="1.0" encoding="UTF-8"?>
                <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xmlns="urn:infinispan:config:4.0">
                  <global />
                  <default>
                  <loaders shared="false" preload="true">
                      <loader
                        
                          fetchPersistentState="true" ignoreModifications="false"
                          purgeOnStartup="false">
                        <properties>
                          <property name="location" value="/dump/jcr"/>
                        </properties>
                      </loader>
                    </loaders>
                  </default>

                </infinispan>

                • 6. Re: Using the infinispan connector, not serializable
                  Randall Hauch Master

                  I think we just used the DefaultCacheManager implementation for our unit tests (because of its speed). And I think we also use that for the JCR TCK runs against Infinispan, again for the speed. Obviously, that's why we didn't find this earlier.

                  • 7. Re: Using the infinispan connector, not serializable
                    John Ament Master

                    just added a comment.  with the simple stuff I'm doing in my repo, also adding BasicSingleValueProperty to the list.

                     

                    i added serializable to both of these classes and ran my tests against it.  data was created correctly in the infinispan data dir.

                    • 8. Re: Using the infinispan connector, not serializable
                      John Ament Master

                      yep that's what it looks like when i looked through the TCs. you would have never run into serialization issues until you started persisting the cache.

                       

                      BTW, after making the two classes serializable it does seem to be working.

                      • 9. Re: Using the infinispan connector, not serializable
                        Randall Hauch Master

                        I'm still concerned about the reachability of the serialized graphs, but then again I'm not sure how Infinispan does it's serialization.

                        • 10. Re: Using the infinispan connector, not serializable
                          John Ament Master

                          I'm still tinkering, but this is what my files look like so far.

                           

                          [128 10:38:20:jament@hell:/dump/jcr] # ls -ltr
                          total 72
                          -rw-r--r-- 1 root root  380 2010-04-14 10:30 -439473549
                          -rw-r--r-- 1 root root  380 2010-04-14 10:30 27455226
                          -rw-r--r-- 1 root root 3163 2010-04-14 10:30 980624498
                          -rw-r--r-- 1 root root 1934 2010-04-14 10:30 -856724491
                          -rw-r--r-- 1 root root 2891 2010-04-14 10:30 514851525
                          -rw-r--r-- 1 root root 2781 2010-04-14 10:30 -430397265
                          -rw-r--r-- 1 root root 3031 2010-04-14 10:30 372410505
                          -rw-r--r-- 1 root root 3392 2010-04-14 10:30 1925905891
                          -rw-r--r-- 1 root root 1540 2010-04-14 10:30 -1615409754
                          -rw-r--r-- 1 root root 3273 2010-04-14 10:30 -1584916961
                          -rw-r--r-- 1 root root 1773 2010-04-14 10:30 -1394668663
                          -rw-r--r-- 1 root root 1658 2010-04-14 10:30 1251477936
                          -rw-r--r-- 1 root root 1422 2010-04-14 10:30 -1132227700
                          -rw-r--r-- 1 root root 1082 2010-04-14 10:30 1032633710
                          -rw-r--r-- 1 root root  380 2010-04-14 10:34 -1860143335
                          -rw-r--r-- 1 root root 3503 2010-04-14 10:35 -137925457
                          -rw-r--r-- 1 root root 3771 2010-04-14 10:42 1752033149
                          -rw-r--r-- 1 root root 4025 2010-04-14 10:43 -844748001

                           

                          (yes my development box is named hell :-)

                          • 11. Re: Using the infinispan connector, not serializable
                            John Ament Master

                            ok, found the blocker when it comes to serialization

                             

                            Caused by: java.io.InvalidClassException: org.modeshape.graph.property.basic.BasicSingleValueProperty; No suitable constructor could be found
                                    at org.jboss.marshalling.reflect.ReflectiveCreator.getCachedConstructor(ReflectiveCreator.java:93)
                                    at org.jboss.marshalling.reflect.ReflectiveCreator.create(ReflectiveCreator.java:105)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1199)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:270)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
                                    at org.jboss.marshalling.AbstractUnmarshaller.readObject(AbstractUnmarshaller.java:85)
                                    at org.infinispan.marshall.MarshallUtil.unmarshallMap(MarshallUtil.java:65)
                                    at org.infinispan.marshall.exts.MapExternalizer.readObject(MapExternalizer.java:78)
                                    at org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.readObject(ConstantObjectTable.java:264)
                                    at org.infinispan.marshall.jboss.ConstantObjectTable.readObject(ConstantObjectTable.java:251)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:357)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1637)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1553)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1202)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:270)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
                                    at org.jboss.marshalling.AbstractUnmarshaller.readObject(AbstractUnmarshaller.java:85)
                                    at org.infinispan.marshall.exts.LinkedListExternalizer.readObject(LinkedListExternalizer.java:55)
                                    at org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.readObject(ConstantObjectTable.java:264)
                                    at org.infinispan.marshall.jboss.ConstantObjectTable.readObject(ConstantObjectTable.java:251)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:357)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1637)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1553)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1202)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:270)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1637)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1553)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1202)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:270)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1637)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1553)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1202)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:270)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
                                    at org.jboss.marshalling.AbstractUnmarshaller.readObject(AbstractUnmarshaller.java:85)
                                    at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.readObject(ImmortalCacheEntry.java:105)
                                    at org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.readObject(ConstantObjectTable.java:264)
                                    at org.infinispan.marshall.jboss.ConstantObjectTable.readObject(ConstantObjectTable.java:251)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:357)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:207)
                                    at org.jboss.marshalling.AbstractUnmarshaller.readObject(AbstractUnmarshaller.java:85)
                                    at org.infinispan.loaders.bucket.Bucket$Externalizer.readObject(Bucket.java:115)
                                    at org.infinispan.marshall.jboss.ConstantObjectTable$ExternalizerAdapter.readObject(ConstantObjectTable.java:264)
                                    at org.infinispan.marshall.jboss.ConstantObjectTable.readObject(ConstantObjectTable.java:251)
                                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:357)

                             

                             

                            this is during restart.

                            • 12. Re: Using the infinispan connector, not serializable
                              Randall Hauch Master

                              MODE-714 has now been fixed in trunk. I took the opportunity to incorporate a number of other improvements as well (see the issue for details), and it took longer than I had hoped.  Thanks for the patience in allowing us to get this fixed!

                               

                              We're now serializing a different class to store the node information, so this will not be compatible with your patched versions of the code. This won't be a problem for other users, since the serialization defect prevented persistent storage of the content anyway.

                              • 13. Re: Using the infinispan connector, not serializable
                                John Ament Master

                                got ya.  I'm going to check out now, so hopefully it'll work.  i think most of the big issues are settled now :-)

                                 

                                Thanks!

                                • 14. Re: Using the infinispan connector, not serializable
                                  Jeff Brown Newbie

                                  I see this is fixed in 1.2-SNAPSHOT.  Can I get that on the snapshot Maven repo - did not see it there and wondering if I am looking in the wrong place? https://repository.jboss.org/nexus/content/repositories/snapshots/

                                   

                                  Thanks.

                                  1 2 Previous Next