Problem in reading BMP file .....

I've facing some inconsistency in reading BMP headers. There are two of them, and I've outlined them below....
Here's a description of the BMP headers, just for refreshing ....
1.
     typedef struct {
     BITMAPFILEHEADER bmfHeader;
     BITMAPINFOHEADER bmiHeader;
     GLubyte *image_data;
     } BITMAP_IMAGE;
     typedef struct tagBITMAPFILEHEADER {
          WORD bfType;               // 2B
          DWORD bfSize;               // 4B
          WORD bfReserved1;     // 2B
          WORD bfReserved2;     // 2B
          DWORD bfOffBits;          // 4B
     } BITMAPFILEHEADER, *PBITMAPFILEHEADER;
     typedef struct tagBITMAPINFOHEADER{
     DWORD biSize;
     LONG biWidth;
     LONG biHeight;
     WORD biPlanes;
     WORD biBitCount;
     DWORD biCompression;
     DWORD biSizeImage;
     LONG biXPelsPerMeter;
     LONG biYPelsPerMeter;
     DWORD biClrUsed;
     DWORD biClrImportant;
     } BITMAPINFOHEADER, *PBITMAPINFOHEADER;
2. The file I'm reading test2.bmp has the following parameters
     File Type                     Windows 3.x Bitmap (BMP)
     Width                         4
     Height                         4
     Horizontal Resolution     96
     Vertical Resolution          96
     Bit Depth                    24
     Color Representation     True Color RGB
     Compression                    (uncompressed)
     Size                         102 bytes
     Size on disk               4.00 KB (4,096 bytes)
3. Output of the program is....
          File Headers are...
          bfType :424d
          bfSize :102
          bfReserved1 :0
          bfReserved2 :0
          bfOffBits :54
          File Info Headers are...
          biSize :40
          biWidth :4
          biHeight :4
          biPlanes :0
          biBitCount :1
          biCompression :1572864
          biSizeImage :48
          biXPelsPerMeter :196
          biYPelsPerMeter :234881220
          biClrUsed :234881024
          biClrImportant :0
4.      readInt()     4
          Reads four input bytes and returns an int value.
     readUnsignedShort()     2
          Reads two input bytes and returns an int value in the range 0 through 65535.
     readByte()
          Reads one Byte
5. The bfType fields value should be 'BM' whose Hex is 0x4D42 according to this link
http://edais.earlsoft.co.uk/Tutorials/Programming/Bitmaps/BMPch1.html
But the Hex I get is 424d.How come ?
6. When reading bfSize (see ## ), we should read 4 bytes as per the above structure. But I don't
get the answer of 102 when I do readInt() (which reads 4B). On the contrary, when I do
readByte(), thats when I the right file size of 102.
Why ?
Rest all the output look ok.
import java.io.*;
class BMPReader{
     private byte data[];
     private DataInputStream dis = null;
     public BMPReader(String fileName){
          readFile(fileName);
     private void readFile(String fileName){
          try{
               dis = new DataInputStream(new FileInputStream(new File(fileName)));
          catch(Exception e){
               System.out.println(e);
     public void printFileHeader(){
          System.out.println("File Headers are...");
          try{
               // converting the 2 bytes read to Hex
               System.out.println("bfType :" + Integer.toString(dis.readUnsignedShort(),16));
               System.out.println("bfSize :" + dis.readInt());
               //System.out.println("bfSize :" + dis.readByte());// ## identifier, should read 4B here instead of 1B
               System.out.println("bfReserved1 :" + dis.readUnsignedShort());     // bfReserved1
               System.out.println("bfReserved2 :" + dis.readUnsignedShort());     // bfReserved2
               System.out.println("bfOffBits      :" + dis.readInt());               // bfOffBits
          catch(Exception e){
               System.out.println(e.toString());
     public void printFileInfoHeader(){
          System.out.println();
          System.out.println("File Info Headers are...");
          try{
               System.out.println("biSize           :" + dis.readInt());                         //DWORD
               System.out.println("biWidth      :" + dis.readInt());                     //LONG
               System.out.println("biHeight      :" + dis.readInt());                     //LONG
               System.out.println("biPlanes      :" + dis.readUnsignedShort());          //WORD
               System.out.println("biBitCount      :" + dis.readUnsignedShort());     //WORD
               System.out.println("biCompression     :" + dis.readInt());               //DWORD
               System.out.println("biSizeImage      :" + dis.readInt());               //DWORD
               System.out.println("biXPelsPerMeter :" + dis.readInt());          //LONG
               System.out.println("biYPelsPerMeter :" + dis.readInt());          //LONG
               System.out.println("biClrUsed          :" + dis.readInt());                    //DWORD
               System.out.println("biClrImportant      :" + dis.readInt());               //DWORD
          catch(Exception e){
               System.out.println(e.toString());
public class BMPReadForum{
     public static void main(String args[]){
          String fName = "test2.bmp";
          BMPReader bmpReader = new BMPReader(fName);
          bmpReader.printFileHeader();
          bmpReader.printFileInfoHeader();
}

I stumbled across this thread while messing with numbers coming out of my palm (via pilot-xfer) that are unsigned 32 bit values read into a 4 element byte array. I would very much like to turn these things into longs. I looked over the above posted code (for which I am most grateful) and made some alterations that seemed prudent, would someone be so kind as to verify that this is doing what I would like it to do?
private long makeUInt(byte[] b) {
    // Convert a four byte array into an unsigned
    // int value. Created to handle converting
    // binary data in files to DWORDs, or
    // unsigned ints.
    long result = 0;
    int bit;
    int n = 0;    // I assumed this was the power to take the base to - 0 for lsb
    // I further assumed that we need to move backwards through this array,
    // as LSB is in the largest index, is this right?
    for (int a=3; a >= 0; a--) {
        // Similarly, I need to step through this backwards, for the same
        // reason
        for (int i=7; i >= 0; i--) {
            bit = b[a] & 1;
            result += bit * Math.pow(2, n++);
            b[a] >>>= 1;
    return result;
}So, as you see - I assumed the "n" term was a count for what power of 2 we were in in the bit string, and I further assumed that, since for me the MSB is in the byte array element with the largest index, I needed to work backwards through this thing.
Does this seem reasonable?
Thanks a lot
Lee

Similar Messages

  • Problem While reading a file in text mode from Unix in ECC 5.0

    Hi Experts,
    I am working on Unicode Upgrade project of ECC5.0.
    Here i got a problem with reading a file format which it does successfully in 4.6 and not in ECC5.0
    My file format was as follows:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    It was successfully converting corresponding field values in 4.6:
    *4
    00000186
    2004
    06
    03
    00000010
    25
    0
    4
    0
    54.75
    0
    54.75
    0.00
    While i am getting some problem in ECC5.0 during conversion of the above line:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    it was consider in the same # values.
    I have used the following statement to open and read dataset.
    OPEN DATASET i_dsn IN LEGACY TEXT MODE FOR INPUT.
    READ DATASET i_dsn INTO pos_rec.
    Thanks for your help.
    Regards,
    Gopinath Addepalli.

    Hi
          You might be facing this problem because of uni code. So while opening or reading the file, there is a statement call ENCODING. Use that option and keep the code page which you want. Then the problem may be solved.
    Thanks & Regards.
    Harish.

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts
    I am facing a problem while  reading XML file from Aplication server  using open data set.
    OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
    IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      READ DATASET v_dsn INTO v_rec.
    WHILE sy-subrc <> 0.
      ENDWHILE.
      CLOSE DATASET v_dsn.
    The XML file contains the details from an IDOC number  ,  the expected output  is XML file giving  all the segments details in a single page and send the user in lotus note as an attachment, But in the  present  output  after opening the attachment  i am getting a single XML file  which contains most of the segments ,but in the bottom part it is giving  the below error .
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    for all the xml  its giving the error in bottom part ,  but once we open the source code and  if we saved  in system without changing anything the file giving the xml file without any error in that .
    could any one can help to solve this issue .

    Hi Oliver
    Thanx for your reply.
    see the latest output
    - <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    E1EDT13 with QUALF>003 and  <E1EDT13 SEGMENT="1">
    with   <QUALF>001 having almost same segment data . but  E1EDT13 with QUALF>003  is populating all segment data
    properly ,but E1EDT13 with QUALF>001  is giving in between.

  • Read BMP File Requires Absolute Path

    I noticed something today regarding the Graphics Formats, Read JPG File, Read PNG File and Read BMP File vi's. It seems that when reading a JPG or PNG file, a relative path is OK, but when reading a BMP file, an absolute path is required. When the path only contains the filename, it returns:
        Error 1430
        "Open/Create/Replace File in Read BMP File Data.vi->Read BMP File.vi->ReadImageFileTest.vi"
    I tried a simple test that uses either the relative or absolute path, trying to read 3 different files in the same directory as the VI. Only the Read BMP File errors. Of course, the simple work around is to always use the full pathname to a file. Is this only on my system? Is this a known bug or feature or expected behavior?
    I'm using LabVIEW 8.2 on Windows XP.
    Thanks!
    B-)
    Message Edited by LabViewGuruWannabe on 11-05-2007 11:06 PM
    Attachments:
    ReadImageFileTest-FPgood.PNG ‏30 KB
    ReadImageFileTest-FPbad.PNG ‏26 KB
    ReadImageFileTest-BD1.PNG ‏48 KB

    Missed this on the first post:
    Message Edited by LabViewGuruWannabe on 11-05-2007 11:10 PM
    Attachments:
    ReadImageFileTest-BD.PNG ‏48 KB

  • Problem with reading config file

    Hello,
    I have problem with reading config file from the same dir as class is. Situation is:
    I have servlet which working with DB, and in confing file (config.pirms) are all info about connection (drivers, users, passw, etc.). Everything work fine if I hardcoded like:
    configFileName = "C:\\config.pirms";I need to avoid such hardcoding, I tryied to use:
    configFileName = Pirms.class.getClassLoader().getResourceAsStream ("/prj/config.pirms").toString();but it isn't work.
    My config file is in the same directory as Pirms.class (C:\apache-tomcat-5.5.17\webapps\ROOT\WEB-INF\classes\prj)
    Also I tryied BundledResources, it isn't work fo me also.
    Can anybody help me to solve this problem? with any examples or other stuff?
    Thanks in advance.
    Andrew

    Thanks, but I am getting error that "non-static method getServletConfig() cannot be referenced from a static context"
    Maybe is it possibility to use <init-param> into web.xml file like:
    <init-param>
      <param-name>configFile</param-name>
      <param-value>/prj/config.pirms</param-value>
    </init-param>If yes can anybody explain how to do that?
    I need to have that file for:
    FileReader readFile = new FileReader(configFile);Thanks in advance.

  • Problems when reading pdf files

    I use windows 7, and also have available Adobe Reader 5 and Adobe Reader X, but i receive some problems when reading pdf files. What can I do???

    Reader 5 is not Windows Compatible. Two different versions of the same computer can cause all sorts of problems. Remove all Acrobat and/or Reader software then re-install Reader X.

  • Problem while reading the file from FTP server

    Hi Friends,
    I have a problem while fetching files from FTP server.
    I used FTP_Connect, FTP_COMMAND function modules. I can able to put the files into FTP server.
    but I cant able to pick the files from FTP server.
    anyone have faced similar issues kindly let me know.
    Thanks
    Gowrishankar

    Hi,
    try this way..
    for reading the file using FTP you need to use different unix command ..
    Prabhuda

  • Problem in Reading XLSX File (MS EXCEL 2007).

    Dear All ,
    I am reading all the properties to XL sheet and then utilising it in my code .
    I am getting some problem in reading the Border of the Cell , my code is working fine with most of the Excel Sheet but it can not correctly read the Border of a few Excel files.
    I am using the method ,
    getBorderBottomEnum()
    or
    getBorderBottom()
    but I can not read the Border used correctly for all the Excel Sheet .
    Please Help.
    Please revert if I am not clear.
    Thanking You All.

    I'm guessing that your question is about Apache POI. They don't have a forum AFAIK, but they do have a [url http://poi.apache.org/mailinglists.html]mailing list.
    John

  • Problems with reading XML files with ISO-8859-1 encoding

    Hi!
    I try to read a RSS file. The script below works with XML files with UTF-8 encoding but not ISO-8859-1. How to fix so it work with booth?
    Here's the code:
    import java.io.File;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import java.net.*;
    * @author gustav
    public class RSSDocument {
        /** Creates a new instance of RSSDocument */
        public RSSDocument(String inurl) {
            String url = new String(inurl);
            try{
                DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document doc = builder.parse(url);
                NodeList nodes = doc.getElementsByTagName("item");
                for (int i = 0; i < nodes.getLength(); i++) {
                    Element element = (Element) nodes.item(i);
                    NodeList title = element.getElementsByTagName("title");
                    Element line = (Element) title.item(0);
                    System.out.println("Title: " + getCharacterDataFromElement(line));
                    NodeList des = element.getElementsByTagName("description");
                    line = (Element) des.item(0);
                    System.out.println("Des: " + getCharacterDataFromElement(line));
            } catch (Exception e) {
                e.printStackTrace();
        public String getCharacterDataFromElement(Element e) {
            Node child = e.getFirstChild();
            if (child instanceof CharacterData) {
                CharacterData cd = (CharacterData) child;
                return cd.getData();
            return "?";
    }And here's the error message:
    org.xml.sax.SAXParseException: Teckenkonverteringsfel: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (radnumret kan vara f�r l�gt).
        at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
        at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
        at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEntity.java:914)
        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1183)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:653)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at getrss.RSSDocument.<init>(RSSDocument.java:25)
        at getrss.Main.main(Main.java:25)

    I read files from the web, but there is a XML tag
    with the encoding attribute in the RSS file.If you are quite sure that you have an encoding attribute set to ISO-8859-1 then I expect that your RSS file has non-ISO-8859-1 character though I thought all bytes -128 to 127 were valid ISO-8859-1 characters!
    Many years ago I had a problem with an XML file with invalid characters. I wrote a simple filter (using FilterInputStream) that made sure that all the byes it processed were ASCII. My problem turned out to be characters with value zero which the Microsoft XML parser failed to process. It put the parser in an infinite loop!
    In the filter, as each byte is read you could write out the Hex value. That way you should be able to find the offending character(s).

  • Problem while reading multiple files through FTP Adapter

    Hi,
    We have a requirement to read the excel files placed in an FTP Location and as there is no Adapter to read Excel file
    we are using FTP Adapter and reading the Header values of the file(name of the
    file) and we are paasing as input to the Java code which will read the data nd insert into the Database.
    If we place above 20 files it was reading only some files and some were left and if we delete the files and place the unread files again some files are read and if we do the same procedure then all the files were read.
    Any help regaring this appreciated.
    Thanks and Regards,
    Nagaraju .D

    Are you doing anything complex for your polling, e.g. Files that must be n time old.
    Can you post the WSDL so I can see the polling configuration. I only need to see the adapter configuration, not the whole file.
    cheers
    James

  • Problem in reading a file in the specified format

    Hi,
    I want to read a .txt file using the bufferedreader() but the text displayed in the console doesnot show data in new lines though there are multiple lines in the text file.It shows the content of the file in one line.
    ex: file.txt
    1. Here
    2. Is the code
    When I retrive the file it shows the following o/p in the console :
    O/P
    HereIs the code
    Expected o/p
    Here
    IS the code
    Please help me.
    Thanks in advance
    Regard Devi

    Your are not using parentheses {} with your while loop, and you really should.
    I believe that the problem is that the new line character is not being included.
    It's good to use the readLine() method, but you have to remember that it does
    not return the "end of line characters" so you would have to supply that yourself.
    Fortunately, System.out.println() will add a new line for you, but you would have
    to call it after each readLine() for it to look right.
    Also, I don't see why you are using both s1 and y. Here is an example using the
    variable "line" to hold the line of text being read.
    BufferedReader screenReader = new BufferedReader(new InputStreamReader(System.in));
    System.out.print("Enter the File name: ");
    String str = screenReader.readLine();
    BufferedReader br = new BufferedReader(new FileReader(str));
    String line = "";
    while ((line = br.readLine()) != null) {
         System.out.println(line);
    }Hope it helps.

  • Problems with reading raw files in lightroom 5

    Ich kann weder dng Dateien von Leica x1 noch von fuji xt1 importieren! Was könnte der Grund sein, im Handbuch gibt es keine Hinweise auf Probleme?@ Kurze Antwort erwünscht

    Check the destination you have specified in the Import panel.  It needs to point to a location that Lightroom can read and more important write files to.  Usually the error message (in English) says “files cannot be read” and this really means that LR was unable to copy the files to the destination so then when it tried to import from that destination not file were found to read.

  • Problem with reading mp4 files with QT 7.4.1 or mpeg Streamclip

    Hi,
    I used to convert some .flv files into .mp4 files with iSquint and then into .dv files with mpeg Streamclip in order to re-work and compile these files on a DVD using iMovie and iDVD.
    However I cannot do it anymore since I upgraded to QT 7.4.1. iSquint uses the mpeg-4 video codec to convert the file. Therefore I cannot open them with QT 7.4.1 anymore and I cannot convert them into .dv files with mpeg Streamclip anymore since Streamclip is uses a QT plug-in.
    I have tried to solve the problem using Perian but this plug-in does not work with my version of Mac (Panther 10.3.9). I also tried to downgrade to an older QT using Pacifist but it nearly crashed my whole computer (fortunately I could fix that by reinstalling QT 7.4.1).
    Has someone a solution to my problem?
    Thank you in advance.
    Steve

    Not all the following will apply to Panther (10.3.x) so look carefully on the sites mentioned for the correct versions:
    These are the downloads and the settings you need in order to view/hear pretty much everything that the net can throw at you: The setup described below has proved repeatedly successful on both PPC and Intel macs, but nothing in life carries a guarantee!
    It is known to work in the great majority of cases with Safari 3.0.4, QT 7.3 or 7.4 and OS 10.4.11. (If you are running Leopard, ensure that all plug-ins have been updated for OS 10.5)
    Assuming you already run Tiger versions OS 10.4.9 or above (this has not yet been verified with Leopard) and have Quicktime 7.2 or above, and are using Safari 2 or 3, download and install (or re-install even if you already had them) the latest versions, suitable for your flavor of Mac, of:
    RealPlayer 10 for Mac from http://forms.real.com/real/player/blackjack.html?platform2=Mac%20OS%20X&product= RealPlayer%2010&proc=g3&lang=&show_list=0&src=macjack
    Flip4Mac WMV Player from http://www.microsoft.com/windows/windowsmedia/player/wmcomponents.mspx (Windows Media Player for the Mac is no longer supported, even by Microsoft)
    Perian from http://perian.org/
    You should read this support page http://perian.org/#support in case you need to delete older codecs.
    Adobe FlashPlayer should first be uninstalled using the appropriate uninstaller available here: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14157&sliceId=2 and then the latest version obtained from here: http://www.adobe.com/shockwave/download/download.cgi?P1ProdVersion=ShockwaveFlash and installed.
    (You can check here: http://www.adobe.com/products/flash/about/ to see which version you should install for your Mac and OS.)
    In earlier versions than QT 7.1.3 in Quicktime Preferences, under advanced, UNcheck Enable Flash, and under Mime settings/Miscellananeous only check Quicktime HTML (QHTM).
    You should also ensure, if you are running Tiger 10.4.11 or Leopard, that you have downloaded and installed the correct version for your Mac of Security Update 2007-009.1.1, which also deals with the Quicktime/Flash issues you may have experienced, such as the '?'. What happened was that both Quicktime as well as Adobe FlashPlayer tried to play the Flash video at the same time. This no longer happens. (N.B. Security Update 2007-009 1.1 requires both a restart and a permission repair.)
    If you get problems with viewing video on a website try moving this file to your Desktop:
    Hard drive/Library/Internet Plug-Ins/QuickTime Plugin.webplugin
    and then restarting Safari. If all now works, you can trash that file.
    In Macintosh HD/Library/Quicktime/ delete any files relating to DivX (Perian already has them). However it should be noted that Perian is not an internet plugin and will not play DivX files imbedded on a website. For that you will need the DivX Player browser plugin available from http://www.divx.com/divx/mac/
    Now go to Safari Preferences/Security, and tick the boxes under Web Content (all 4 of them) to enable Java.
    Lastly open Audio Midi Setup (which you will find in the Utilities Folder of your Applications Folder) and click on Audio Devices. Make sure that both Audio Input and Audio Output, under Format, are set to 44100 Hz, and that you have selected 'Built in Audio'.
    Important: Now repair permissions and restart.
    You should also consider having the free VLC Player from http://www.videolan.org/ in your armory, as this plays almost anything that DVD Player might not.

  • Problems with reading in files

    I have a compalation problem which throws back the following error:
    Echo.java:11: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
    Scanner scanFile = new Scanner(new File("file"));
    ^
    1 error
    Thanks in advanced.

    Here's Sun's exception tutorial: http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html
    Here's a quick overview of exceptions:
    The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.
    RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.
    If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.
    Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.
    So you have to either catch that exception, or announce to any caller (via the throws clause in the method declaration) that your method can throw that exception.

  • Problem in reading xml file from server

    Hi,
    I am using tomcat 4.1 and jdk 1.4.
    All the class files and xml files are put into the one jar file.
    While running our application a jar file is called from jsp file. in that file we are embedded applet coding. here by i am sending my applet code with this...
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = "500" HEIGHT = "500" codebase="http://java.sun.com/products/plugin/1.2/jinstall-12-win32.cab#Version=1,2,0,0">
    <PARAM NAME = CODE VALUE = "Screen.class" >
    <PARAM NAME = CODEBASE VALUE = "/Sample/web/" >
    <PARAM NAME = ARCHIVE VALUE = "csr.jar" >
    </NOEMBED></EMBED>
    </OBJECT>
    while running our application from another machine we are getting exception filenotfounfexception in the xml is in the generated jar file.
    Exception:
    org.xml.sax.SAXParseException: File "file:///C:/Documents and Settings/Administrator/Desktop/control_property.xml" not found.
    but that xml file is in the jar file and that jar file is present under sample application folder.
    what should i change in the applet code? is there any thing related to trusted applet ?
    Thanks

    You have the xml file in the jar so it is a resource?
    http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html#getresource
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String)

Maybe you are looking for

  • Can I associate an existing TM backup with a new replacement hard drive?

    Hi all. I have a Mac Pro and just added a new, larger and faster hard drive as my primary system drive. I used Super Duper to clone the original over to the new. All is working fine on that front. My question is as follows. I was using a Time Capsule

  • Calling a Web Service from CRM 620

    I prototyped from ECC 640 and created a client Proxy to call a WebService.  However,  Does anyone know if it is possible to call a WebService from CRM 620?  If so, how do you do it.  So far I have found documentation to create Server Proxies but not

  • Dynamic column names

    I created a line chart with the following sql statement: select null link, periode_jaar, sum(totaal) total from V_KPL_VZ_OWB@rapportage_dwhtest where periode_jaar = (Select max(periode_jaar) from V_KPL_VZ_OWB@rapportage_dwhtest) group by periode_jaar

  • Sleep Indicator light stopped working- any way to diagnose and resolve thi

    The Sleep Indicator light on my Powerbook G4 12" 1.5Ghz has ceased to work. Just wondering if this is a sign of anything other than age and if it is possible to resolve at all?

  • One valuation class per G/L account

    Hello gurus, is it correct that if I want to differentiate my account determination by material, I will have to create one valuation class for every G/L account used and then assign those classes to my materials? And second question: Is it correct th