Will InputStreamReader getResourceAsStream work in Linux?

Whether that code works depends on if the classloader which loaded the calling class as represented by getClass() in your code has access to the WEB-INF/classes Apparently the class in question is by itself not inside the WEB-INF/classes or has a copy which is placed elsewhere in the classpath and server make/version used in the Linux environment uses a somewhat different classloader hierarchy than the server make/version used in the Windows environment.

Whether that code works depends on if the classloader which loaded the calling class as represented by getClass() in your code has access to the /WEB-INF/classes. Apparently the class in question is by itself not inside the /WEB-INF/classes or has a copy which is placed elsewhere in the classpath and server make/version used in the Linux environment uses a somewhat different classloader hierarchy than the server make/version used in the Windows environment. Fact is, if you can't guarantee that the properties file is to be loaded by the same classloader as the calling class, then you should not try to get it by the classloader of the calling class, but by the context class loader of the current thread.It has access to everything.

Prop. Load(Thread.currentThread(). GetContextClassLoader().

GetResourceAsStream("Myservice. Properties")); Please note that with this class loader, the path cannot be relative.So don't start with a leading slash.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions