1. ActiveMQ
  2. AMQ-1883

KahaStore is unable to create lock file when user.dir is manually changed


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 5.1.0
    • Fix Version/s: NEEDS_REVIEW
    • Component/s: Message Store
    • Labels:
    • Environment:

      jdk 1.6_05


      I've been getting the following exception

      Caused by: activemq-data\localhost-kahastore\lock (The system cannot find the path specified)
      at Method)
      at org.apache.activemq.kaha.impl.KahaStore.initialize(

      I assume that changeset 661435 <> was aimed to fix the problem following problem:
      Error in directory.mkdirs is masked and can result in FileNotFoundException when creating tmp_storage directory <>

      I verified that there is no problem in creating the parent directories, but filesystem thinks that directory doesn't exists after it has been created succesfully. After little more digging I stumbled upon the following:
      File.getAbsolutePath() is incorrect if "user.dir" is set on the command line <;:YfiG?bug_id=4117557>

      There is some more information about using canonical form at Mule project <> and I found out that using getCanonicalFile() does indeed work.

      As a patch I suggest that all file/directory related methods at IOHelper would return (canonical) File instead of String.

      Other not so intrusive possibility would be to change XBeanBrokerService.
      KahaStore.<init>(File, String, AtomicLong) line: 103, String) line: 56
      XBeanBrokerService(BrokerService).getTempDataStore() line: 1178

      There are no Sub-Tasks for this issue.


        Tuomas Kiviaho created issue -
        Tuomas Kiviaho made changes -
        Field Original Value New Value
        Link This issue is related to AMQ-1223 [ AMQ-1223 ]
        Rob Davies made changes -
        Fix Version/s 5.3.0 [ 11914 ]
        Rob Davies made changes -
        Assignee Rob Davies [ rajdavies ]
        Gary Tully made changes -
        Fix Version/s 5.4.0 [ 12110 ]
        Fix Version/s 5.3.0 [ 11914 ]
        Rob Davies made changes -
        Fix Version/s 5.4.0 [ 12110 ]
        Fix Version/s NEEDS_REVIEWED [ 12186 ]
        Jeff Turner made changes -
        Project Import Fri Nov 26 22:32:02 EST 2010 [ 1290828722158 ]
        Timothy Bish made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]


          • Assignee:
            Rob Davies
            Tuomas Kiviaho
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: