java - How can I access <tomcat>\bin\*.properties when running from inside eclipse? -
does know if tomcat running inside of eclipse uses <tomcat>\bin\
directory when you've configured server use local tomcat install (server view) inside eclipse?
for example: i'm using colleagues jar, subsequently requires x.properties file. i've been instructed place properties file in <tomcat>\bin\
directory. sort of odd me, line fails simply:
inputstream in = new fileinputstream("x.properties");
anyhow, i'm pretty sure editing of server config files not me, though i'm open suggestions. or perhaps there's in launch configuration (below) can change?
no matter what, following stack trace:
java.io.filenotfoundexception: x.properties (the system cannot find file specified) @ java.io.fileinputstream.open(native method) @ java.io.fileinputstream.<init>(fileinputstream.java:106) @ java.io.fileinputstream.<init>(fileinputstream.java:66) @ com.mycompany.myteam.colleaguesproject.colleaguesservlet.init(colleaguesservlet.java:93) @ javax.servlet.genericservlet.init(genericservlet.java:212) @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1139) @ org.apache.catalina.core.standardwrapper.load(standardwrapper.java:966) @ org.apache.catalina.core.standardcontext.loadonstartup(standardcontext.java:3956) @ org.apache.catalina.core.standardcontext.start(standardcontext.java:4230) @ org.apache.catalina.core.containerbase.start(containerbase.java:1014) @ org.apache.catalina.core.standardhost.start(standardhost.java:736) @ org.apache.catalina.core.containerbase.start(containerbase.java:1014) @ org.apache.catalina.core.standardengine.start(standardengine.java:443) @ org.apache.catalina.core.standardservice.start(standardservice.java:448) @ org.apache.catalina.core.standardserver.start(standardserver.java:700) @ org.apache.catalina.startup.catalina.start(catalina.java:552) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:585) @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:295) @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:433)
any appreciated! :-)
java designates directory started 'working directory', , relative paths relative directory. in case, that's tomcat's bin directory, contains tomcat's startup script.
you should put properties file in c:\apache-tomcat-5.5.25\bin make work, though not practice java properties files. reading them in off of java's classpath standard, , more flexible.
Comments
Post a Comment