Java.io.File Bug

A new java.io.File does not get created.
Example:
     TransformerFactory factory = TransformerFactory.newInstance();
     File stylesheet=new File("catalog.xsl");
     Transformer transformer = factory.newTransformer(new StreamSource(stylesheet));
     File xmlFile=new File("catalog.xml");
     File xslFOFile=new File("catalog.fo");
     Source src = new StreamSource(xmlFile);
     Result  result = new StreamResult(xslFOFile);
     transformer.transform(src, result);Error gets generated:
TransformerException: java.io.FileNotFoundException: catalog.fo

Created a new JDeveloper project. The error does not get generated.

Similar Messages

  • Can New Java 7 File API Path Objs Be Used For Windows Virtual Folders

    Hello,
    I'm trying to duplicate a JFileChooser's drop-down list containing root directories of the file system. For Windows machines, its combobox lists the roots in a nice tree-like layout. For example:
    + Desktop
      + Computer
        + Local Disk (C:)
        + Data (D:)I cannot find an offical way to do this; I ended up using a class called "ShellFolder" to do it. Based on the "File" objects returned by the "ShellFolder" operation, I wanted to use the "toPath" method of the "java.io.File" object to convert the object to a "java.io.file.Path" object. Unfortunately, when I try to convert it, a java.nio.file.InvalidPathException" occurs.
    Therefore, is there a way to use the the new Path object (provided by Java7's new File NIO APIs) that can map to Windows special virtual folders (like "My Computer" which is mapped to a CLSID like "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")?
    Note: It looks like NetBeans suffered from the same problem. See their bug report here: [https://netbeans.org/bugzilla/show_bug.cgi?id=214011] .
    Here's some sample code to reproduce the problem:
    static public void main(final String[] asArguments)
         javax.swing.SwingUtilities.invokeLater(new Runnable() {
              @Override
              public void run()
                   java.io.File homeFile = FileSystemView.getFileSystemView().getHomeDirectory();
                   System.out.printf("File obj for home dir = %s\r\n", homeFile.getAbsolutePath());
                   java.nio.file.Path homePath = homeFile.toPath();
                   System.out.printf("Path obj for home dir = %s\r\n", homePath.toString());
                   // get the root directories
                   java.io.File[] rootDirs = (java.io.File[]) sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders");
                   for (int nIdx = 0; nIdx < rootDirs.length; nIdx++) {
                        java.io.File nextRoot = rootDirs[nIdx];
                        System.out.printf("File obj for next root dir = %s\r\n", nextRoot.getAbsolutePath());
                        // Is this a bug?
                        //          When we encounter a special Windows folder,
                        //          like "My Computer" which has a filename of "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
                        //          why do we receive a "java.nio.file.InvalidPathException"?  Should it not resolve the path
                        //          to the virtual Windows folder of "My Computer", just like the java.io.File objects do?
                        //          If not, is there an alternative way to get that information using the new Java 7 File APIs?
                        java.nio.file.Path nextRootPath = nextRoot.toPath();
                        System.out.printf("Path obj for next root dir = %s\r\n", nextRootPath.toString());
                   } // for
              } // run
    } // mainEdited by: RhinoGuy on Aug 10, 2012 11:11 AM

    Hmm don't know about special folders but the File object does have a listRoots() method. Perhaps that only returns mapped drives on Windows though, I remember using it to create my own Eclipse type filechooser which I find a lot more user-friendly than the standard JFileChooser.

  • Java Code file 1 meg... Can't open it

    Hi All,
    I've just started using SJSE and have run into a couple of issues. First problem is that I can't open my java source file. Second issue is I can't get the ide to run my applet. It just displays a small box and that's it. Everything worked great in V7. Below is the output with respect to the opening of the source file.
    java.lang.NullPointerException
         at org.netbeans.modules.javanavigation.actions.OpenAction.selectElementInPane(OpenAction.java:187)
         at org.netbeans.modules.javanavigation.actions.OpenAction.access$000(OpenAction.java:56)
    [catch] at org.netbeans.modules.javanavigation.actions.OpenAction$1.run(OpenAction.java:129)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    Yes it only happens with large files. I have set the following in the jstudio.conf file.
    netbeans_default_options="-J-Xms512m -J-Xmx512m -J-XX:PermSize=128m -J-XX:MaxPermSize=256m -J-Dnetbeans.logger.console=true -J-ea -J-Dsun.java2d.pmoffscreen=false -J-Dcom.sun.im.service.xmpp.session.keepaliveinterval=30 -J-Dcom.sun.aas.installRoot=\"K:\Program Files\Sun\jstudio_ent8\AppServ8.1UR2\""
    Also, when building my sources I get another 'bug report' message.
    An exception has occurred in the compiler (1.5.0_04). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
    com.sun.tools.javac.code.Symbol$CompletionFailure: file javax\servlet\ServletContext.class not found

  • Java Applet Files in RH8 Output

    Hello to everyone!
    My name is Livia, I am from Romania, and I work as a Technical Writer for a company that makes billing software for telecommunications providers. One of my tasks consists in creating WebHelp files for our web-based applications, and I have recently encountered a problem for which I need some expert advice.
    While investigating a recent bug (the help isn't working properly on the web application it's for), I have discovered that there are some Java-related files missing from my help output: webhelp.cab, webhelp.jar and whskin_papplet.htm. These files exist in older projects created with RH5. I now use RH8. The Adobe help page for RH 8 (At http://help.adobe.com/en_US/RoboHelp/8.0/RoboHTML/WS5b3ccc516d4fbf351e63e3d11aff59c2a0-7fb 6.html) lists these files as normally present in the output, and yet, in one of the discussion threads on this forum (http://forums.adobe.com/thread/24865), someone says "webhelp.jar is not being used in the output so you can safely remove it if required. It has been fixed in RH8 and doesn't come in the output."
    What is the correct version? Should these files appear in the help output or not?
    Thank you,
    Livia Miron

    Welcome to our community
    The files should not be present. They are not needed. They are (or were) related to the way the navigation pane works.
    In RoboHelp 7 and earlier, there was the following option in the WebHelp generation dialogs:
    As you can see, RoboHelp 8 does not offer this option:
    Hope this helps... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Java.policy file  - Must I change it?

    I just got a certificate from Verisign with which I signed my applet. It works fine and now I want to distribute it to a group of users.
    Back when I was developing the applet with a self-signed cert, I changed the java.policy file to allow the applet to do things 'outside the sandbox'.
    I thought, perhaps mistakenly, that when I got the Verisign ceritifcate I would not need to concern myself with java.policy in any way. But now, even with the Verisign cert, my applet won't run correctly w/o the updated policy file.
    This is only important to me as I do not want to go around to 'x' number of user workstations and modify each java.policy file.
    Am I missing something??
    thanks

    You mention
    "you should be able to remove the policy file and users can just accept the certificate "
    I experience the same, remove all policy files, signed applets can then access resopurces on the local machine. However, practically all the documentation I read regarding JAVA 2 (I'm using 1.4.1_02) says you must have a policy file when using a signed applet. At least they say sign your applet and then indicate what the policy file should look like to grant specific permissions for that applet. I find no policy file will still allow a signed applet to access local files... Is this a bug in JAVA 2 1.4.1_02, or the correct behavior. thanks in advance.

  • [svn:sb-asc-redux] 18186: emit versioned uris into a single sorted, consolidated file (bug asc-4141; r=jodyer)

    Revision: 18186
    Revision: 18186
    Author:   [email protected]
    Date:     2010-10-15 14:36:17 -0700 (Fri, 15 Oct 2010)
    Log Message:
    emit versioned uris into a single sorted, consolidated file (bug asc-4141; r=jodyer)
    Ticket Links:
        http://bugs.adobe.com/jira/browse/asc-4141
    Modified Paths:
        flex/sdk/sandbox/asc-redux/src/java/macromedia/asc/embedding/ScriptCompiler.java

  • Java.io.File not found in JDK 1.4

    why the java.io.file is deprecated.
    Frans

    [fthamura],
    why the java.io.file is deprecated.Probably because in J2SE 1.4, the New I/O package java.nio package provides scalable I/O operations for files. Through the File channels, a programmer will be able to provide memory-mapped buffers, improved file locking mechanism and faster I/O transfers with the new API package.
    FransHTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Getting all the members (variables, methods AND method bodies) of a java source file

    For a project I want to programmatically get access to the members of java source file (member variables, methods etc) as well as to the source code of those members. My question is what is the best method for this? So far I have found the following methods:
    Use AST's provided by the Java Source API and Java Tree API, as discussed in the following posts:
    http://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using-java-6-compiler-apis.html
    http://weblogs.java.net/blog/timboudreau/archive/2008/02/see_java_code_t.html
    http://netbeans.dzone.com/announcements/new-class-visualization-module
    This has the disadvantage that the classes actually have to be compilable. When I look at the Netbeans Navigator view however, it provides me with a nicely formatted UI list, regardless of the "compilable" state of the class.
    Thus I started looking at how to do this... The answer appears to be through the use of tools such as JavaCC: https://javacc.dev.java.net/
    ANTLR: http://www.antlr.org/
    which are lexers and parsers of source code. However, since the Navigator panel already does this, couldn't I use part of this code to get me the list of variables and methods in a source file? Does the Navigator API help in this regard?
    Another route seems to be through tools such as
    BeautyJ: http://beautyj.berlios.de/
    which run on top of JavaCC if I am correct, and which has the ability to provide a clean view on your java code (or an XML view). However, BeautyJ does not seem to be too actively developed, and is only j2se1.4 compatible.
    I hope someone can shed a light on the best way to go about what I want to achieve. Somebody already doing this?
    (I crossposted on the Netbeans forums too, hope this is OK...)

    I'm currently developing a LaTeX editor(MDI) and I do the same thing, but I don't know what exactly do you need.

  • How to read the java class file to convert it in java.

    hello all,
    i m developing the java application which generated the java code from the java 'class file' .
    Can anybody please help me, Is any java support for reading the class file? or how to know the class file format?
    I know the application javad, jad, javap which is doing the same thing.
    thanks for reply,
    - Jayd

    do you mean decompiling? there are tons of java decompilers available out there, what exactly are you trying to do here?

  • How to convert a .jsp to a .java/.class file for use in peoplesoft

    Hi java/jsp experts,
    I want to convert a .jsp to a .java/.class file. is there a tool available, please let me know if you have any pointers....
    or can i do it manually:
    these are a few lines that the .jsp contains, and i would like to translate this to be in .java/.class format:
    <%@ page import="sun.misc.BASE64Encoder, javax.crypto., javax.crypto.spec."%>
    <%@ page import="java.util.StringTokenizer" %>
    <%@ page import="java.util.Map" %>
    <%!
    sb.append("<input type=\"hidden\" name=\"orderPage_serialNumber\" value=\"");
    sb.append(serialNumber);
    sb.append("\">\n");
    return sb.toString();
    %>
    how can i translate the above import statements and html elements from jsp to java, please let me know.
    Once i have the .java file created from the .jsp, I will compile .java to create the .class file and invoke the .class in peoplecode by using java apis available in peopletools.
    Thanks in advance.

    Is there a way convert a binary .exe file( compiled by
    another compiler) into Java .class/.jar file ? Anyone
    know of a free program that can do this?It's not possible. There are many decompilers and disassemblers for Java but nothing will take you from ANY binary to Java source. It would be the end of computing as we know it and the beginning of a new era -:)

  • How to convert dll to a java class file?

    Hi folks:
    I have some DLLs in VB and C++ and I wanna to convert them to a java class file. Does anybody know if exist a sw or easy way to do it?
    thanks
    Autair

    Well, I believe you could write JNI to call the functions in the DLLs, although I wouldn't recommend it. (You'd have a non-portable, fragile result.)

  • How to convert java .class file to .dll file

    hi,
    I got a problem, I have to convert my java .class file to .dll file. Microsoft VC++ program will invoke the converted .dll file.
    Is there any other possibility.
    I was confused.
    Cam any body help me. If you are having solution for the can you send to my [email protected] account.
    thanks,

    No, it is not possible to do what you are suggesting. Yes, you could produce a DLL that wraps the JVM and loads your java class exposing a C and/or C++ callable interface, but that is a lot to go through unless your class is VERY complex. Otherwise, you might want to just create and maintain two implementations.

  • How can I share a *.java source file across multiple projects in NetBeans?

    I'm sure this simple and a pretty common operation but how can I share a *.java source file across multiple projects in NetBeans? Right now I keep cut, coping and pasting the same source file between multiple projects to re-use the same code. But I could I make this source file a library file or something like that so that I could access it from any project. I assume this would be a generic operation but I mentioned NetBeans for clarity. Thanks.

    fiebigc wrote:
    I know I mentioned NetBeans but I'm most interested in the generic method for creating a library of source files that I can call into whatever program I am developing. I've done such a thing in C using header files and such but I'm trying to get a direction on how this is accomplished in Java. I'm sorry if I could edit the title I would. If anyone wants to be specific about NetBeans I welcome that too.
    Edited by: fiebigc on Jun 20, 2008 5:57 PM
    >I know I mentioned NetBeans but I'm most interested in the generic method for creating a library of source files that I can call into whatever program I am developing. I've done such a thing in C using header files and such but I'm trying to get a direction on how this is accomplished in Java. I'm sorry if I could edit the title I would. If anyone wants to be specific about NetBeans I welcome that too.
    Edited by: fiebigc on Jun 20, 2008 5:57 PM
    Create a class library.
    Write your code, compile it to .class files, put those class files in a .jar file and include the jar file in the classpath whenever you want to compile a project against it.

  • How can i run a java class file from shell?

    Hi all,
    I've a .class file named "File" that contains Main method, it is in the package "File2".
    How can I run it by shell command?
    PS: "java -cp . file" doesn't work it launch->
    Exception in thread "main" java.lang.NoClassDefFoundError: File2/File (wrong name: File2/File)
    Thanks in advance.

    Just to understand: is File2 ar jar archive or not? If it is a jar archive, have you tried open File2.jar? If File2 is a directory within the current directory, have you tried java -cp . File2/File? I just tested with a set of classes and it works... Let me be precise:
    * Let us imagine you are working in a directory whole path is PathToDir/
    * in this directory you have the classes put in a directory called File2
    * in order to launch File.class then you would have to invoke :
    cd PathToDir/ (just to be sure)
    java -cp . File2/File
    *if you were to do the following then you would have the problem you describe
    cd PathToDir/File2/
    java -cp . File

  • Static lookup lists:read data from a Java *.properties file

    Hi
    i need to make static lookup lists i am using read data from a Java *.properties file
    i am using the Class "PropertyFileBasedLookupViewObjectImpl" that wrote by Steve Muench in ToyStore.
    but i need to use the default language for that i update the loadDataFromPropertiesFile()
    method to find the correct properties file
    String temp=Locale.getDefault().getLanguage();
    String propertyFile =
    getViewDef().getFullName().replace('.', '/')+"_"+temp+ ".properties";
    the problem:
    For English(TEST_en.properties) it is good and working
    For Arabic(TEST_ar.properties) read from correct file _ar.properties
    but the dispaly character is wrong
    When Debug
    In the File 1=&#1583;&#1605;&#1588;&#1602;
    In debug 1=/u32423

    Depending on your use case you can either use a programmatic VO or directly expose the JV class as a data control.
    http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_36/jdtut_11r2_36.html

Maybe you are looking for

  • External hard drive not visible in Finder or Disk Utility

    Hi everyone, My Wester Digital 2TB external hard drive has disappeared, so to speak, with all my photos. I work as a freelance photographer. Mostly on Lightroom 5.6 When I plug it in, with firewire, I can feel the disk rotating normally however it do

  • Pdf reader plug-in missing in safari after installing lion

    After installing Lion, my pdf plug-in seems to be missing for Safari. I am not being able to view the embeded pdf documents anymore. I have installed java for Lion, downloaded adobe reader plug-in, restarted my macbook-pro - nothing helps. What am I

  • Contacts are not loaded thru bluetooh

    My car (Peugeot 307) has its built-in bluetooth kit. but my 2 phones 6680 or 9300i are not displaying any of the contact names. although i have not experienced this problem with my old 6310i. Any suggestions ?Message Edited by fonoo on 17-Mar-2007 03

  • Order Quotation doesnt work in webshop

    hello friends, I request all ECOmmerce Gurus to help me solve this issue below, I ahve created a New quotation in Webshop asking a dicount of price for an item,and then i logged onto the Web UI as sales rep and offered the discount,and when i log bac

  • Button if not clicked within stipulated time jump to assigned slide

    The background image is actually a video that's being played and as the switch is approaching the user has to either proceed or stop...Since this switch is aligned the right way the user is supposed to hit proceed button. In this switch stop button w