Discussions

General J2EE: Question on classloading best practice

  1. Question on classloading best practice (1 messages)

    All articles i have read on class loading state that If you are loading a properties file, use : Thread.currentThread().getContextClassLoader().get ResourceAsStream(). In my particular appliction using oc4j(J2EE) in certain rare occasions this particular technique returns null (In most cases it does pick up the property file) and in those cases getClass().getClassLoader().get ResourceAsStream() seems to work. I want to know the reason as to why everyone is cheering for the former method !! Have been reading a lot about classloading of lately but have not got a conclusive answer yet ?
  2. Re: Question on classloading best practice[ Go to top ]

    hi : I confuse them too.I got some answers from other site . see : http://www.velocityreviews.com/forums/t139970-diff-between-threadgetcontextclassloader-and-classgetclassloaderapi.html Hope help to you!