Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-1329

Unable to commit a new version of a nt:file node within a transaction using a specfic configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.4
    • None
    • config, transactions
    • None

    Description

      A NullPointerException is thrown when committing a version of a nt:file node within a transaction using the following repository configuration:

      1. File data size > 1024 bytes (causes the BLOB to use a temp file, otherwise the data is kept in memory)
      2. Persistance Manager: org.apache.jackrabbit.core.state.db.DerbyPersistenceManager
      3. No <DataStore> configured in repository.xml

      The cause appears to be that during the commit operation BLOBInTempFile.discard() is called which deletes the temp file, then later on, BLOBInTempFile.getStream() is called on the same object, but the file has already been deleted, so it fails resulting in the following exception:

      121375 [main] ERROR org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager - failed to write property state: c4c5b6ec-b12d-419d-8a1f-03eb69f30aee/

      {http://www.jcp.org/jcr/1.0}

      data
      java.lang.NullPointerException
      at java.io.FileInputStream.<init>(FileInputStream.java:103)
      at org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145)
      at org.apache.jackrabbit.core.persistence.util.Serializer.serialize(Serializer.java:198)
      at org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.store(DatabasePersistenceManager.java:476)
      at org.apache.jackrabbit.core.persistence.AbstractPersistenceManager.store(AbstractPersistenceManager.java:75)
      at org.apache.jackrabbit.core.persistence.db.DatabasePersistenceManager.store(DatabasePersistenceManager.java:282)
      at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:688)
      at org.apache.jackrabbit.core.state.XAItemStateManager.commit(XAItemStateManager.java:162)
      at org.apache.jackrabbit.core.version.XAVersionManager.commit(XAVersionManager.java:476)
      at org.apache.jackrabbit.core.TransactionContext.commit(TransactionContext.java:189)
      at org.apache.jackrabbit.core.XASessionImpl.commit(XASessionImpl.java:339)
      at TestCase.main(TestCase.java:81)

      Workarounds:
      1. Use a different persistance manager. 'org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager' does not fail.
      2. Configure a <DataStore> in your repository.xml. This results in a different code path that seems to work.

      Attachments

        1. repository.xml
          8 kB
          Eric Norman
        2. TestCase.java
          5 kB
          Eric Norman

        Activity

          People

            Unassigned Unassigned
            enorman Eric Norman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: