Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-3795

Farm deployment of exploded archive with 0-byte files fails with NullPointerException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • EAP_EWP 5.1.1
    • EAP 5.0.0
    • Clustering
    • None
    • Release Notes
    • Hide
      Class org.jboss.system.server.profileservice.repository.clustered.local.file.AbstractFileWriteAction has a member variable <code>tempFile</code>, which is set to a newly created file in <code>getTempFile()</code>. This file is called from <code>getOutputStream()</code>, which is called from <code>writeBytes()</code>. However, <code>writeBytes</code> is only called if there is data in the file.

      If the file is empty, <code>tempFile</code> is never set, and <code>AbstractFileWriteAction.modifyTarget</code> passes a null <code>File</code> parameter to <code>FileUtil.localMove</code>, where the NullPointerException happens.

      <code>AbstractFileWriteAction.modifyTarget</code> now calls <code>getTempFile()</code>, which creates the file if needed, instead of using <code>tempFile</code> directly.
      Show
      Class org.jboss.system.server.profileservice.repository.clustered.local.file.AbstractFileWriteAction has a member variable <code>tempFile</code>, which is set to a newly created file in <code>getTempFile()</code>. This file is called from <code>getOutputStream()</code>, which is called from <code>writeBytes()</code>. However, <code>writeBytes</code> is only called if there is data in the file. If the file is empty, <code>tempFile</code> is never set, and <code>AbstractFileWriteAction.modifyTarget</code> passes a null <code>File</code> parameter to <code>FileUtil.localMove</code>, where the NullPointerException happens. <code>AbstractFileWriteAction.modifyTarget</code> now calls <code>getTempFile()</code>, which creates the file if needed, instead of using <code>tempFile</code> directly.
    • Documented as Resolved Issue

    Description

      In EAP 5, deploying an exploded archive containing a 0-byte file causes the following NullPointerException exception on the remote node.
      The farm deployment process aborts at this point.

      ERROR [FileWriteAction] Caught exception in doPrepare()
      java.lang.NullPointerException
      at org.jboss.system.server.profileservice.repository.clustered.local.file.FileUtil.localMove(FileUtil.java:50)
      at org.jboss.system.server.profileservice.repository.clustered.local.file.AbstractFileWriteAction.modifyTarget(AbstractFileWriteAction.java:88)
      at org.jboss.system.server.profileservice.repository.clustered.local.file.AbstractLocalContentChangeAction.doPrepare(AbstractLocalContentChangeAction.java:91)
      at org.jboss.system.server.profileservice.repository.clustered.sync.AbstractSynchronizationAction.prepare(AbstractSynchronizationAction.java:125)
      at org.jboss.system.server.profileservice.repository.clustered.local.AbstractLocalContentManager.prepareSynchronization(AbstractLocalContentManager.java:315)
      at org.jboss.profileservice.cluster.repository.DefaultRepositoryClusteringHandler$ActiveSynchronization.prepare(DefaultRepositoryClusteringHandler.java:
      1274)
      at org.jboss.profileservice.cluster.repository.DefaultRepositoryClusteringHandler.handlePrepare(DefaultRepositoryClusteringHandler.java:868)
      at org.jboss.profileservice.cluster.repository.DefaultRepositoryClusteringHandler.access$700(DefaultRepositoryClusteringHandler.java:68)
      at org.jboss.profileservice.cluster.repository.DefaultRepositoryClusteringHandler$RpcTarget.prepare(DefaultRepositoryClusteringHandler.java:1119)
      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 org.jgroups.blocks.MethodCall.invoke(MethodCall.java:331)
      at org.jboss.ha.framework.server.ClusterPartition$RpcHandler.handle(ClusterPartition.java:2313)
      ...

      Attachments

        Issue Links

          Activity

            People

              rhn-support-dereed Dennis Reed
              rhn-support-dereed Dennis Reed
              Misty Stanley-Jones Misty Stanley-Jones (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: