1

My issue is that I am able to load some files within the same directory but not others.

The following will return null on a few files consistently:

ClassLoader.getSystemClassLoader().getResourceAsStream(pathStr)

A subset of paths found in the jar after a 'jar tf':

app-jade/user/userSettings.jade
app-jade/user/userPassword.jade
app-jade/user/userEmail.jade
app-jade/user/userInfoSettings.jade

I am able to load all of the .jade files in this subset, except for userSettings.jade. I print the path string prior to attempting to get the resource and they match exactly to with whats in the jar like whats seen above(no '/' in front of paths).

Am I not understanding how I should be using the ClassLoader?

Note, I am actually using scala 2.10.0 with the java.lang 1.7 for the class loader.

Thanks for the help!

Baracs
  • 139
  • 1
  • 6
  • 1
    What you're doing looks correct to me, I think we're missing something. What do you mean by "you can't load userSettings.jade", for example? do you get an exception? which one? is it not possible that the file is there, but fails to load because it's corrupt in some way? – Nicolas Rinaudo Sep 24 '13 at 12:31

1 Answers1

1

Check that the userSettings.jade filename doesn't have any non-printing characters in it, like backspace. Sometimes a filename can be messed up by accidental typing.

Zagrev
  • 2,000
  • 11
  • 8