1 Reply Latest reply on May 17, 2004 3:30 AM by gorano

    question about classpath

    zhebbincopng Newbie

      hello:
      in my servlet,i have following clause:

      properties.load(this.getClass().getResourceAsStream("/test.properties"));

      i put the "test.properties" file under the "classes" directory,it works well,but when i put it in the "lib" directory,the servlet throw null point exception,and can't find the properties file,why?i think that both the "classes" and "lib" directories are within the classpath.
      otherwise,i find that all the files in the lib directory are jar file,so that i guess if i package the properties file within the jar file then put it in the lib directory,maybe it should work.who knows?
      other strange thing is:
      i use jboss as the app server,if i put the properties file in the "%jboss_home%/bin" directory,my code could find it,but when i check the jboss_classpath cofiguration within the "run.bat" file,it don't include the bin directory,i wonder how the jboss put the bin directory in its classpath?

        • 1. Re: question about classpath
          gorano Newbie

           

          if i package the properties file within the jar file then put it in the lib directory,maybe it should work.who knows?


          I know it works, because I simply tested it. lib is only for files packed in jars.

          but when i check the jboss_classpath cofiguration within the "run.bat" file,it don't include the bin directory,i wonder how the jboss put the bin directory in its classpath?


          This is the directory where you start your jboss "run.jar". This directory will automatically be on the classpath.

          /G