Using text file in jar

I am working on writing applets. When user dowloads the page with my applet the jar-file with my classes is being loaded too. Is it possible to use the text file which stored in jar-file from my classes? How can I do that if it is possible?

You need to get an instance of the ClassLoader than loaded your classes, and then call the getResourceAsStream() method.
eg.
MyObj obj = new MyObj();
ClassLoader cl = obj.getClass().getClassLoader();
InputStream is = cl.getResourceAsStream("mytextfile.txt");

Similar Messages

  • How to edit a text file inside jar

    Hi all;
    I have a code that created text file and put this file to other jar archive.
    How can I edit this text file inside jar, add string to this file ?
    Thanks,

    Unpack the jar, edit the file, repack the jar.

  • Cannot get text file to print in jtable. Using text file as a database

    Instead of doing JDBC i am using text file as database. I cant get data from text file to print into JTable when i click find button. Goal is to find a record and print that record only, but for now i am trying to print all the records. Once i get that i will change my code to search desired record and print it. when i click the find button nothing happens. Can you please take a look at my code, dbTest() method. thanks.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.util.*;
    import java.io.*;
    public class GUIdirectory extends JFrame
    implements ActionListener {
    // Define the components and the layout
    JLabel inputLabel_lastname = new JLabel("Last Name");
    JTextField inputText_lastname = new JTextField("Last Name",15);
    JLabel inputLabel_firstname = new JLabel("First Name");
    JTextField inputText_firstname = new JTextField(" ",15);
    JLabel inputLabel_middleinitial = new JLabel("Middle Initial");
    JTextField inputText_middleinitial = new JTextField(" ",4);
    JButton inputButton = new JButton("Find");
    JPanel inputLayout = new JPanel(new FlowLayout(FlowLayout.CENTER,5,5));
    JButton jButton1 = new JButton();
    //create a new table and scrollpane
    JTable dataTable = new JTable();
    JScrollPane dataTableScrollPane = new JScrollPane();
    public static void main(String args[]) {
    GUIdirectory gui = new GUIdirectory("Telephone Directory");
    gui.show();
    gui.pack();
    //TokenTest tt = new TokenTest();
    //gui.dbTest();
    public GUIdirectory(String Title) {
    super(Title);
    // Add ourselves as a listener for the window closing
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    exitWindow(1); }
    inputLabel_lastname.setLabelFor(inputText_lastname);
    inputText_lastname.setHorizontalAlignment(JTextField.RIGHT);
    inputText_lastname.addActionListener(this);
    inputLabel_firstname.setLabelFor(inputText_firstname);
    inputText_firstname.setHorizontalAlignment(JTextField.RIGHT);
    inputText_firstname.addActionListener(this);
    inputLabel_middleinitial.setLabelFor(inputText_middleinitial);
    inputText_middleinitial.setHorizontalAlignment(JTextField.RIGHT);
    inputText_middleinitial.addActionListener(this);
    inputButton.addActionListener(this);
    inputLayout.add(inputLabel_lastname);
    inputLayout.add(inputText_lastname);
    inputLayout.add(inputLabel_firstname);
    inputLayout.add(inputText_firstname);
    inputLayout.add(inputLabel_middleinitial);
    inputLayout.add(inputText_middleinitial);
    inputLayout.add(inputButton);
    getContentPane().setLayout(new BorderLayout(5,5));
    getContentPane().add("North",inputLayout);
    dataTableScrollPane.setViewportView(dataTable);
    getContentPane().add("Center",dataTableScrollPane);
    // A default method, primarily used for testing.
    public void actionPerformed(ActionEvent evt) {
    GUIdirectory gui = new GUIdirectory();
    gui.dbTest();
    void dbTest() {
    DataInputStream dis = null;
    String dbRecord = null;
    String hold;
    try {
    File f = new File("customer.txt");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis = new DataInputStream(bis);
    Vector dataVector = new Vector();
    Vector headVector = new Vector(2);
    Vector row = new Vector();
    // read the record of the text database
    while ( (dbRecord = dis.readLine()) != null) {
    StringTokenizer st = new StringTokenizer(dbRecord, ",");
    while (st.hasMoreTokens()) {
    row.addElement(st.nextToken());
    System.out.println("Inside nested loop: " + row);
    System.out.println("inside loop: " + row);
    dataVector.addElement(row);
    System.out.println("outside loop: " + row);
    headVector.addElement("Title");
    headVector.addElement("Type");
    dataTable = new JTable(dataVector, headVector);
    dataTableScrollPane.setViewportView(dataTable);
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error!" + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
    try {
    dis.close();
    } catch (IOException ioe) {
    } // end if
    } // end finally
    } // end dbTest
    // Exits the program upon closing the window
    public void exitWindow(int i) {
    System.exit(i);
    public GUIdirectory() {
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    private void jbInit() throws Exception {
    jButton1.setText("jButton1");
    this.getContentPane().add(jButton1, BorderLayout.CENTER);

    Nothing happens because in the actionPerformed() method you are creating a new version of GUIdirectory. You just want to execute the dbTest() method of the current instance of GUIdirectory.
    The code should be:
    public void actionPerformed(ActionEvent evt)
    //GUIdirectory gui = new GUIdirectory();
    //gui.dbTest();
    dbTest();

  • Its urgent  how to use calss file of jar located in lib folder

    how to use calss file of jar located in lib folder.
    i want to use RowSetDynaClass class which is in beanutil jar file which is in my lib folder .if i use that class in my jsp following error is coming.
    Class RowSetDynaClass not found.
    RowSetDynaClass resultSet = new RowSetDynaClass(rs, false);
    how to access class in jar file.
    please help

    You have to either refer to the class in its fully quallified name, or import it into the JSP:
    <%
      some.full.packagename.RowSetDynaClass resultSet = new some.full.packagename.RowSetDynaClass(rs,false);
      ...-or-
    <%@ page import="some.full.packagename.RowSetDynaClass" %>
    <%
      RowSetDynaClass resultSet = new RowSetDynaClass(rs, false);
      ...As long as the class has public visibility and you have re-started the server/servlet context since you added the JAR.

  • How to use text files in RandomAccessFile both are in same Jar file

    when double click the executable jar file the class file contains the RandomAccessFile ,it will not take the text files,both the files are in jar file

    I used this:
    Scanner fileScan = new Scanner (new file
    ("Words.txt"));
    but when I make a jar file, it doesnt find the txt
    file inside a jar,
    do I need to specify path or something?I have already told you that you shouldn't use new File(..) you should use getResourceAsStream(String name) to get an InputStream to the file.
    Kaj

  • How to use txt files in jar file

    Hi all
    I just made a program that uses a text file, but I havent managed to work it correctly, program runs without jar correctly, but when I packaged all files into a jar, it couldnt find txt file, so I can only run it when I create another text file outside of jar.
    How can I solve this??

    I used this:
    Scanner fileScan = new Scanner (new file
    ("Words.txt"));
    but when I make a jar file, it doesnt find the txt
    file inside a jar,
    do I need to specify path or something?I have already told you that you shouldn't use new File(..) you should use getResourceAsStream(String name) to get an InputStream to the file.
    Kaj

  • Static method to read text file within JAR.

    I've a small problem. I've got my JAR file stuff working great, so I thought I'd give a go to running it via WebStart. Through a little research, I've found that if you're distributing your application via WebStart, you need to pack up everything in a JAR file. This is no problem for the JDBC drivers, because its already in a JAR, so I should be able to distribute that fine.
    I've managed to digitally sign my application JAR and have a preliminary (i.e. untested) JNLP file set up.
    My problem is, my application gets its available data sources from an external text file. I've already written my own file I/O class which I use in my "commonfiles" package to read in a text file and return it as an array with each element holding a line from the text file. This class is basically just a bunch of static methods.
    So instead of rewriting this, I thought I'd just add a boolean flag to this method to state whether to load this file from the external file system or the JAR file. I've found out that to load a text file from within the JAR you have to use something like: -
    String str = (this.getClass().getResource("/myData.txt")).getFile();
    java.io.File fil = new java.io.File(str);
    java.io.FileReader fr = new java.io.FileReader (fil);
    java.io.BufferedReader bin = new java.io.BufferedReader (fr) ;The sticking point is that my method (ReturnFileAsArray()) is declared as static, because my own FileIO class is just a bunch of static methods to do file I/O stuff. Therefore, I can't use the above method because of the instance variable "this" (I assume).
    Is there any way I can load an included text file as above without having to declare my method as an instance method? I guess I could write a seperate class to do this for my commonfiles package, but I'd rather not if possible.
    Any ideas?

    Don't put a "flag" and code different ways to read files depending on whether it's in a JAR or not. Just use
    the getResource/getResourceAsStream API regardless. Hmmm.....so that will load it from either place depending on the situation? I keep getting a NullPointerException doing that, on this line: -
    String strFileName = (FileIO.class.getResource(fileName)).getFile();...although I've only tried it using the external local filesystem file (in the same directory) as I've not really finished setting up my WebStart stuff yet.
    Here is the method in question...
    public static String[] ReadFileAsArray(String dirName, String fileName, boolean bFromJAR) {
            String[] resultStringArray = null;
            StringBuffer strBuffer = null;
            StringTokenizer strTokenizer = null;
            FileReader fReader = null;
            BufferedReader bReader = null;
            int iElementCount = 0;
            if ((dirName.length() < 1) || (fileName.length() < 1)) {
                // Null parameters found. Failure.
                return null;
            } else {
                // Parameters correct, continue.
                try {
                    // Read the file contents and convert to String array.
                    //if (bFromJAR) {
                        // Open file from within JAR file.
                        String strFileName = (FileIO.class.getResource(fileName)).getFile();
                        File jarFile = new File(strFileName);
                        fReader = new FileReader(jarFile);
                    //} else {
                        // Open from local filesystem.
                    //    fReader = new FileReader(dirName + File.separator + fileName);
                    bReader = new BufferedReader(fReader);
                    strBuffer = new StringBuffer();
                    while (bReader.ready()) {
                        strBuffer.append(bReader.readLine() + "%%");
                    strTokenizer = new StringTokenizer(strBuffer.toString(), "%%");
                    resultStringArray = new String[strTokenizer.countTokens()];
                    while ((strTokenizer.hasMoreTokens()) && (iElementCount < resultStringArray.length)) {
                        resultStringArray[iElementCount++] = strTokenizer.nextToken();
                    bReader.close();
                    return resultStringArray;
                } catch (IOException e) {
                    return null;
        }I'm calling it using: -
    // Load the external file into a String array, one row for each element.
    String[] fileArray = FileIO.ReadFileAsArray(System.getProperty("user.dir"), "datasources.dat", true);Cheers on any info on this.

  • Text Files in .Jar file

    Alright, I have my program packaged up in a .jar file. I have figured out how to access images that are in the .jar
    ImageIcon nextImage=new ImageIcon(Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("next.png"))); That works well.
    Now, When the program loads, I would like it to load some initial values from a .txt file that is in the .jar. How do i do that? Is this a situation where I have to use an inputStream? If so.... I need an example. I'm relativly new and I am learning as I go.
    I was previously loading these values using a BufferedReader and a FileReader, but that was before I decided i wanted all the files in the Jar.
    Txt file name: fields.txt
    jar. Taxi.jar
    Thanks a ton in advance.

    Yes, most likely you need an InputStream. Here's how to use the Java API documentation to help find a solution.
    You already know how to read a file containing an image by using ClassLoader.getSystemResource(). So, look at the API documentation for getSystemResource(). What does it return? It returns a URL. Ok, now what methods are available in the URL class that might help read a text file? Search the documentation for URL to find your answer.

  • Using text files to commit in UCM trough ODC

    Hello all.
    Again I'm here trying to do something not that common in ODC. So let me explain what I want, OK?
    EDIT: I forgot my specs:
    We're using a VM in Vmware Workstation, with Windows 7 64bits. 80gb HD and 2gb RAM.
    Using Oracle DB 11gR2 and ODC 10.3.5.
    1 - we already opened a ticket with Oracle Support, the number is:      SR 3-6108348211. It was closed but we reopened. Until now there is no answer.
    2 - we have many files and want to do a test: which is better for commiting files to UCM, ODC or Batch Loader? We know that Batch Loader is the usual one, but maybe there is some speed improvement in checkin using ODC.
    3 - we will get the images from a folder, send them to ODC, them the ODC will commit them to UCM, but (here's the catch) sending all the metadata of all those files and being pdf-searchable too.
    4 - so I'll put some screens here, showing what I did, OK?
    4.1- In this screen I show all the metadata we need ship to UCM. In the left column are the metadata fields and in the right, values.
    http://imgur.com/QkqxA
    4.2 - In a folder, we put all the images and a text file containing all the metadata referring to the images. As the Oracle Support says, the text file should have these lines.:
    C:\Users\oracle\Desktop\import_folder\import1.bmp|4545|Joaozinho|15/15/2015|Import1|11.11
    C:\Users\oracle\Desktop\import_folder\import2.bmp|7878|Augusta|16/16/2006|Import2|22.22
    C:\Users\oracle\Desktop\import_folder\import3.bmp|00001|Gump|07/07/1997|Import3|333.33
    C:\Users\oracle\Desktop\import_folder\import4.bmp|3232|Filipinho|08/08/2008|Import4|99.66
    C:\Users\oracle\Desktop\import_folder\import5.bmp|7968|Maria Antonia|15/12/1985|Import5|88.99
    C:\Users\oracle\Desktop\import_folder\import6.bmp|56563|Coloral|07/08/1999|Import6|22.33
    The first part is the image path, the second its name, the third the odc_Numero field value, the fourth the odc_Nome field value, the fifth the odc_Data field value, the sixth odc_Assunto field value and the last one is odc_Valor field value. All these values need to go to UCM, along with the images.
    4.3 - So I put all the images and text file in the folder.
    http://imgur.com/o8znD
    4.4 - I didn't checked OCR zones in the images, all the metadata values will come from the text field, because the images sometimes cannot be trusted on the values (bad scan, old text, etc).
    4.5 - I open the Import Server and did this config:
    http://imgur.com/t0xh1
    http://imgur.com/PPJGO
    http://imgur.com/RWKfU
    http://imgur.com/v5P5V
    4.6 - I open the commit server and let it in the background, but not doing any batch jobs, just paused.
    4.7 - And I got all these errors:
    http://imgur.com/lCtql
    EDIT: I get this error when opening the import server, just after the login:
    http://imgur.com/YB9qe
    So here are my questions:
    1 - what printer is the ODC needing?
    2 - the files will be already converted to PDF, I just want to convert them to pdf-searchable, using the text file containing all metadata and send them to UCM. Is it possible?
    3 - is there a guide teaching how to do this?
    4 - am I doing it right?
    Sorry for the long post, but this an urgent test.
    Thanks (seriously, a lot) for all the help and guidance.
    Fernando
    Edited by: fgomes on 03/09/2012 05:45
    Edited by: fgomes on 03/09/2012 06:05

    Hello Jiri.
    Thank you for your answer.
    Let me answer your questions (I'm using Windows XP this time, both we are working in 7, too):
    - while working with the ODC desktop application, you
    i. define a file cabinet (which also defines index fields, optionally batch statuses, and commit profiles)
    -- I did, these are the fields I've defined for this test
    http://imgur.com/7FyRW
    ii. define a scan profile
    -- Here are the configs for my scan profile
    http://imgur.com/Jyfvh
    http://imgur.com/tveQZ
    iii. define an indexing profile (which also defines index fields the profile will work with, incl. auto-populate)
    -- Here are the configs
    http://imgur.com/sMW7Q
    http://imgur.com/O6Bpl
    http://imgur.com/aqYmU
    http://imgur.com/lGrIn
    http://imgur.com/MeKAz
    http://imgur.com/t5r0i
    http://imgur.com/oco5S
    iv. scan an image (using the scan profile) AND v. index the scanned image (using the indexing profile)
    -- I did that. And works ok. I've used OCR zones sometimes and the scan worked. Sometimes I didn't and it worked OK, too. Commit to UCM in both cases worked. Here is an example:
    http://imgur.com/rp3jI
    http://imgur.com/ZS7FB
    http://imgur.com/cHhjC
    * Now we go to another part:
    ii'. define the import batch job
    -- I've defined in here.
    http://imgur.com/hfEdR
    http://imgur.com/eKsyJ
    http://imgur.com/Kbt5R
    http://imgur.com/1azWe
    http://imgur.com/JqbFI
    http://imgur.com/IkCww
    And after all these configs, when I click in "Activate", to make the batch job active the application closes (in Windows 7 it crashes). When I change to "Import from folder" rather than "Import from list file" I get these messages:
    http://imgur.com/1WAMn
    http://imgur.com/oz5ZL
    Still, the other way is to provide metadata in a List File. The List File is processed directly by Import - and if you define that you want to commit right away Import will try to do it for you, but it can succeed only if it has all the necessary index fields. The error you are getting indicates that something is wrong - it can be that some field is missing, or all the fields are missing (List File could not be parsed).
    -- Yes. It is that I want. I don't need to check barcodes at all. I just need to get all the field values from a list file. Here are the contents:
    C:\Documents and Settings\Administrador\Desktop\import_folderimport1.bmp|4545|Joaozinho|15/15/2015|Import1|11.11
    C:\Documents and Settings\Administrador\Desktop\import_folderimport2.bmp|7878|Augusta|16/16/2006|Import2|22.22
    C:\Documents and Settings\Administrador\Desktop\import_folderimport3.bmp|00001|Gump|07/07/1997|Import3|333.33
    C:\Documents and Settings\Administrador\Desktop\import_folderimport4.bmp|3232|Filipinho|08/08/2008|Import4|99.66
    C:\Documents and Settings\Administrador\Desktop\import_folderimport5.bmp|7968|Maria Antonia|15/12/1985|Import5|88.99
    C:\Documents and Settings\Administrador\Desktop\import_folderimport6.bmp|56563|Coloral|07/08/1999|Import6|22.33
    Thanks again.
    If you could try and say what I am doing wrong you'll help me a lot.
    Fernando

  • PO creation using text file

    Hi All,
    I have program which takes input text file and create PO in SAP. Program is using standard SAP BAPI to create PO.
    This is working fine. But i have one program during errors.
    If text file contains 50 line items and suppose line 12 is incorrect. Incorrect means PIR,source list etc not correct or material is invalid etc etc. Then program(bapi) throw error and PO creation stops and not continue with remaining lines. That is also normal process when create PO via ME21N.
    User want to show errors for all invalid rows at the same. Basically they want PO VALIDATION step where they want to see errors of all line items. So that they can remove from text file. ANy idea how to do this?
    Thanks,
    Yogesh

    Yogesh,
    I don't understand your problem because I believe that BAPI (even ME21n) always throws all the errors for the input data in return table. So, if you have 2 problematic items in one purchase order, suppose 12 and 42, both containing invalid materials, BAPI will contain error message for both the records and not only 1 material as error.
    Similarly, if you click MESSAGES button in ME21n, you will get all the errors for all the items in the list and not 1 only, do check.
    I suppose the issue with your program must be the error handling of BAPI is not done well, and you are exiting the program showing only First return message or something like that. Do output all the error messages of the Return table and you should be able to see all the errors.
    Even if your File contains data of multiple POs, you should be able to check all the POs with all the items in a single program run.
    Let me know if you have any concerns or you need any help.
    BR,
    Diwakar

  • Text file within jar file

    Can anybody tell me if it's possible to read and write to a text file stored within the .jar file package? I can maintain a constant file length if that enables me to read and write.
    cheers,
    Steve

    reading a text from, from a jar file..... if the jar is in your classpath you can call
    getClass().getResourceAsStream ( "/myServerConfig.properties" );Note the "/", which stops the file from being interpreted as a class name, see Class.getResourceAsStream()
    writing... nothing as easy as the reading solution above.
    You'd probably have to actually "update" the JAR file contents with a new version of the text file.
    regards,
    Owen

  • LinkageError while trying to use war-file bundled jars

    Good day.
    I have a servlet for which I want to use the latest JAX-WS 2.1.4 jars. I compile my servlet, and include in the WEB-INF/lib/ directory those same JAX-WS 2.1.4 jars. According to the classloading scheme under the SJWS v7.0, I can enable my servlet to actually use those jars, rather than the functional equivalent, but older, versions the container would provide, by setting delegate="false" in the servlet's sun-web.xml file.
    http://docs.sun.com/app/docs/doc/819-2634/6n4tl5ko9?l=en&a=view
    When I deploy this servlet, and a client makes a request of it, however, I'm getting an odd exception:
    java.lang.LinkageError: JAXB 2.0 API jar is being loaded (from jar:file:/sun/webserver7/lib/webserv-jwsdp.jar!/javax/xml/bind/annotation/XmlSchema.class), but this RI (from jar:file:/sun/webserver7/https-msoa5/web-app/msoa5/tManager/WEB-INF/lib/jaxb-impl.jar!/com/su
    n/xml/bind/v2/model/impl/ModelBuilder.class) requires JAXB 2.1 API jar.
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:173)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
    at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:220)
    at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:218)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:217)
    at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:88)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:36)
    at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:95)
    at javax.xml.ws.spi.Provider.provider(Provider.java:76)
    at javax.xml.ws.Service.<init>(Service.java:57)
    at com.sun.fast.eventmgr.wsdl.WsdltventManagerV4Service.<init>(WsdltventManagerV4Service.java:46)
    My WEB-INF/lib/ directory contains the jaxb jars, which leaves me puzzled as to why the linkage error. Here is the set of jars in the WEB-INF/lib directory:
    sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/FastInfoset.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/activation.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/http.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxb-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxb-impl.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxb-xjc.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxws-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxws-rt.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jaxws-tools.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jsr173_api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jsr181-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/jsr250-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/mimepull.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/resolver.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/saaj-api.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/saaj-impl.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/sjsxp.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/stax-ex.jar
    /sun/webserver7/https-msoa5/web-app/msoa5/EventManager/WEB-INF/lib/streambuffer.jar
    Any suggestions on what the problem might be?
    Thanks.

    Thanks for the reply.
    The jar containing the sought class would be WEB-INF/lib/jaxb-api.jar per this brute force inspection:
    $ for i in $(find WEB-INF/lib/ -name \*.jar); do echo "---$i"; jar tf $i |grep javax/xml/bind/annotation/XmlSchema.class; done
    ---WEB-INF/lib/jaxb-xjc.jar
    ---WEB-INF/lib/streambuffer.jar
    ---WEB-INF/lib/jaxws-tools.jar
    ---WEB-INF/lib/FastInfoset.jar
    ---WEB-INF/lib/jaxb-api.jar
    javax/xml/bind/annotation/XmlSchema.class
    ---WEB-INF/lib/http.jar
    ---WEB-INF/lib/jsr173_api.jar
    ---WEB-INF/lib/jaxb-impl.jar
    ---WEB-INF/lib/activation.jar
    ---WEB-INF/lib/stax-ex.jar
    ---WEB-INF/lib/jsr181-api.jar
    ---WEB-INF/lib/jaxws-api.jar
    ---WEB-INF/lib/saaj-api.jar
    ---WEB-INF/lib/mimepull.jar
    ---WEB-INF/lib/jaxws-rt.jar
    ---WEB-INF/lib/saaj-impl.jar
    ---WEB-INF/lib/sjsxp.jar
    ---WEB-INF/lib/resolver.jar
    ---WEB-INF/lib/jsr250-api.jar

  • How to use database file within jar archive

    Hi. I'm quite new in Java programming, and I'm wondering if what I did makes sense or not.
    In my applet I'm using a MS Access Database file, which is contained in the same Jar Archive like the Applet class file. I tried and tried to use this Database file directly but it wouldn't work. Than I read in some other forum that it is not possible to use the database file directly within the archive. First question: Is that true?
    Than I desided to extract the DB file in the init() method of my applet to the default temporary foulder. When the program is closed I use the destroy() method to delete it again. Everything works well now. But is this the typical way this is done?
    Thanks for help!

    Hi,
    here is the code which extracts the database file out of the jar archive (the same archive in which the class file is):
    //get the user temporary folder
    File TempFolder = new File(System.getProperty("java.io.tmpdir"));
    //create (empty) db file
    efile = new File(TempFolder, "steelSections.mdb");
    // if database file is not yet extracted
    if (!efile.exists()) {
    //get an input stream for the database file
    InputStream in = new BufferedInputStream(this.getClass().getClassLoader().getResourceAsStream(
    "FaST/db/steelSections.mdb"));
    //create an output stream for the db file on the file system
    OutputStream out = new BufferedOutputStream(new FileOutputStream(efile));
    //-Buffer to copy the data
    byte[] buffer = new byte[2048]; //buffer to copy the binary
    for (;;) {
    int nBytes = in.read(buffer); //read data
    if (nBytes <= 0)
    break; //no more data to read
    out.write(buffer, 0, nBytes); //write data
    out.flush(); //close out and in streams
    out.close();
    in.close();
    If you have the db file in an other jar archive file you need a referenze to the entry in the other jar archive. I'm not sure how to get this, but I'm sure you fill find a solution by searching in this forum...
    Good luck!

  • Is it possible to zip and use java file in jar?

    there are 2 cases:
    1. only zip no-package java files in a jar file:
    i.e.
    ------------zip
    NoPack0.java (they are no package)
    NoPack1.java
    NoPackN.java
    ------------as NoPack.jar
    2. zip both no-package and packaged java files in a jar file
    i.e.
    ------------zip
    NoPack0.java
    NoPackN.java
    pack\HasPack0.java (they are packed in 'pack')
    pack\HasPackN.java
    ------------as HasPack.jar
    my question is:
    for 2 cases above, if both, one or none of them can be use as a jar file in -classpath for javac compiler?
    thx

    has my Q been answered?

  • Using text files for text

    hi,
    i like flex so i wan't to make flex sites that people can
    download. but for the people who dont have flex its going to be
    hard to edit so:
    if u have like a text control, and instead of typing
    text="text here"
    i want text="and instead of text it should read the text from
    example: textbox1.txt
    is this possible?
    thank you very much

    dinsterzz,
    The HTTPService class is your main gateway to accessing data
    that is on the server. You can data-bind to the "result" property
    of the HTTPService object to easily expose the text in a UI field.
    The main documentation is here:
    http://livedocs.adobe.com/flex/201/langref/mx/rpc/http/HTTPService.html
    Here are two good intros to using HTTPService:
    http://www.adobe.com/devnet/flex/quickstart/httpservice/
    http://www.adobe.com/devnet/flex/quickstart/using_data_providers/#external
    These are both focused on XML data, so your code can probably
    be even simpler. Just remember to use resultFormat="text" instead
    of ="e4x".
    Hope that helps,
    - Peter

Maybe you are looking for

  • Blank screen

    hi when i run my application am geting empty/blank screen this is in jdeveloper 11g release 2 and page is jspx, my log file is *** Using HTTP port 7101 *** *** Using SSL port 7102 *** "C:\Documents and Settings\Desmond\Application Data\JDeveloper\sys

  • How to unlink iTunes credit card info from apple id info

    I put my credit card as my mom's payment for her itunes. However this changed her Apple ID to my name and address. When I changed the Apple ID info, it changed the credit card info They should not be linked because that means the Apple ID is linked t

  • Excel save as

    This is a 2 part question: 1. I have a VI that writes data to excel but i want to leave my original file intact and save as different name, i keep getting an error 2. for the new name i want to append a timestamp but cannot find how to get the PC cur

  • Can I configure a Raid 5 disc through my mac

    I'm planning to buy a NAS and wanted to configure RAID 5. Does OS X have a built in configurator application?

  • Log Files for an Edge 95 running F9.3.3

    I have an Edge 95 that is having trouble and we feel it may be the camera losing connection to the codec. Is the log file I can look at that may show loss of contact with the camera? Do I need to increase the logging level with the syslog command? We