Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1514

Protect against InputStream providers that do not implement available()

    XMLWordPrintable

Details

    Description

      Unmarshalling of value with oracle driver fails with:
      2011-11-09 14:57:59,490 [ERROR] org.infinispan.loaders.jdbc.JdbcUtil - ISPN008009: I/O error while unmarshalling from stream
      java.io.EOFException: Read past end of file
      at org.jboss.marshalling.SimpleDataInput.eofOnRead(SimpleDataInput.java:126)
      at org.jboss.marshalling.SimpleDataInput.readUnsignedByteDirect(SimpleDataInput.java:263)
      at org.jboss.marshalling.SimpleDataInput.readUnsignedByte(SimpleDataInput.java:224)
      at org.jboss.marshalling.river.RiverUnmarshaller.start(RiverUnmarshaller.java:1182)
      at org.infinispan.marshall.jboss.AbstractJBossMarshaller.startObjectInput(AbstractJBossMarshaller.java:113)
      at org.infinispan.marshall.VersionAwareMarshaller.startObjectInput(VersionAwareMarshaller.java:156)
      at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:112)
      at org.infinispan.marshall.AbstractMarshaller.objectFromInputStream(AbstractMarshaller.java:104)
      at org.infinispan.loaders.jdbc.JdbcUtil.unmarshall(JdbcUtil.java:88)
      at E04.main(E04.java:38)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.inubit.ibis.configuration.Bootstrap.main(Bootstrap.java:66)
      org.infinispan.loaders.CacheLoaderException: I/O error while unmarshalling from stream
      at org.infinispan.loaders.jdbc.JdbcUtil.unmarshall(JdbcUtil.java:91)
      at E04.main(E04.java:38)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.inubit.ibis.configuration.Bootstrap.main(Bootstrap.java:66)
      Caused by: java.io.EOFException: Read past end of file
      at org.jboss.marshalling.SimpleDataInput.eofOnRead(SimpleDataInput.java:126)
      at org.jboss.marshalling.SimpleDataInput.readUnsignedByteDirect(SimpleDataInput.java:263)
      at org.jboss.marshalling.SimpleDataInput.readUnsignedByte(SimpleDataInput.java:224)
      at org.jboss.marshalling.river.RiverUnmarshaller.start(RiverUnmarshaller.java:1182)
      at org.infinispan.marshall.jboss.AbstractJBossMarshaller.startObjectInput(AbstractJBossMarshaller.java:113)
      at org.infinispan.marshall.VersionAwareMarshaller.startObjectInput(VersionAwareMarshaller.java:156)
      at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:112)
      at org.infinispan.marshall.AbstractMarshaller.objectFromInputStream(AbstractMarshaller.java:104)
      at org.infinispan.loaders.jdbc.JdbcUtil.unmarshall(JdbcUtil.java:88)
      ... 6 more

      Solution:
      In AbstractMarshaller.objectFromInputStream is assumed, that the available() method from the incoming InputStream returns the size of data.
      But this is optional, so the InputStream from the oracle driver returns 0. So implementation of objectFromInputStream must be changed to avoid usage of available().

      Attachments

        Issue Links

          Activity

            People

              rh-ee-galder Galder ZamarreƱo
              tfromm_jira Thomas Fromm (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: