5 Replies Latest reply on Jan 8, 2008 10:34 AM by Hany Mesha

    JDBCCacheLoader and MySQL problems

    asddsa dsasd Newbie


      java.lang.IllegalStateException: Failed to load node for fqn
      /viewCache/MostRecentRegularTopics/view: Unable to load to deserialize
      result: java.io.OptionalDataException
       at org.jboss.cache.loader.JDBCCacheLoader.loadNode(Unknown Source)
       at org.jboss.cache.loader.JDBCCacheLoader.get(Unknown Source)
       at org.jboss.cache.loader.AsyncCacheLoader.get(Unknown Source)
      org.jboss.cache.interceptors.CacheLoaderInterceptor.loadData(Unknown Source)
      org.jboss.cache.interceptors.CacheLoaderInterceptor.loadNode(Unknown Source)
      org.jboss.cache.interceptors.CacheLoaderInterceptor.invoke(Unknown Source)
       at org.jboss.cache.interceptors.Interceptor.invoke(Unknown Source)
      org.jboss.cache.interceptors.CacheStoreInterceptor.invoke(Unknown Source)
       at org.jboss.cache.interceptors.Interceptor.invoke(Unknown Source)
      org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(Unknown Source)
       at org.jboss.cache.interceptors.TxInterceptor.invoke(Unknown Source)
       at org.jboss.cache.interceptors.Interceptor.invoke(Unknown Source)
      org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(Unknown Source)
       at org.jboss.cache.TreeCache.invokeMethod(Unknown Source)
       at org.jboss.cache.TreeCache.get(Unknown Source)
       at org.jboss.cache.TreeCache.get(Unknown Source)
       at org.jboss.cache.TreeCache.get(Unknown Source)
       at sun.reflect.GeneratedMethodAccessor344.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy363.get(Unknown Source)

      I have this exception when JBC is trying to fetch objects from database that are larger than 4kB.
      I have read the following:
      Hany Mesha writes that it is working for him for objects with large sizes with minor tweaking. I wonder what he mean by that :)
      Any sugestions are welcome.

        • 1. Re: JDBCCacheLoader and MySQL problems
          Damien Newbie

          do u try to change the type of field named node in table jbosscache from blob to longblob ?

          • 2. Re: JDBCCacheLoader and MySQL problems
            asddsa dsasd Newbie

            It doesn't help.
            As and addendum to first post: objects larger than 4kB get truncated to 4kB when persisting.

            • 4. Re: JDBCCacheLoader and MySQL problems
              asddsa dsasd Newbie

              JBC version is 1.4.1.SP7
              JBoss 4.2.1
              MySQL Driver 5.0.8
              Yes I have read it. My configuration:

               <!-- properties to pass in to the cache loader -->
               <!-- whether the cache loader writes are asynchronous -->
               <!-- only one cache loader in the chain may set fetchPersistentState to true.
               An exception is thrown if more than one cache loader sets this to true. -->
               <!-- determines whether this cache loader ignores writes - defaults to false. -->
               <!-- if set to true, purges the contents of this cache loader when the cache starts up.
               Defaults to false. -->
               <!-- defines the cache loader as a singleton store where only the coordinator of the
               cluster will store modifications. Setting pushStateWhenCoordinator to true enables a
               newly elected coordinator to push the in-memory state to the underlying cache store.
               Both default to false. -->
               <singletonStore pushStateWhenCoordinator="false">false</singletonStore>


              • 5. Re: JDBCCacheLoader and MySQL problems
                Hany Mesha Novice

                Looking at the error you're getting doesn't look like that has anything to do with the 4k limitation on the blob data type in MySQL or JBCACHE-320. In the blob case you'd get NPE upon truncation of the data stored.

                I think the problem has to do with the serialization of the objects that you're persisting. the failure doesn't happen in MySQL but rather on deserialization.

                From Java doc for the exception, Exception indicating the failure of an object read operation due to unread primitive data, or the end of data belonging to a serialized object in the stream.

                Please review your object serialization / deserialization mechanism and if you're sure that it's working correctly then please turn up JBC logging level to debug and post the log part that pertain to the database retrieve so I can examine it further.