ARG! Please Help
I have a class that needs to read in database connection info from a file called database.dat. The class is located here: $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/OracleBroker.class I refer to this file as follows: String datfile = database.dat; I then use the class from a jsp file: $TOMCAT_HOME/webapps/ROOT/index.jsp It cannot find database.dat, I have tried placing this file in nearly every directory under the tomcat tree. Where does this file need to do? Thanks, CC Chuck Carson Sr. Systems Administrator Syrrx, Inc. 10410 Science Center Drive San Diego, CA 92121 E: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] W: 858.731.3540 M: 858.442.0827 -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.
Re: ARG! Please Help
This will work if you run the class on its own, because without a full path, it's assumed that it is in the working directory of the invoked VM, which would be the directory you executed the class. In a webapp, the working directory is the one that tomcat started up with, which should be by now obvious why the file can't be found. Try this : Object obj = test ; InputStream myinput = obj.getClass().getResourceAsStream(smskannel.conf) ; BufferedInputStream mybuffer = (BufferedInputStream) myinput ; I put the class in a jar file along with smskannel.conf and it can still find the file. Or you could allow the file to be set by calling the constructor of OracleBroker.class as part of its initialization parameters. Chuck Carson wrote: I have a class that needs to read in database connection info from a file called database.dat. The class is located here: $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/OracleBroker.class I refer to this file as follows: String datfile = database.dat; I then use the class from a jsp file: $TOMCAT_HOME/webapps/ROOT/index.jsp It cannot find database.dat, I have tried placing this file in nearly every directory under the tomcat tree. Where does this file need to do? Thanks, CC Chuck Carson Sr. Systems Administrator Syrrx, Inc. 10410 Science Center Drive San Diego, CA 92121 E: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] W: 858.731.3540 M: 858.442.0827 -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ARG! Please Help
application.getRealPath() return web application directory try use this -Original Message- From: Chuck Carson [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:12 AM To: Tomcat Users List Subject: ARG! Please Help I have a class that needs to read in database connection info from a file called database.dat. The class is located here: $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/OracleBroker.class I refer to this file as follows: String datfile = database.dat; I then use the class from a jsp file: $TOMCAT_HOME/webapps/ROOT/index.jsp It cannot find database.dat, I have tried placing this file in nearly every directory under the tomcat tree. Where does this file need to do? Thanks, CC Chuck Carson Sr. Systems Administrator Syrrx, Inc. 10410 Science Center Drive San Diego, CA 92121 E: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] W: 858.731.3540 M: 858.442.0827 -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ARG! Please Help
I think some of your message was chopped, exactly how would I use this? Thanmks, CC -Original Message- From: Galbayar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 11, 2002 6:26 PM To: Tomcat Users List Subject: RE: ARG! Please Help application.getRealPath() return web application directory try use this -Original Message- From: Chuck Carson [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:12 AM To: Tomcat Users List Subject: ARG! Please Help I have a class that needs to read in database connection info from a file called database.dat. The class is located here: $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/OracleBroker.class I refer to this file as follows: String datfile = database.dat; I then use the class from a jsp file: $TOMCAT_HOME/webapps/ROOT/index.jsp It cannot find database.dat, I have tried placing this file in nearly every directory under the tomcat tree. Where does this file need to do? Thanks, CC Chuck Carson Sr. Systems Administrator Syrrx, Inc. 10410 Science Center Drive San Diego, CA 92121 E: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] W: 858.731.3540 M: 858.442.0827 -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ARG! Please Help
% String webappdir=application.getRealPath(); out.println(webappdir); String data=webappdir+/database.dat % -Original Message- From: Chuck Carson [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:25 AM To: Tomcat Users List Subject: RE: ARG! Please Help I think some of your message was chopped, exactly how would I use this? Thanmks, CC -Original Message- From: Galbayar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 11, 2002 6:26 PM To: Tomcat Users List Subject: RE: ARG! Please Help application.getRealPath() return web application directory try use this -Original Message- From: Chuck Carson [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:12 AM To: Tomcat Users List Subject: ARG! Please Help I have a class that needs to read in database connection info from a file called database.dat. The class is located here: $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/OracleBroker.class I refer to this file as follows: String datfile = database.dat; I then use the class from a jsp file: $TOMCAT_HOME/webapps/ROOT/index.jsp It cannot find database.dat, I have tried placing this file in nearly every directory under the tomcat tree. Where does this file need to do? Thanks, CC Chuck Carson Sr. Systems Administrator Syrrx, Inc. 10410 Science Center Drive San Diego, CA 92121 E: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] W: 858.731.3540 M: 858.442.0827 -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ARG! Please Help
Oh okay. That is a good way of doing it, thanks a bunch. -CC -Original Message- From: Galbayar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 11, 2002 6:34 PM To: Tomcat Users List Subject: RE: ARG! Please Help % String webappdir=application.getRealPath(); out.println(webappdir); String data=webappdir+/database.dat % -Original Message- From: Chuck Carson [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:25 AM To: Tomcat Users List Subject: RE: ARG! Please Help I think some of your message was chopped, exactly how would I use this? Thanmks, CC -Original Message- From: Galbayar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 11, 2002 6:26 PM To: Tomcat Users List Subject: RE: ARG! Please Help application.getRealPath() return web application directory try use this -Original Message- From: Chuck Carson [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:12 AM To: Tomcat Users List Subject: ARG! Please Help I have a class that needs to read in database connection info from a file called database.dat. The class is located here: $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/OracleBroker.class I refer to this file as follows: String datfile = database.dat; I then use the class from a jsp file: $TOMCAT_HOME/webapps/ROOT/index.jsp It cannot find database.dat, I have tried placing this file in nearly every directory under the tomcat tree. Where does this file need to do? Thanks, CC Chuck Carson Sr. Systems Administrator Syrrx, Inc. 10410 Science Center Drive San Diego, CA 92121 E: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] W: 858.731.3540 M: 858.442.0827 -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]