Simple FileNotFound exception problems.

Hello all, just got a quick question if anyone can find the time. I have been having difficulty getting Sun 1.4.1 CE to find textfiles for me, no matter how I do it. (These same exact programs run fine on the UNIX machines we use at school) An example could best illustrate this i suppose
//HelloFileRead.java - reading a text file
import tio.*;
class HelloFileRead {
public static void main(String[] args)
ReadInput in = new ReadInput("hello.txt");
System.out.println(in.readLine());
This program is straight from the Textbook that we use (Java by Dissection) and again, works fine at school (as long as the hello.txt file is located in the same directory that the source code is located)
however, no matter where I put the hello.txt file(same dir as the Source, and practically every other directory on my machine :D ) it gives me a single FileNotFoundException.
I am assuming that there is an option that I am missing, but after pouring over the documentation and trying every concievable option(including uninstall/delete/reinstall) to no avail.
Any help would be appreciated. this supposedly simple problem is driving me mad!

'\' is the escape character. To indicate you're not using it in this sense, place another '\' in front of it, like this
ReadInput in = new ReadInput("c:\\helloproj\\hello.txt");"
Also, you have to check whether your text file is in the same directory as your class file.
Cheers.

Similar Messages

  • Problem with reading from DAT file. FileNotFound exception

    Can't seem to find the issue here. Two files, one (listOfHockeyPlayers) reads from a DAT file a list of players. The other (HockeyPlayer) has just the constructor to make a new hockey player from the read data.
    import javax.swing.*;
    import javax.swing.event.*;
    import java.util.*;
    import java.awt.*;
    import java.io.*;
    public class ImportHockeyPlayers
    private ArrayList<HockeyPlayer> listOfHockeyPlayers = new ArrayList<HockeyPlayer>();
    public ImportHockeyPlayers(String fileName)
      throws FileNotFoundException
      try
       Scanner scan = new Scanner(new File(fileName));
       while (scan.hasNext())
        //Uses all the parameters from the HockeyPlayer constructor
        String firstName = scan.next();
        String lastName = scan.next();
        int num = scan.nextInt();
        String country = scan.next();
        int dob = scan.nextInt();
        String hand = scan.next();
        int playerGoals = scan.nextInt();
        int playerAssists = scan.nextInt();
        int playerPoints = playerGoals + playerAssists;
        //listOfHockeyPlayers.add(new HockeyPlayer(scan.next(),scan.next(),scan.nextInt(),scan.next(),scan.nextInt(),scan.next(),
         //scan.nextInt(),scan.nextInt(),scan.nextInt()));
      catch(FileNotFoundException e)
       throw new FileNotFoundException("File Not Found!");
    public String toString()
      String s = "";
      for(int i = 0; i < listOfHockeyPlayers.size(); i++)
       s += listOfHockeyPlayers.get(i);
      return s;
    public class HockeyPlayer
    private String playerFirstName;
    private String playerLastName;
    private int playerNum;
    private String playerCountry;
    private int playerDOB;
    private String playerHanded;
    private int playerGoals;
    private int playerAssists;
    private int playerPoints;
    public HockeyPlayer(String firstName, String lastName, int num, String country, int DOB,
      String hand, int goals, int assists, int points)
      this.playerFirstName = firstName;
      this.playerLastName = lastName;
      this.playerNum = num;
      this.playerCountry = country;
      this.playerDOB = DOB;
      this.playerHanded = hand;
      this.playerGoals = goals;
      this.playerAssists = assists;
      this.playerPoints = goals + assists;
    DAT File
    Wayne Gretzky 99 CAN 8/13/87 R 120 222
    Joe Sakic 19 CAN 9/30/77 L 123 210These are all in early development, we seem to have the idea down but keep getting the odd FileNotFound exception when making an object of the ImportHockeyPlayers class with the parameter of the DAT file.
    We might even be on the wrong track with an easier way to do this. To give you an idea of what we want to do...read from the file and be able to pretty much plug in al lthe players into a GUI with a list of the all the players.
    Thanks for your time.

    Thanks for the tip on the date format...good to
    know.
    public static void main(String[] args)
    GUI gui = new GUI();
    ImportHockeyPlayers ihp = new
    ImportHockeyPlayers("HockeyPlayers.dat");
    }It's just being called in the main.
    Throws this error:
    GUI.java:39: unreported exception
    java.io.FileNotFoundException; must be caught or
    declared to be thrown
    ImportHockeyPlayers ihp = new
    ImportHockeyPlayers("HockeyPlayers.dat");
    ^This error is simply telling you that an exception may occur so you must enclose it in a try catch block or change the main method to throw the exception as follows
    public static void main(String[] args) throws  
                          java.io.FileNotFoundException {
         GUI gui = new GUI();
         ImportHockeyPlayers ihp = new
         ImportHockeyPlayers("HockeyPlayers.dat");
    }or
    public static void main(String[] args) {
         GUI gui = new GUI();
         try {
              ImportHockeyPlayers ihp = new
              ImportHockeyPlayers("HockeyPlayers.dat");
         catch (FileNotFoundException e) {
              System.out.println("error, file not found");
    }I would reccomend the second approch, it will be more helpful in debugging, also make sure that the capitalization of "HockeyPlayers.dat" is correct
    hope that helps

  • Strange javax.ejb.EJBException FileNotFound Exception though form is found

    Hi,
    I've set up a simple workflow, which consists of two user QPACs, which are connected to each other, let's call the first one 'user' and the second one 'admin'.
    I use a simple init-form, which merely consists of a dropdown and a submit button.
    The workflow works fine: 'user' selects a value from the dropdown-list, submits the form, 'admin' opens the form, the dropdown's value is still selected.
    However, in the logfile, the following exception is thrown:
    INFO  [STDOUT] Got tempFile : D:\Adobe\LiveCycle\temp\adobejb\DM4268780530925093172.dir\DM6500814794164759285.pdf
    INFO  [STDOUT] com.adobe.fm.extension.formserver.AresUtil getPDFDocument
    INFO: Loading the PDF.
    INFO  [STDOUT] com.adobe.fm.extension.formserver.AresUtil setPdfRights
    INFO: BufLength : 100415
    ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException:
    javax.ejb.EJBException: FileNotFound Exception: File [/fm//Forms/test_dropdown.xdp] not found
    at com.adobe.ebxml.registry.appstore.url.provider.XappstoreUrlDataProviderBean.getInputStream(XappstoreUrlDataProviderBean.java:193)
    at sun.reflect.GeneratedMethodAccessor419.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    As the workflow works, I could easily forget about the exception. But it outputs a couple of thousand(!) lines in the logfile each time, the form's submit button is pressed.
    Does anyone know, why do I get a FileNotFound exception though the workflow works fine???
    The exception may result from the incorrect path, which contains
    //. But why is the form then loaded anyway?
    Regards,
    Steve

    Hi Steve
    I'm not sure what the cause of the problem is.
    One thing...do you use the same form all the way through your process?
    If so, you should just be moving your form url information via your form variable. You would only choose "Change the form template Url to:" field if there was a different version of the form at this step. It doesn't hurt to do it but there is no need to. This is extra overhead.
    To use the same form all the way through the WF and move the data from each step:
    1) specify an init-form
    2) specify a form variable
    3) on the Mappings tab of your user QPAC you select your form variable as your "Input Variable" and select "use form template Url defined by Input Form Variable".
    4) also on the Mappings tab of your user QPAC you select your form variable as your "Output Variable"
    (You are probably not doing this, but there is also no need to fill in the template-url field in your form variable.)
    Diana

  • New ReportDocument() thows System.IO.FileNotFound exception

    I've inherited a Visual Studio 2003 windows service that uses managed C++ and C# + Crystal to print reports.  It was using Crystal 9 and now I'm trying to upgrade it to Crystal 11.
    Most of the windows service is in managed C++ but the Crystal part is in C#.  Basically it does a new ReportDocument, loads a report file, feeds it a dataset and some parameters and uses ReportDocument.PrintToPrinter(...) to output it.
    Everything still compiles after moving to Crystal 11 but I get a System.IO.FileNotFound exception when it gets to
    m_rptDocument = new ReportDocument();
    The exception doesn't include any information as to which file is not found.  So far FileMon hasn't been very helpful.  there are too many NOT FOUND results generated just as part of the normal running.  I tried a simplified test windows service and that seemed to work.
    I assume it is some sort of dependency issue.  Does anyone have any ideas how I can uncover the problem source?
    Thanks.
    Ben

    The service pack helped a little.  I'm getting different errors now.  They are a little more informative.  4 exceptions all stemming from doing a new ReportDocument();
    Exception:     {com.crystaldecisions.common.keycode.KeycodeException.ReadingFromRegistry}     com.crystaldecisions.common.keycode.KeycodeException.ReadingFromRegistry
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.Load(string location = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Ent") + 0xbd bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Ent") + 0x29 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    Exception:     {com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty}     com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.GetProperty(string propName = "CRSDK.InProc", long version = 115) + 0xa9 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.(com.crystaldecisions.common.keycode.KeycodeCollection      - = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, string      0 = "CRSDK.InProc", int      1 = 115, long      2 = 0) + 0x3e bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (com.crystaldecisions.common.keycode.KeycodeCollection      3 = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, int      4 = 115) + 0x4a bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Dev") + 0x36 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    Exception:     com.crystaldecisions.common.keycode.KeycodeException     {com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty}     com.crystaldecisions.common.keycode.KeycodeException
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.GetProperty(string propName = "CRSDK.Queuing", long version = 115) + 0xa9 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.(com.crystaldecisions.common.keycode.KeycodeCollection      - = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, string      0 = "CRSDK.Queuing", int      1 = 115, long      2 = 0) + 0x3e bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (com.crystaldecisions.common.keycode.KeycodeCollection      3 = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, int      4 = 115) + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Dev") + 0x36 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    Exception:     {com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty}     com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.GetProperty(string propName = "CRSDK.CPL", long version = 115) + 0xa9 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.(com.crystaldecisions.common.keycode.KeycodeCollection      - = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, string      0 = "CRSDK.CPL", int      1 = 115, long      2 = 1) + 0x3e bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (com.crystaldecisions.common.keycode.KeycodeCollection      3 = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, int      4 = 115) + 0x8c bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Dev") + 0x36 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    Exception: {com.crystaldecisions.common.keycode.KeycodeException.ReadingFromRegistry}     com.crystaldecisions.common.keycode.KeycodeException.ReadingFromRegistry
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.Load(string location = @"Software\Business Objects\Suite 11.5\Enterprise\CRNETKeycode") + 0xbd bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Enterprise\CRNETKeycode") + 0x29 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    It acts like it is having trouble accessing registry keys, but I'm not sure why.  I have permissions and the first key exists.  The last one is missing, CRNETKeycode.

  • JNLP filenotfound exception

    Hello,
    with build 36, I had a desktop application which uses spring framework. There is an XML file that is read from the classpath, using the ClassPathXmlApplicationContext from spring. The XML file is in the root of my jar file. JNLP is used to release the application (on Tomcat). Everything worked as expected.
    With build 37 and 38, I have a FileNotFoundException when running with JNLP. Running in IDE works fine.
    Has anyone else found resource / classpath problems when running with JNLP?
    kind regards,
    Peter
    The exception:
    org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext-ehBoxClient-core.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext-ehBoxClient-core.xml] cannot be opened because it does not exist
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
         at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
         at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
         at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
         at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)

    Oddly, now that the FileNotFound exception, but another IOException is thrown
    C:\>jar cmf h.txt Hello.jar Hello.class
    java.io.IOException: invalid header field name: &#8745;&#9559;&#9488;Main-Class
    at java.util.jar.Attributes.read(Attributes.java:403)
    at java.util.jar.Manifest.read(Manifest.java:167)
    at java.util.jar.Manifest.<init>(Manifest.java:52)
    at sun.tools.jar.Main.run(Main.java:124)
    at sun.tools.jar.Main.main(Main.java:904)
    C:\>

  • File LookUp in the MM : FileNotFound Exception

    Hello Friends,
    I am trying to fetch a file during the message mapping. The code I have written in the UDF is as follows :
    <u>
    String company = "";
    HashMap fileMap = new HashMap();
    BufferedReader reader = new BufferedReader(new FileReader("C:
    testfolder
    Mydata.txt"));
    String line = "";
    while((line = reader.readLine())!=null)
    String[] lineArray = line.split(",");
    fileMap.put(lineArray[1], lineArray[0]);
    company = (String) fileMap.get(a);
    return company; </u>
    <b>
    But I am getting the FileNotFound Exception when I tried to run the interface mapping.
    I have confirmed that file is there in the respective folder.
    1. Can we use the above code to fetch the file ?
    2. Do we need to put the file in the XI server ?
    </b>
    Thanks for your time.
    ~PRANAV

    and what exactly you are trying to do with this code ?
    to access files,you need to use Java io api's,and you can access file from any server,not just XI server
    but there are few drawbacks with this,first of all the file name and path will be hardcoded so u need to change it every time you move your file from Dev to QA to Prd.
    secondly this approach is good to read the file,but not a very good idea to write something in the file
    Thanx
    Aamir

  • SIMPLE Database Design Problem !

    Mapping is a big problem for many complex applications.
    So what happens if we put all the tables into one table called ENTITY?
    I have more than 300 attributeTypes.And there will be lots of null values in the records of that single table as every entityType uses the same table.
    Other than wasting space if I put a clustered index on my entityType coloumn in that table.What kind of performance penalties to I get?
    Definition of the table
    ENTITY
    EntityID > uniqueidentifier
    EntityType > Tells the entityTypeName
    Name >
    LastName >
    CompanyName > 300 attributeTypes
    OppurtunityPeriod >
    PS:There is also another table called RELATION that points the relations between entities.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    check the coloumn with WHERE _entityType='PERSON'
    as there is is clustered index on entityType...there
    is NO performance decrease.
    there is also a clustered index on RELATION table on
    relationType
    when we say WHERE _entityType ='PERSON' or
    WHERE relationType='CONTACTMECHANISM'.
    it scans the clustered index first.it acts like a
    table as it is physically ordered.I was thinking in terms of using several conditions in the same select, such as
    WHERE _entityType ='PERSON'
      AND LastName LIKE 'A%' In your case you have to use at least two indices, and since your clustered index comes first ...
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Have you ever thought of using constraints in your
    modell? How would you realize those?
    ...in fact we did.We have arranged the generic object
    model in an object database.The knowledge information
    is held in the object database.So your relational database is used only as a "simple" storage, everything has go through your object database.
    But the data schema is held in the RDBMS with code
    generation that creates a schema to hold data.If you think that this approach makes sense, why not.
    But in able to have a efficent mapping and a good
    performance we have thought about building only one
    table.The problem is we know we are losing some space
    but the thing is harddisk is much cheaper than RAM
    and CPU.So our trade off concerated on the storage
    cost.But I still wonder if there is a point that I
    have missed in terms performance?Just test your approach by using sufficiently data - only you know how many records you have to store in your modell.
    PS: it is not wise effective using generic object
    models also in object databases as CPU cost is a lot
    when u are holding the data.I don't know if I'd have taken your approach - using two database systems to hold data and business logic.
    PS2: RDBMS is a value based system where object
    databases are identity based.we are trying to be in
    the gray area of both worlds.Like I wrote: if your approach works and scales to the required size, why not? I would assume that you did a load test with your approach.
    What I would question though is that your discussing a "SIMPLE Database Design" problem. I don't see anything simple in your approach when it comes to implementation.
    C.

  • FileNotFound Exception

    Hello I am trying to parse an xml file chosen by the user. The file chosen is under:
    wkdis3/home/bwe but everytime i got this exception:
    ption caught: class java.io.FileNotFoundException
    Datei AABC.XML ist nicht g�ltig.java.io.FileNotFoundException: \home\bwe\AABC.XML (Das System kann den angegebenen Pfad nicht finden)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:78)
         at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:99)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:164)
         at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
         at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
         at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
         at ParseTest.<init>(ParseTest.java:51)
         at ParseTest.main(ParseTest.java:105)
    has anyone any idea baout that? and the main metode is so:
    public static void main(String[] args) {
    //     Work with /Dir/File.txt on the system wkdis3.
         AS400 system = new AS400("wkdis3");
         IFSJavaFile dir = new IFSJavaFile(system, "/home/bwe");
         JFileChooser chooser = new JFileChooser(dir, new IFSFileSystemView(system));
         Frame parent = new Frame();
         int returnVal = chooser.showOpenDialog(parent);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
              IFSJavaFile chosenFile = (IFSJavaFile)(chooser.getSelectedFile());
              System.out.println("You selected the file named " +
                                       chosenFile.getName());
                   String filename = chosenFile.getName()
                   try{
              File file= chosenFile;
         ParseTest xIncludeTest = new ParseTest(file);
         }catch(Exception e) {
         // System.out.println("Exception"+e+ "ist gefunden. /n ");
         System.out.println("Exception caught: "+e.getClass());
         System.out.println("Datei "+filename+" ist nicht g�ltig.");
         e.printStackTrace();
         }//ende catch
         }//Ende if
    } //ende main()
    }/

    Thanks alot Mike ..The tips you gave were very helpful..I could solution using the Object IFSJavaFile, cause when i make :
    IFSJavaFile chosenFile = (IFSJavaFile)(chooser.getSelectedFile());
    II was getting only the path but not the system and when the systems are different(you were right XMl files were on OS400) then i got the FileNotFound Exception always.Down is the corrected main methode:
    public static void main(String[] args) {
         try{
    //          Work with /Dir/File.txt on the system wkdis3.
         AS400 system = new AS400("wkdis3");
         IFSJavaFile dir = new IFSJavaFile(system, "//wkdis3/ROOT/home/bwe/");
         String directory0 = dir.getParent();
         System.out.println ("Directory0: " + directory0);
         String directory4=dir.getCanonicalPath();
         System.out.println ("Canonicalpath-Directory4: " + directory4);
    //     IFSJavaFile dir = new IFSJavaFile( "\\wkdis3\ROOT\home\bwe");
         JFileChooser chooser = new JFileChooser(dir, new IFSFileSystemView(system));
         Frame parent = new Frame();
         int returnVal = chooser.showOpenDialog(parent);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
              IFSJavaFile chosenFile = (IFSJavaFile)(chooser.getSelectedFile());
              System.out.println("You selected the file named " +
                                       chosenFile.getName());
                   String filename = chosenFile.getName();
         IFSJavaFile file = new IFSJavaFile(system,directory4+filename);
         ParseTest xIncludeTest = new ParseTest(file);
              }//ende if
         catch(Exception e) {
              // System.out.println("Exception"+e+ "ist gefunden. /n ");
              System.out.println("Exception caught: "+e.getClass());
              // System.out.println("Datei "+filename+" ist nicht g�ltig.");
              e.printStackTrace();
    }

  • HttpURLConnection throws a FileNotFound exception

    Hi Everybody,
    I want to post the data to a remote servlet using HttpURLConnection.
    But it throws a FileNotFound exception. Pls send me the solution.
    My code is
    First Servlet:
    ==============
    import java.io.*;
    import java.net.*;
    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Test extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
    response.setContentType("text/html");
              URL url = new URL("http://node_18:8080/examples/servlet/HelloWorldExample1");
              HttpURLConnection conn = (HttpURLConnection) url.openConnection();
              conn.setRequestMethod("POST");
              //HttpURLConnection.setFollowRedirects(true);
              conn.setUseCaches(false);
              conn.setDoOutput(true);
              conn.setDoInput(true);
              String postData = "name=value&othername=value";
              String lengthString = String.valueOf(postData.length());
              conn.setRequestProperty("Content-Length", lengthString);
              conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
              Writer out = new OutputStreamWriter(conn.getOutputStream());
              out.write(postData);
              out.close();
              PrintWriter out1 = response.getWriter();
              BufferedReader in =
              new BufferedReader(new InputStreamReader(conn.getInputStream()));
              String line = null;
              while (null != (line = in.readLine()))
              out1.println(line);
              in.close();
              out1.close();
    Second Servlet:
    ================
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorldExample1 extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String name = request.getParameter("name");
    String othername = request.getParameter("othername");
    System.out.println("name = "+name+" othername = "+othername);
    out.println("<html>");
    out.println("<head>");
         out.println("<title> Test </title>");
    out.println("</head>");
    out.println("<body bgcolor=\"white\">");
         out.println("Test");
    out.println("</body>");
    out.println("</html>");
    public void destroy() {
         System.out.println("Servlet Destroyed");
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException
         doPost(request,
    response);
    Error:
    =======
    java.io.FileNotFoundException: http://node_18:8080/examples/servlet/HelloWorldExample1
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:574)
         at Test.doGet(Test.java:37)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:471)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:623)
         at java.lang.Thread.run(Thread.java:484)

    Hi p200002,
    I call doPost method in doPost in the second servlet. It will be
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException
         doGet(request,
    response);
    }

  • Exception:Problem building schema

    Hi all,
    I want to make a web service call to a service deployed in weblogic, I copied the wsdl to a local file and I created a PartnerLink referring to the wsdl in my local file. I put an Invoke action, create an input variable, everything work fine. However when I try to explore the input variable I got exception:Problem building schema.
    Is there anything wrong with the WSDL? I've validate it and it was ok.
    Thanks in advance,
    santoso
    Here is the WSDL of the service:
    <?xml version='1.0' encoding='UTF-8'?>
    <definitions name="ProposalWSServiceDefinitions" targetNamespace="http://com/my/ws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:s0="http://com/my/ws" xmlns:s1="http://schemas.xmlsoap.org/wsdl/soap/">
    <types>
    <schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.my.com/opl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://com/my/ws" xmlns:s1="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.my.com/opl">
    <complexType name="Proposal">
    <sequence>
    <element name="id" type="int"/>
    <element name="title" type="string"/>
    <element name="creator" type="string"/>
    <element name="status" type="string"/>
    <element name="customerId" type="int"/>
    </sequence>
    </complexType>
    <element name="ProposalData" type="tns:Proposal"/>
    </schema>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://com/my/ws" xmlns:s0="http://com/my/ws" xmlns:s1="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="insertProposal">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="proposal" type="opl:Proposal" xmlns:opl="http://www.my.com/opl"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    </types>
    <message name="insertProposal">
    <part element="s0:insertProposal" name="parameters"/>
    </message>
    <portType name="ProposalWS">
    <operation name="insertProposal" parameterOrder="parameters">
    <input message="s0:insertProposal"/>
    </operation>
    </portType>
    <binding name="ProposalWSServiceSoapBinding" type="s0:ProposalWS">
    <s1:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="insertProposal">
    <s1:operation soapAction="" style="document"/>
    <input>
    <s1:body parts="parameters" use="literal"/>
    </input>
    </operation>
    </binding>
    <service name="ProposalWSService">
    <port binding="s0:ProposalWSServiceSoapBinding" name="ProposalWSSoapPort">
    <s1:address location="http://172.16.208.45:7001/SBSWebService/ProposalWS"/>
    </port>
    </service>
    </definitions>

    I've solved it just by upgrading to BPEL 10.1.3.1 (was 10.1.2.0)

  • [SOLVED] bluetooth problem - bluez-simple-agent exception

    Hi
    I am trying to pair to a bluetooth headset. I think I'm almost there, but at the last step I get an exception.
    This is what i did so far:
    1) launch dbus
    rc.d start dbus
    2) launch bluetooth
    rc.d start bluetooth
    3) check if my device is UP
    # hciconfig
    hci0: Type: BR/EDR Bus: USB
    BD Address: 58:B0:35:63:4A:9F ACL MTU: 1021:8 SCO MTU: 64:1
    UP RUNNING PSCAN
    RX bytes:2095 acl:0 sco:0 events:59 errors:0
    TX bytes:730 acl:0 sco:0 commands:53 errors:0
    4) scan for the headset (which is discouverable)
    # hcitool scan
    Scanning ...
    00:23:78:5C:00:A8 Bluetooth headset
    5) try to pair (FAILS)
    # bluez-simple-agent 00:23:78:5C:00:A8
    Traceback (most recent call last):
    File "/usr/bin/bluez-simple-agent", line 102, in <module>
    path = manager.FindAdapter(args[0])
    File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
    File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
    File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
    dbus.exceptions.DBusException: org.bluez.Error.NoSuchAdapter: No such adapter
    I searched in the forums but could not find a solution. Has anyone an idea?
    Thanks in advance,
    Keen
    Last edited by keen90 (2012-05-18 13:50:37)

    # bluez-simple-agent 00:23:78:5C:00:A8
    I got the same error when I just tried that myself... but if I add the bluetooth adapter parameter it goes further:
    # bluez-simple-agent hci0 00:23:78:5C:00:A8
    Because my headphones were already paired at the time, I think that's why I then got a "Creating device failed: org.bluez.Error.AlreadyExists: Already Exists"... but it may work for your unpaired device.

  • Simple Transformation Exception

    Hello,
    I am tying to map XML to ABAP(deserialize) but receive a CX_ST_MATCH_ELEMENT Exception.
    Below is my Simple Transformation, the calling method, and the XML snippet I am tying to deserialize.
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="ROOT"/>
      <tt:template>
           <SndgInst>
             <tt:value ref="ROOT"/>
           </SndgInst>
      </tt:template>
    </tt:transform>
    method PARSE_XML.
      DATA:
        sndginst(10)                  type c value '          ',
        l_exception_error               TYPE REF TO cx_st_error.
    parse the xml content
        TRY.
            CLEAR: l_exception_error.
            CALL TRANSFORMATION (i_st_name)
                         SOURCE XML i_xml_string
                         RESULT root = sndginst.
    catch exception
          CATCH: cx_st_error INTO l_exception_error.
        ENDTRY.
    endmethod.
    <S2SCTScf:SndgInst ymlns:S2SCTScf="urn:S2SCTScf:xsd:$SCTScfBlkCredTrf">ZYDOFRP0</S2SCTScf:SndgInst>
    I have tried adding a reference for the namespace 'S2SCTScf' but receive the same exception.
    I think it must have something to do with the namespace prefix and I have tried several different versions of the Simple transformation, such as <S2SCTSCF:SndgInst> as my tag reference, to no avail.
    The exception class does not provide a lot of useful information and since you cannot debug a Simple Transformation it is a guessing game.
    Thanks in advance for your help.
    Best Regards,
    Mark Lengel
    Edited by: Mark Lengel on Mar 31, 2009 11:32 AM

    I've exactly the same problem.
    My XML Input Stream contains Namespaces in the root element for e.g.
    <Measurement xmlns="es.xxx.com" xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:ns3="http://www.w3.org/1998/Math/MathML">
    The Simple Transformation always raise an CX_ST_MATCH_ELEMENT Exception.
    If i delete the xmlns declarations, the Element will be found and everything is o.k.
    I've also tried to avoid this by adding the tt:extensible="deep-dynamic" attribute but it doesn't matter.
    <tt:template>
        <Measurement tt:extensible="deep-dynamic">
    I use WebAS 6.40, ERP 2004.
    I hope the Community could help us. Maybe it's bug in the XML Libraries.. etc..
    Kind Regards
    Chris

  • FileNotFound exception while compiling WebDynpro Project

    Hi,
    I was trying to develop a webdynpro application by installing NetWeaver developer Studio on my local machine and accesing a remote j2EE server. Simple applications run without any problem.But when I am trying out Data Binding and eventing,I am getting compilation error:
    com.sap.ide.tools.core.patternfwk.GenerationPluginDataProvider: Unable to configure AvalonLogSystem : java.io.FileNotFoundException: C:\Program Files\SAP\JDT\eclipse\velocity.log (Access is denied) (java.lang.Exception: Unable to configure AvalonLogSystem : java.io.FileNotFoundException: C:\Program Files\SAP\JDT\eclipse\velocity.log (Access is denied))
    Any inputs as how to solve the problem?
    Thanks and Regards,
    Vaijayanth

    Hi Vaijayanth,
    this is strange. velocity.log is used for output of messages regarding the code generation process (for example generating controller implementation code). That's all. Please check, if the file exists, if not, try to create it manually. If it exists, it might be locked by another process, but i have no idea, which process.
    Hope that helps.
    Best regards
    Stefan

  • Sealing exception problems - S.O.S!!!!

    Hi,
    I am trying to solve this problem of 'sealing exception' that I have been encountering with Unix/Tomcat/JAXP platform. The way I found out is through a thread in this forum itself.
    It says to unjar the 3 jar files in the JAXP folder (crimson, jaxp and xalan) and change sealed property in the Manifest file from true to false.
    I did this accordingly, but now could anyone please help me in how do I go about again doing a jar on these files. I know it should be a simple thing but please forgive my ignorance folks.
    An earliest help in this regard would be highly appreciated.
    Thanks.

    It says to unjar the 3 jar files No. Your configuration is wrong. The JAR files are OK.
    My best guess: you installed something like Xerces for your XML parsing? Tomcat itself also ships with an XML parser -- an old one, with old versions of org.w3c.Element etc. This is the cause of your problems. By the way: a "No such method" exception may also be caused by this...
    Replace the JAR files with the original ones. Next, revise your classpath. Make sure to get your newer XML stuff in the classpath prior to the Tomcat stuff. Or replace the Tomcat provided parser.jar / xml.jar (whatever) with your choice.
    Use the -verbose option to see that some XML related things are loaded from another file than you may expect.
    See also http://forums.java.sun.com/thread.jsp?forum=60&thread=159824
    a.

  • Exception problems utilizing javax.swing.UIManager

    I am in the process of creating a simple console environment for a certain application that runs in windows mainly but programmed in Java. Am trying to set the LookAndFeel to windows but it keeps throwing a java.lang.ClassNotFoundException_.
    try {
            javax.swing.UIManager.setLookAndFeel("com.sun.java.plat.windows.WindowsClassicLookAndFeel");
    } catch (Exception e) { System.err.println("Error: "+e); }After thinking I just simply didn't have the package installed correctly I wrote a simple app to check...
    public static void main(String[] args) {
         javax.swing.UIManager.LookAndFeelInfo[] info = javax.swing.UIManager.getInstalledLookAndFeels();
         for(int i=0; i<info.length;i++){
              String LFname = info.getName();
              String className = info[i].getClassName();
              System.out.println(LFname+" : "+className);
    }This gave me the output...Metal : javax.swing.plaf.metal.MetalLookAndFeel
    CDE/Motif : com.sun.java.swing.plaf.motif.MotifLookAndFeel
    Windows : com.sun.java.swing.plaf.windows.WindowsLookAndFeel
    Windows Classic : com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeelSo I can only assume that I have the the necessary resources installed correctly. Any thoughts on what might be causing my problem?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    So I can only assume that I have the the necessary resources installed correctly. Any thoughts on what might be causing my problem?
    com.sun.java.plat.windows.WindowsClassicLookAndFeel // the class you're trying to set
    com.sun.java.plaf.windows.WindowsClassicLookAndFeel // the class that is actually availableSee the difference?
    ~

Maybe you are looking for

  • Why are exported movies letterboxed?

    I'm looking at the video clips I imported into my computer, and they are the same aspect ratio as my screen, filling it up when I choose to play it in Full Screen. However, once I put the video in Premiere and then export it, the video becomes letter

  • Using Ipod on more than one computer

    I have just purchased a new ipod after my old one broke down and when I hooked it up to my computer i got a message saying that this is the 5th computer my ipod is registered to... Being a new ipod i would think I should start again with this process

  • APDU error 6a80

    Hi there, i'm new to javacard technology and i'm trying to run the wallet.java example usingEclipse. I get an error message of 6a80 when i try to debug the app. Does anyone have any ideas of what the problem could be? I havent changed any of the code

  • Vector  smart object

    HI been sent a psd file whic h contains a background layer plus a layer with a vector mart object on it ( made in illustrator) I want of use that vector smart  object in another psd  but the drag toa tabbed documetn option does not work.Neither do I

  • Adding segments to accounting KFF

    Hello, we are having the accounting KFF of 8 segments like COMPANY.DIVISON.SUBDIVISON.DC.FEEDER.NATURAL ACCOUNT.MPREC.FUTURE now we want to add new segment in this strucure so how it will possible and what impect will be ocuured .we had already go li