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

Windows paths cause problems when looking up configuration files

    Details

    • Steps to Reproduce:
      Hide

      From within a servlet deployed on Glassfish do:

      new DefaultCacheManager("c:
      cachetest.xml");

      Show
      From within a servlet deployed on Glassfish do: new DefaultCacheManager("c: cachetest.xml");
    • Estimated Difficulty:
      Low

      Description

      When initiating the DefaultCacheManager with an absolute windows path from within Glassfish, a IllegalArgumentException is thrown before the configuration is even tried to be read with FileInputStream.

      SEVERE: org.infinispan.config.ConfigurationException: java.lang.IllegalArgumentException: name
      at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:256)

      The problem is easily reproducible by doing:
      new DefaultCacheManager("c:
      cachetest.xml");

      From within a servlet.

      The reason for this problem is found in FileLookup.java line 68, and happens because the classloader throws an IllegalArgumentException for the path provided.

      A simple solution would be to catch runtime exceptions when we try to load a resource from the cache loader, and then fall back to reading the config file with FileInputStream

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                manik Manik Surtani
                Reporter:
                larry2kk Jonas Lasson
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: