Question concerning read file
Hello All,
I wrote a program to read a file. When I compile and run the file it runs fine. I take this same code and try to read the file using a JSP page and now my error is file cannot be found, can some one tell be what's wrong here. I'm just calling the class from the JSP page nothing more, and I'm getting File not found although the path was specified correctly and the program worked as a stand alone using Main before.
Please any help?
KT
I want this program to at least read the file from my JSP page
Here is part of the source code for the Java file
1)
DataInputStream inFile=
new DataInputStream(
new BufferedInputStream(
new FileInputStream("Data_452SY2.txt")));
DataOutputStream outFile = new DataOutputStream(
new FileOutputStream("test2.xls"));
String readDetail_topLayer;2)
Here is the JSP page (not doing anything yet) just accepting the java file
<%@page import="dev.*" %>
<%@page session="true" language="java" import="java.io.*" import="java.util.*" %>
<jsp:useBean id="wagerhist" scope="page" class="dev.RoundDetail2" />
3) the rest is just HTML code
the path for the inoput file ("Data_452SY2.txt") is in the same directory as the class file, but I'm getting file not found exception
any help?
Similar Messages
-
Important question for reading File
Good morning
i need help...
any one know 1 class for oper all document?
example:
http:sitoclient.com/?file?filename.txt
or
/home/class/filename.txt
i need 1 class for open file in all mode
where is this class?
one class for read file in url or in absolute path
Message was edited by:
mirko81ok i know this class but i not know where insert Java.net in my code....
and i need use class BufferReader for other problem...
where insert Java.net.URL ??
String keyCode = "";
BufferedReader file = new BufferedReader(new FileReader(keyFile));
if(file.read() > 0)
int i = 0;
String appKey = file.readLine();
for(i=0;i<500;i++)
char c = appKey.charAt(0);
if(c==' '| c=='#')
appKey = file.readLine();
else
keyCode = keyCode + appKey;
appKey= file.readLine();
char cd = appKey.charAt(0);
if(cd==' '| cd=='#')break;
else
System.out.println("File corrotto o non presente");
} -
A general question concerning .EAR files?
Hi All,
My question is, what should be the file extension of the utility class that
I will include in my ".ear" file? Should it be filename.jar or
filename.war? The team that I am on has successfully been able to deploy a
.ear file that only contains our entity and session beans. We would also
like to "JAR" up our utility class, so that we may be to use the hot
deployment feature of the application server and the removal of the
enviroment variable where the utility classes are located.
We are currently using the Ant utility to help us build our .ear file.
When I give the utility file name a ".war" extension and then deploy the
".ear" file; the application server boots up successfully without throwing
any exceptions. When I give the utility file name a ".jar" extension and
then deploy the ".ear" file, the application server boots up successfully
with exceptions concerning unable to locate one to several utility classes.
Thank you in advance,
Charles
Charles Jean-Baptiste
[email protected]It sounds like you are having a ClassLoader problem.
The main advantage of deploying EJBs and WebApps in an ear file is that the
ClassLoader for the webapp inherrits from the ClassLoader for the EJBs.
This basicly means that the webapp can see the EJBs...when you put another
util.jar file in the EAR file this will be in a different ClassLoader and
not accesible by either the EJBs or the WebApp
(and visa-versa)....to make this accesible you need to add the entry
Class-Path: util.jar to the manifest file for the EJB.
1)Create a text file newmanifest.txt with a one line entry of
Class-Path: util.jar
2) When you build the original EJB jar file do like this:
jar cmf newmanifest.txt MyEJB.jar com META-INF
-this will create the jar file MyEJB.jar adding directories com and META-INF
and including the contents of newmanifest.txt in the manifest for the jar
file.
3) Build this all into the ear file.
The EJB will now be able to see the util.jar and because the WebApp can see
the same as the EJB it will also be able to see the util.jar.
Gareth
"Charles Jean-Baptiste" <[email protected]> wrote in message
news:[email protected]...
Hi All,
My question is, what should be the file extension of the utility classthat
I will include in my ".ear" file? Should it be filename.jar or
filename.war? The team that I am on has successfully been able to deploya
.ear file that only contains our entity and session beans. We would also
like to "JAR" up our utility class, so that we may be to use the hot
deployment feature of the application server and the removal of the
enviroment variable where the utility classes are located.
We are currently using the Ant utility to help us build our .ear file.
When I give the utility file name a ".war" extension and then deploy the
".ear" file; the application server boots up successfully without throwing
any exceptions. When I give the utility file name a ".jar" extension and
then deploy the ".ear" file, the application server boots up successfully
with exceptions concerning unable to locate one to several utilityclasses.
>
Thank you in advance,
Charles
Charles Jean-Baptiste
[email protected] -
Questions concerning the Apachectl file in Oracle HTTP Server
Three more questions concerning Apachectl file:
(1) The ORACLE_HOME in the file should be the ORACLE_HOME for HTTP SERVER, not the one for database, right?
ORACLE_HOME=/u01/app/oracle/product/10.2.0/http_1
(2) The TNS_ADMIN in the file should be the TNS_ADMIN for HTTP SERVER, not the one for database, right?
TNS_ADMIN=${TNS_ADMIN="/u01/app/oracle/product/10.2.0/http_1/network/admin"}; export TNS_ADMIN
(3) I don't have a httpd.pid file pointed by PIDFILE. Is this a problem?
PIDFILE=/u01/app/oracle/product/10.2.0/http_1/Apache/Apache/logs/httpd.pid1) right, OHS should be installed in separate home then db
2) not right...in OHS there is no TNS entry...frankly there is no "/ADMIN" dir at all! In db ORACLE_HOEM TNS entry is irrelevant for OHS...it looks the same before and after instlation of OHS.
3) On my server "httpd.pid" is in "C:\oracle\product\10.2.0\db_2\Apache\Apache\logs" and content is "2272". There is reference in httpd.conf file "PidFile logs/httpd.pid". I have never touched or reconfigured it by myself, httpd.conf is customized by instalation of apex!
Hope this helps -
Good afternoon ladies and gentlemen!
My question concerns the impossibility to open RAW-files directly from the program Adobe Bridge. At the moment when you open a RAW-file from Adobe Bridge by double-clicking, RAW-file is opened only in Photoshop. In the settings Adobe Bridge - in "open RAW-files by double-clicking in Adobe Camera Raw» box is checked. When you try any changes in the settings Adobe Bridge system displays a message:
Bridge's parent application is not active. Bridge requires that a qualifying product has been launched at least once to enable this feature.
The entire line of Adobe products on my computer updated to the latest updates. Previously, a family of products Adobe Photoshop on your computer is not set. Computer - PC, Windows 7 Enterprises.<moved from Adobe Creative Cloud to Bridge General Discussion>
-
Questions on reading a file...
Hi All,
I have a few questions on reading a file...
1st of all ... if I have
BufferedReader inFile = new BufferedReader (new FileReader("tickets.txt"));and I do inFile.readLine(); will it read the next line everytime I do that? ... say I had a file that had 5 lines of text and I did inFile.readLine(); 5 times will I get the first line 5 times or will I get each line?
If the is a blank line in the file will it return null?
how can I feed the file name to args[0] and what is that for?
Thanks,
Mikepublic static void main(String args[]) {
BufferedReader inFile = null;
try {
inFile = new BufferedReader (new FileReader(args[0]));
for (int i = 0; i < reservation.length; i++) {
readFile(reservation, inFile, arrayCounter, numberOfReadItems);*/
inFile.close();
catch (ArrayIndexOutOfBoundsException aioobe) {
System.out.println("Parameter required");
System.exit(0);
catch (FileNotFoundException fnfe) {
System.out.println("File not found");
System.exit(0);
catch (IOException ioe) {
System.out.println("Failed to close file");
System.exit(0); -
IMovie - quick questions about video files when importing and optimizing
Hi, have some quick questions. I think they are simple.
1. When I import a video (from say iPhoto), where does it get "Move" or "Copy" to?
2. Why would I want to do "Copy" instead of "Move", because isn't it then taking up more space?
3. I'm wondering if after I optimize a video, I can stash away the original (non-optimized video that I either "Move"d or "Copy"d earlier) into an external hd.
4. By the way, what is the new file name of the optimized video?
Though things are working fine in iMovie and iPhoto, I'm trying to manage hard disk space, and hope answers to these questions will help.
Do you guys have a guideline on how to manage hard disk space when it comes to iphoto and imovie?
Thanks.As has been suggested you can encourage people to download QuickTime player by doing something like this...
http://www.mirroroftheuniverse.com/Songs.html
You can also present your songs like this...
http://roddymckay.com/Satellite/JukeBox.html
This is a SnoCap jukebox and you need an account to use it but you'll get the link to ESnips on the above page.
A 3 minute song has a file size of about 30 Mb in AIFF format. Converting it to MP3 reduces it to about 3.5 Mb and M4A to about 5.5 Mb.
iTunes will do these conversions for you and M4A is far superior to MP3 as far as sound quality is concerned. -
Question concerning KW Content Update
Hello,
I have a question concerning updating the KW content: On the Content Update DVDs are *.KWE files. What should I do with this files? Must I also import these files with my batch file like the *.SAP files?
Could someone help me?
Thanks
Edited by: Malte Jacobi on Apr 8, 2008 8:39 AM"And Custom Tags scares me"Then you better dont read to many posts in this forum.
and maybe not the rest of my post either
With JSTL
Here all common fields
<c:choose>
<c:when test="${test to see if its a landlord}">
All the landlord field here
<c:when>
<c:otherwise>
All the not landlord fields here
<c:otherwise>
</c:choose> -
HOW TO DELETE ADOBE READER FILE FROM ADOBE READER
HOW TO DELETE ADOBE READER FILE FROM ADOBE READER@ !@
Your question make no sense. What exactly are you trying to do?
-
Question about download file in OAS4
Question about download file in OAS4:
I use Oracle Application Server 4.0.7 on my Windows NT 4.0 SP6;
I use PL/Sql Cartridge developer a document system; It's use the
upload/download in PL/Sql Cartridge;
I read the document , the Upload/download in Pl/Sql Base on the
Oracle Application Server's Content Service. the Problem is when I
download a document, If I upload a Html or MsWord file, It will store in a LongRaw column, when me download ; It's tell me can't
find a application to open this file; I will select a application
from list to open the download file;
As normal, It will open MsWord Automatic when download a "doc" file ; also It will open a new window of Browser to view a Html file;
I check the download process on client Browser; when download
file, The content-type always return "application/octet-stream";
Also the download File will lost the postfix of the file,
So Browser don't open the File Automatic;
I think If I set the correct Content-Type , Browser can know how open the file; So I use owa_content.set_content_type procedure
set the Doc file to "application/msword" , but the WEb Server always
return "application/octet-stream";
I didn't know how to do this problem, Plese help me.
nullI have a Tecra M2 and rely on your email update to ensure I have the latest drivers on my machine.
When I received a Toshiba support email on 14 April 2005 giving reference to a QFE from Microsoft I assumed it would be necessary for my Tecra.
I was very confused when I found that this QFE and subsequent ones posted on the 16 April 2005 relate to Pre SP2 critical updates no9t required if one has already taken earlier advice of updating to Service Pack, at the very least your narrative should make mention of this. I find it very difficult to believe that your updates are two+ years out of date. -
How to read file from server if I have a logical file path?
Hi guys,
I'm having a pretty "on the run" question,
My program is currently reading a file from server using "open dataset" with file path like this (just example)
/usr/interface/abc/bcd/testfile.dat
Now I got a requirement to make it more consistent to read files, instead of reading that physical file name, I should read the files from a specific folder using logical path.
So I go to T code "FILE" and created a logical path called ZABC_FILE_PATH, unix compatible, with physical path is (for example),
/usr/interface/<sysid>/<client>/<filename>
My question is, can I still use open dataset statement to read this? if yes, how do I do that? If no, there should be alternative way, please let me know what you think. Thanks,Thanks all, I figured it out.
ONe thing is that typo double quote
The other thing is the importing part, I need the full file path.
CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
EXPORTING
CLIENT = SY-MANDT
logical_path = 'ZABC_MY_LOGICAL_FILE_PATH'
* OPERATING_SYSTEM = SY-OPSYS
* PARAMETER_1 = ' '
* PARAMETER_2 = ' '
* PARAMETER_3 = ' '
* USE_BUFFER = ' '
file_name = v_1
* USE_PRESENTATION_SERVER = ' '
* ELEMINATE_BLANKS = 'X'
IMPORTING
FILE_NAME_WITH_PATH = v_what_I_need
* EXCEPTIONS
* PATH_NOT_FOUND = 1
* MISSING_PARAMETER = 2
* OPERATING_SYSTEM_NOT_FOUND = 3
* FILE_SYSTEM_NOT_FOUND = 4
* OTHERS = 5
I really appreciate your contributions, thanks again! -
FRM-10221 Cannot read file PL000000-but there is no menu named PL000000 !!?
Hi all!
I'm having a problem wich will get me nervous!
Here we have an application 100% generated from designer. The problem is that it have been started in questionnables ways ... there is 2 workarea to contains all the forms needed for the application instead of 2 containers in the same workarea. The workarea "JD" where we put all the utility forms and the workarea "PL" where we put all the forms use for the application configuration.
Recently I have developped a new form in the container "PL" but the menu calling this form is in the workarea "JD" with a fake copy of the original form so we can refer it in the "JD" menu. When i generated and run the applications and i choose my new form in the menu i got the error "FRM-10221 Cannot read file PL000000" 2 times then the forms is called and is running correctly. I really don't understand whats is going on cause there is no menu called "PL000000" in the 2 workarea!!!
All that i read about this error mesage from now tell that the menu is not in the form path or many other solution, but in my case I got an error about a menu that does not exists!! I know that something is triggering this but i just can't find it cause there is no menu called "PL000000" anywhere in this application!!??
Is there someone who could have an idea about whats going on here!!??? HELP PLEASE!
Thank you!Thanks alot!
I'm not familiar with 100% generated forms from Designer yet and your answer make me discover something. It seems that when you generate a new form, the main menu of the container is automatically attached to that forms by default.
Plus i was wrong in a point in my original post. There was no menu named "PL000000" but there was one named something else but with the "implementation name" as "PL000000" ... my bad ...
Thanks alot again, my problem is now solved!
:o) -
I tried to move my PE6 install and catalog to a new computer. It was on a Dell Windows XP machine, and I moved it to a Toshiba Windows 7 (64 bit) machine. I have always kept my photo files on an external hard drive. My photo library is 50GB, 10,000 files. Here is what I did.
Copied the original PE6 install file to the Toshiba. Installed but didn’t activate it.
Copied the entire My Catalog folder to the proper Windows 7 location.
Plugged the external drive into the Toshiba. Made sure the same drive letter as before (E).
Fired up PE6 on Toshiba. Looked good in Organizer. Everything seemed to be there, but I didn't try to make changes at that point.
Deactivated PE6 on the Dell. Activated on the Toshiba.
Then I realized that it is not right. I can edit Keywords and Rating stars on the pics, but not dates, captions or notes. I get “An error occurred while reading files or writing files to disc. The disc may be full or there may be problems with the source media.”
Only a fraction of the external drive is in use.
I can access the files on the external drive with another app (Windows Photo Viewer).
I tried Reconnect All Missing Files. Somewhat ambiguously, it says “There are no files to reconnect.”
In the properties in the Organizer for each picture are the proper file names and paths. Folder view works fine in Organizer.
I can put new files in the same external drive directories, import them into PE6, then edit them normally.
What is the easiest way to get Organizer properly connected to my files? I suppose I could reimport all the pics on the new machine, but I assume I'd lose some of my metadata. So that is out of the question.
Thanks,
BillAre you sure that file paths are correct? I say this because under XP they would have originally pointed to Documents & Settings/My Pictures whereas on W7 it will be User/Pictures, albeit you are using an external hd.
Take a look at this knowledge base note on the correct procedure for back-up and restore.
I think writing metadata to files for such a large catalog will be a thankless task.
http://helpx.adobe.com/photoshop-elements/kb/backup-restore-move-catalog-photoshop.html -
Reading files from Java embedding.
Dear All,
My BPEL process has a Java embedding node, and it invokes a Java class, in which an xsl file is being read for transformation.
I deploy the xsl files directory together with BPEL package (the jar). In the package, I put the file dir at the root level, which means the jar structure looks like the following:
/BPEL-INF
/META-INF
/xsd
/xsl
*.wsdl
*.bpel
bpel.xml
The java class is package in /BPEL-INF dir, it's supposed to read files from /xsl dir.
My question is, how should I put the file path?
I tried "/xsl/***.xsl" and "../xsl/***.xsl", neither works. Although "/xsl/***.xsl" worked when testing in JDeveloper, but FileNotFound after deployment.
Thanks,
HaiboI solved this issue by putting the files dir in /BPEL-INF/classes/. and use ClassLoader to read in those files.
-
I have a question about DWG files. What app will allow me to open DWG files to view them on my Macbook Pro?
Perform this Google search: ".dwg files on mac." The results should provide answers for you.
Maybe you are looking for
-
I deactivated Pro on my old machine, downloaded from the store on my new machine and tried to open it. A window popped up that said I had a valid product key, but that it didn't match the software on my machine. The drop down box did not list my pr
-
About the bat file to start and stop the weblogic server10.3
I am using windows 2003 os. i installed the WLS 10.3 . can anyone help me how to write the bat file for starting and stoping the weblogic server instance.so that it willl run as background service. I am new to this .Please suggest me Any help is appr
-
Order budget checking in creation PA30
Hi everyone, My requirement is to have order budget checking in HR modul. Currently if user create claim transaction with internal order number, there is no checking for the order budget. I noticed that the HR module and FI module is not related in t
-
How to refresh training system/client
Hi Experts, I have a ECC6.0 IDES which is used for training purposes.Now the database(/oracle file system) is approaching 100%. Can anyone let me know how can I refresh the system ( by scheduling any background job? not sure). Actually the client 001
-
Unlock all objects in document(s)?
I suspect the answer is no, but is there a way to do this? I've got 60 files originally made by rhesus monkeys and they found the "lock" command. Thanks.