Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1105

Cannot read modeshape-initial-content.xml when deployed as service

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 2.5.0.Beta1
    • 2.4.0.Final
    • Graph (2.x)
    • None

      When Guvnor is trying to get a handle to the repository, at some point the following code in the Graph.java is hit trying to read the modeshape-initial-content.xml file:

        public ImportInto<Conjunction<Graph>> importXmlFrom( String resourceName,
                                                             ClassLoader classLoader ) {
              CheckArg.isNotEmpty(resourceName, "resourceName");
              // Try the resource on the classpath ...
              if (classLoader == null) classLoader = getClass().getClassLoader();
              InputStream stream = null;
              RuntimeException error = null;
              try {
                  stream = getClass().getResourceAsStream(resourceName);
      

      And stream ends up null.

      When I change the code to:

          public ImportInto<Conjunction<Graph>> importXmlFrom( String resourceName,
                                                               ClassLoader classLoader ) {
              CheckArg.isNotEmpty(resourceName, "resourceName");
              // Try the resource on the classpath ...
              if (classLoader == null) classLoader = getClass().getClassLoader();
              InputStream stream = null;
              RuntimeException error = null;
              try {
                  stream = classLoader.getResourceAsStream(resourceName);
      

      (note the last line in each snippet) then it all works ok.

      Seems to me that the original author had intended to do it this way.

      --Kurt

              rhauch Randall Hauch (Inactive)
              kstam@redhat.com Kurt Stam (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: