aspose file tools*
The moose likes JBoss/WildFly and the fly likes How to read file in to jboss server. sending File name as parameter? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to read file in to jboss server. sending File name as parameter?" Watch "How to read file in to jboss server. sending File name as parameter?" New topic
Author

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

jahnavi bodhankar
Greenhorn

Joined: Nov 28, 2008
Posts: 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
Posts: 2902
    
    1

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] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to read file in to jboss server. sending File name as parameter?