Java applet writes to file on client, no signing necessary

Hi,
I wonder if this is a feature or bug:
I download and execute in my browser an unsigned applet/jar myCharts.jar from server. The applet references classes from package org.jfree.chart, which are not packed in myCharts.jar downloaded from server, but are locally stored on client in jre/lib/ext/jfreechart.jar (and therefore JVM running the applet loads and uses these local classes from local jar).
The applet can write the file to client disk without any problem using classes from locally loaded jfreechart.jar. If I merge both jars into a big one and load it through network, file write access is forbidden.
I am using JRE 1.5.0.3 for Windows and default java_policy file with 2      permissions added:
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
Is it a bug, or feature ?
According to my opinion these 2 permissions should not result in applet ability to write files using locally loaded classes.
Thanks for your answer
Martin

The following is a duplicate posting in reponse to similar question:
http://forum.java.sun.com/thread.jsp?forum=4&thread=200482&start=0&range=30#735223
In short, you cannot write to a server without help from servier-side software such as a servlet, cgi, ASP, etc.
If you go with something like an Oracle database on your server, it's a non-issue because the seucirty aspects are taken care of for you.
V.V.

Similar Messages

  • How to program in JAVA to write a file to CD

    Hi,
    How to write a program in JAVA to write a file in CD (Using CD-Writer)...

    Install packet-writing software and then write to the cd just like any drive.
    If you're using Windows XP, it has basic capabilities for this built in.
    http://support.microsoft.com/default.aspx?kbid=306524
    http://support.microsoft.com/default.aspx?kbid=279157

  • Write PDF file to client's machine using Applet

    Hi all,
    I want to use Java Applet to write a PDF file into the client's computer when he/she double click the URL in browser. Can I do that and HOW. I heard that i need to signed the applet and make security manager enable, but how to do it?
    Also, is it any different to do this for IE5X and NS4X browser?
    Thanks for your information.

    Hi,
    I don't know how to do that with a signed applet (excepting if you want to write in the PDF format), but you can do this with a script (like asp) and an active X written with VB. You can build and manipulate Word or Excel Object with VB and so build dynamically your document.
    When your document is ready (in the active X), you can use the distiller from acrobat (you need a license to use it) and you can create a new file on your hard drive (server side).
    Your script will do the following:
    1) load (createobject) the active X
    2) call the method in the active x
    3) redirect the client to the correct page (the new document you created)
    I don't have any code to give you, but I did the same thing last year and it worked...
    I think that you can also interact between an applet and an active X (I saw something like that in the forum)...
    Of course this solution is running server side (the file will be created server side) but the client will be able to see his document in his browser and will be able to save it.
    I hope that it can help you even if it is not with java...
    Blaise

  • Write a file on client from java procedure

    Hello to all, my problem is that i want to write a file from a java procedure using the normal java class. But when i try to write
    File file=new File("C:\\DiscoD\\myFile.txt");
    FileWriter fw=new FileWriter(file);
    fw.write("ciao");
    nothing happens and no file is created. How can i write a file on my pc client from java procedure?
    Thanks to anyone that want helps me.

    I want to write a java procedure loading java class on oracle with utility loadjava and this work for example for classical Hello World. Now i want to write data on a text file on my hard disk using class java calling the procedure for example in this mode:
    begin
    procedure('ciao'); //this procedure have to write on a file located on my pc the word ciao
    end;
    But nothing happens. Why? There is a special reason related to how oracle works(privileges, permission etc)?
    Thanks

  • Applet write to file on server

    Despite people's insistence that this is in the tutorial or faq, I find that it is not. Also, I have gotten conflicting information about this so I'd like to know the real answer. I want to have an applet that loads in the user's browswer, collects some data, then writes the data to a file on the server from which the applet was loaded.
    Here is what I have managed to accomplish (using my Win98 comp and Unix server):
    from just loading the applet on my computer and using relative file name to write - it made a file on my desktop (not the right place) but with the correct information
    on my comp and using absolute windows file name - it made the file in the right place and with correct information
    from trying the applet over the web on a server that allows you to write to files using both relative and absolute file names - acted dead when I pushed the button that would make it write to a file, and it didn't execute the "catch."
    I really want this to work since I want the applet to be the user interface and the applet is preferred to javascript or something else because of the nature of what I'm doing. Also, we were going to use a SQL database. I know Java has an interface with SQL but could I get my applet to communicate with our SQL database on the server directly or are we going to have to make another script for it to go through?
    thanks

    The following is a duplicate posting in reponse to similar question:
    http://forum.java.sun.com/thread.jsp?forum=4&thread=200482&start=0&range=30#735223
    In short, you cannot write to a server without help from servier-side software such as a servlet, cgi, ASP, etc.
    If you go with something like an Oracle database on your server, it's a non-issue because the seucirty aspects are taken care of for you.
    V.V.

  • Security manager - applet - write/read files

    Hi.
    I've been trying to built a SecurityManager to allow my java applet to construct a file (*.txt or *.doc) on the server (webhosting provider) it came from. Unfortunately when I use the setSecurityManager method to set my Security Manager as the default Security Manager for that specific applet, the applet throws a SecurityException. It wouldn't allow me to change the Security Manager.
    I want to change the default Security Manager so that my applet can have permission to read and write to the specified file (*.txt or *.doc). I don't want to save any kind of files on the host computer even if I can do that, I only require to save my file (*.txt or *.doc) to the computer from were the applet's classes came from.
    Thank you!

    If there is a security manager already installed, this method first calls the security manager's checkPermission method with a RuntimePermission("setSecurityManager") permission to ensure it's ok to replace the existing security manager. This may result in throwing a SecurityException. Thus I think that you need to grant the setSecurityManager permission to your current SecurityManager to be able to replace it.

  • How to read and write Xml file at client side using JavaScript !

    Hello,
    i am new to javascript.
    I have requirement to read and update XML file at client side.
    Will you please guide what could be the best way to read and update XMl file using javascript.
    Thanks,
    Zuned

    This is a Java forum,not a Javascript forum. Maybe you should ask here [http://www.webdeveloper.com/forum/forumdisplay.php?forumid=3&s|http://www.webdeveloper.com/forum/forumdisplay.php?forumid=3&s].

  • Java Applet - Printing Pdf Files

    Hi
    Can anyone suggest me some libraries to print pdfs using Java Applets. I have tried using the SmartJPrint library but its giving me error when I try printing pdfs using applets.
    Thanks
    nikhil

    SmartJPrint web applets have changed recently and works to be fine every time. You might try these links for printing of existing pdf, pdf viewing, pdf print, pdf silent printing from a command line or silently printing a pdf from a browser page.
    http://www.activetree.com
    Demo that print a PDF from a browser page silently.
    [This demo printing control parameters as part of the PDF url. Interestingly this pdf print demo from browser works for a remote PDF URL that dynamically generate a PDF and then prints to the printer. In this demo you have the option to enter your URL that is either a PDF or a PDF generating URL that eventually generates a PDF and then prints.]
    http://www.activetree.com/silent_print_from_browser1/start.jsp
    [PDF print silently or using user choice dialog from the applet. PDF printing parameters such as printer name, auto page size detection, paper size selection, fit to page etc. are made as choice. This demo too print a PDF or more than one PDF as a batch pdf print. You have chice to submit the pdf print job as a separate print job or as one pdf print job.]
    http://www.activetree.com/silent_print_from_browser2/start.jsp
    These two links are opening their PDF viewer applet for viewing your local or remote PDF files.
    http://www.activetree.com/demo/pdfapplet/pdfviewer.jsp [Open the PDF viewer inside the browser frame itself. When browser resize the applet resize too.]
    http://www.activetree.com/demo/pdfapplet/pdf_viewer_no_frame.jsp [Opens the PDF viewer in a new Java frame window]
    Edited by: jatima123 on Nov 20, 2007 10:19 AM

  • Write XML file on client

    I'm trying to generate XML files on a client machine. I'm using SQL*Plus Instant Client v 10.1.0.4.0 connected to DB version 10.1.0.3.0. I've created a view of XMLType and am able to select XML from this view. I've been unable to figure out a way to generate well-formed XML via a Spool command and Select statement as Sqlplus returns the XML as one row and has problems with line wrapping, embedded spaces, and also including the SQL command in the spooled output. I've tried many different permutations of Set commands to no avail.
    Is there a way to generate a valid XML file from Sqlplus on a client machine using the Spool command? If not Sqlplus, any other suggestions?
    Thanks,
    Glenn

    I would be inclined to write a pipelined function to take a clob, and break it up into pieces (perhaps after a '>').
    Here's an example of a pipelined function, which you can modify to suit your needs, such as working with CLOBs. You may also want to add more intelligence to it, such as checking for when the chunk is longer than 2000 characters.
    CREATE TYPE tvc2000 AS TABLE OF VARCHAR2(2000)
    CREATE OR REPLACE
    FUNCTION chopper
      p_string IN VARCHAR2
    RETURN tvc2000
    PIPELINED
    IS
      l_len NUMBER := LENGTH(p_string);
      l_out NUMBER := 0;
      l_pos NUMBER;
    BEGIN
      l_pos := INSTR(p_string, '>', l_out+1);
      WHILE l_pos > 0 LOOP
        PIPE ROW(SUBSTR(p_string, l_out+1, l_pos - l_out));
        l_out := l_pos;
        l_pos := INSTR(p_string, '>', l_out+1);
      END LOOP;
      IF l_out < l_len THEN
        PIPE ROW(SUBSTR(p_string, l_out+1, l_len - l_out));
      END IF;
      RETURN;
    END;
    SELECT *
    FROM TABLE(chopper('abc>def>'))
    COLUMN_VALUE
    abc>
    def>Tak

  • Java Applets and Executing Files

    Hi I have written an applet that pops up when accessing a URL. I am trying to run an executable file from a button press in the applet. The executable is stored localy on my machine but I can not seem to acceess the executable.
    Any Ideas??
    Cheers JJ

    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Robot.html

  • How  applet write file in local system by URL instead of FileOutputStream()

    hi,
    how can applet write a file in local system through URL instead of FileOupStream()
    plz.....plz.....plz......
    URL url = new URL(" file://c:/temp.txt");
    in this url how applet can write
    plz....

    URL uses http to cummunicate, this means you can send and receive data using the http
    protocol.
    The OS doesn't do anything with this, you need a http server to interpret these messages
    and take appropriate action (with server side script or CGI).
    So if the client has a http server installed and has server side script thad does
    something with your http request (that's what a url does) than it is possible.
    Since both having a http server , server side script and or CGI have nothing to do with
    signed applets I will not answer your question here.
    But the mail reason I won't answer it is because it makes no sence to use a URL to write
    to the local file system.

  • Applet write file on coming server without servlet

    Hi, I have an applet that needs to write a new file on the server that's LOADED FROM. Here are my questions:
    1) can the applet write this file WITHOUT using a servlet on the server side?
    2) if it's possible, could someone send me an example to explain how to do it?
    Thanks in advance, have a nice day

    1) can the applet write this file WITHOUT using a
    servlet on the server side?No,it can't. Well, on the server is not necessary to
    have a java servlet but you should have "something"
    that can receive your data, understand it and save it.
    A small PHP script is enough.
    Hope this help

  • Out of memory error when Applet transferring a file of size 600 MB

    Hi ,
    I have an Applet which transfer files from client machine to server using streams.
    I have a servlet which reads data sent from Applet.
    This is working fine when i Transfer files of size 10 MB
    when I chose a file of 600 MB the following error is thrown at Applet side after some time.
    java.lang.OutOfMemoryError: Java heap space
         at java.util.Arrays.copyOf(Unknown Source)
         at java.io.ByteArrayOutputStream.write(Unknown Source)
         at sun.net.www.http.PosterOutputStream.write(Unknown Source)
         at java.io.DataOutputStream.write(Unknown Source)
         at Apple.FileUploadApplet.actionPerformed(FileUploadApplet.java:53)Here is my Applet Code
    if(ae.getSource() == jbutton)
         JFileChooser jfc=new JFileChooser();
         jfc.showOpenDialog(null);
    File f=jfc.getSelectedFile();
    try
    FileInputStream in = new FileInputStream(f);
    byte[] buf=new byte[1024];
    int bytesread = 0;
    String toservlet = "http://9.122.18.115:8080/FileTransfer/FileUpload?"
                                  + URLEncoder.encode("name") + "="
                                  + URLEncoder.encode(f.getName());
    URL servleturl = new URL(toservlet);
    URLConnection servletconnection = servleturl.openConnection();
    //servletconnection.setRequestMethod("GET");
    servletconnection.setRequestProperty("Content-type",
                "application/octet-stream");
    servletconnection.setDoInput(true);
    servletconnection.setDoOutput(true);
    servletconnection.setUseCaches(false);
    servletconnection.setDefaultUseCaches(false);
    DataOutputStream out = new DataOutputStream(servletconnection.getOutputStream ());
    while( (bytesread = in.read( buf )) > -1 )
    out.write( buf, 0, bytesread );
    // out.flush(); // tried this to flush the data but didn't work
    System.out.println("writing data");
    out.flush();
    out.close();
    in.close();
    DataInputStream inputFromClient = new DataInputStream(servletconnection.getInputStream() );
    //get what you want from servlet
    inputFromClient.close();
    catch(Exception e)
    e.printStackTrace();
    }My Servlet Code
    public void doPost(HttpServletRequest req,HttpServletResponse res)
    ServletContext sc = this.getServletContext();
    try
    String path = "C:\\Downloads\\";
    String  fileName=req.getParameter("name");
      System.out.println("name="+fileName);
    File yourFile = new File(path+fileName);
      System.out.println("name="+yourFile);
    FileOutputStream toFile = new FileOutputStream( yourFile );
    DataInputStream fromClient = new DataInputStream( req.getInputStream() );
    byte[] buff = new byte[1024];
    int cnt = 0;
    int k=0;
    long st,et;
    st=System.currentTimeMillis();
    while( (cnt = fromClient.read( buff )) > -1 ) {
    toFile.write( buff, 0, cnt );
    //System.out.println("writing data=="+ k++);
    et=System.currentTimeMillis();
    toFile.flush();
    toFile.close();
    fromClient.close();
    int tt=(int) ((et-st)/1000);
    System.out.println("total time for "+fileName+" Download ="+tt+" secs");
    System.out.println("total time for "+fileName+" Download ="+(tt/60)+" mins");
    catch(Exception e)
    e.printStackTrace();
    }Please Help me out...

    yeah its working fine. Thank you very much..
    But it would be better if we provide the chunklength rather than using a zero to upload the file fastly.

  • Starting Java Applet Slowly

    Hi Folks,
    I have problem with my application.
    user Oracle Developer Suite 10g
    file server use Win XP SP 2.
    sometimes java applet start slowly in several client but quickly in other time.
    sometimes form runs slowly but sometimes very quick.
    in service, report server are started but when user run report to the that report server error "unabled to connect to the report server....".
    What's the solution for my problem ?
    i did re-install oracle developer and win xp but the problem still not solved.
    Thanks in advance...

    Dear Ronald,
    Are the slow and fast clients running against the same middle tier?
    Yes
    Are there hardware differences between the clients? - disks?, graphics cards? processor?
    Software differences on the clients?
    No, all clients same in hardware, disk, graphics cards, processor and software.
    Are the slow/fast clients on different networks?
    Yes.
    for a while when that problem appears, i do restart the form server
    or re-install oracle jinitiator on clients.
    Regards
    Grant Ronald

  • File Adapter Write missing files

    Hello
    I have some trouble with a bpel process containing a file adapter that should write files to disk. Each bpel-process is started when a read file adapter reads a new matching file (*.xml).
    I have tested the process with a few files (5-20) and a new process is started for each file, and at the end of the process a new file is written to disk by the file adapter (Write). But when I am testing with a large number of files (40-50 files) something strange happens.
    A new process is started for each file, but it looks like the file adapter that should write files to disk is not capable to handle the pressure. 10-20% of the processes doesnt complete as expected. In the BPEL Console everything looks ok, it seems like the File Adaper has written a file to disk, no error is trown. But when I look in the directory the file is not there...
    Has this something to do with performance? Is there any parameters or settings I can tune to make the file adapters work better? Sometimes it also looks like the file adapter (read) doesnt manage to start a new process for each incomming file even if they are deleted and archived...

    I ran into a similar issue. As a workaround we ended up just using java to write the files out. When the File Adapter attempts to write out a file it first writes that file to a temp file and then copies that to the appropriate directory.
    I believe that when two or more threads were attempting to write at the same time the write was failing for one (but appearing to work in the console logs). I think a race condition may be created when two threads attempt to write using the File Adapter for access to the temp file. I contacted my oracle rep about it but they are always pretty worthless so I havent ever heard anything back concerning the issue.

Maybe you are looking for

  • PC WILL NOT RECOGNIZE THE bb bOLD 9900

    i bought a new computer with Windows 8 OS. I downloaded the BB desktop manager to be able to sync the PC with the BB Bold 9900. It gives me an error 1723 with the following message. "DLL required could not be run. Action: Repair rim Usb Driver. NT.07

  • Loading a clip in QuickTime Player using a href?

    I know you can do this using the embed tag and target="QuickTimePlayer" but is there a way using HTML or JavaScript to make this simply a href as I want it to just say "Click here to load clip in standalone player". Hope someone can help? Cheers Bruc

  • Reg:Vendor missing in PR

    Hi All, I am facing this issue, After saving the PR document with a vendor in the desired vendor field,the field has no value.What will be the solution for this. With regards Ram

  • Webdynpro and Remote SLD

    Hi ya, I have J2EE engine without SLD installed on my machine where a static Webdynpro is running. For me to connect to a SLD on a different machine to run a complex webdynpro, does any one know the procedures to follow on? Also can anyone help me in

  • Changed settings now its messed up

    Hello...3 days ago I was changing my privacy settings for my FB and some of my apps games I play on FB on my iPhone...I went onto my laptop and into my FB and I wasn't able to even get into some of my games and I couldn't even post anything on my wal