IntelliJ open source
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Products » JBoss
 
RSS feed
 
New topic
Author

How to read file in to jboss server. sending File name as parameter?

jahnavi bodhankar
Greenhorn

Joined: Nov 28, 2008
Messages: 1

In my project i requred file reading in jboss server using file name sending as parameter into function . file is in same system in hard disk.

I am getting following error on server java.io.FileNotFoundException: \models\xyz.txt


Please help me.
Thanks in Advance
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Messages: 2639

Welcome to JavaRanch !!

You post this question in wrong section, FileNotFoundException has nothing to do with on which server your application is running..

Post your code snippet, with relative path of the file you are trying to access, so that we can find out where might be the problem..

[LEARNING bLOG] | ["Rohan" is part of my surname] | [Looking for a Job]
Peter Johnson
author
Bartender

Joined: May 14, 2008
Messages: 2382

Jahnavi, welcome to Java Ranch!

Two things to keep in mind. First, the "current directory" for any code running in JBoss AS is jboss_home/bin, so all relative file lookups will be relative to that directory. Second, any filename starting with a "/" or "\" is assumed to be an absolute file path on the same disk as JBoss AS. For example, is you really gave the filename "\models\xyz.txt", and JBoss AS is running on the D: driver, then the file's path is "d:\models\xyz.txt"

If that does not help, please tell us the full path location for your file, and post the code you are using to access that file.

JBoss In Action
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Products » JBoss
 
RSS feed
 
New topic
replay challenge