WebLogic writes to a text file and an applet reads the text file

Hi there,
I need some help here!
I have an applet that needs to read from a text file:
final URL prtDataURL = new URL("http://" + getCodeBase().getHost() + ":" + getCodeBase().getPort() + "/ESTC/lib/prtDataFile.txt");
            final URLConnection urlConn = prtDataURL.openConnection();
            urlConn.setUseCaches(false);
            urlConn.setDoInput(true);
            urlConn.setDoOutput(false);
            final InputStreamReader is = new InputStreamReader(urlConn.getInputStream());
            final BufferedReader in = new BufferedReader(is);
            String inputLine;
            while ((inputLine = in.readLine()) != null){
                String[] tmp = inputLine.split("§");
                this.dateTime = tmp[0];
                this.quanTot = Integer.parseInt(tmp[1]);
                this.quanSco = Integer.parseInt(tmp[2]);
                this.quanSef = Integer.parseInt(tmp[3]);
                this.valTot = Double.parseDouble(tmp[4]);
                this.valSco = Double.parseDouble(tmp[5]);
                this.valSef = Double.parseDouble(tmp[6]);
            in.close();
            is.close();and this is ok.
Now I have the web server (WebLogic) that must write, at regular time intervals, to that file (prtDataFile.txt). The web application writes to the file (which belongs to the application).
I've tried open the file with the File object but since the war file is unexploded I can't get the real path!
I've tried open an url connection,
final URL url = new URL("http://10.191.33.249:16801/ESTC/lib/prtDataFile.txt");
final URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.setUseCaches(false);
connection.setDoInput(false);
OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());
out.write(currentDate + "§" + quantTot + "§" + quantSco + "§" + quantSef + "§" + valTot + "§" + valSco + "§" + valSef);;
out.flush();
out.close();which seems a little stupid since I'm opening an URLConnection to the same place where the application is. Anyway it doesn't work, i.e., it doesn't write to the file but it doesn't gives me any errors or exceptions.
Is there another way to get this two pieces communicating?
Thanks in advance

I have almost the exact same problem, and I am in the same situation as you are with respects to the language.
I am simply trying to create a file and output some garbage to it but my applet always spits back a security violation. I've tried eliminating the restrictions on the applet runner I use but I still get the error.
My method:
debug = new Label() ;
debug.setLocation( 20, 20 ) ;
debug.setSize( 500, 15 ) ;
add( debug ) ;
// output
try
     OutputStream file = new FileOutputStream( new File( "" + getCodeBase() + "output.txt" ) ) ;
     byte[] buffer = { 1, 2, 3, 4, 5 } ;
     file.write( buffer ) ;
     file.close() ;
} catch( Exception e )
     debug.setText( e.toString() ) ;
     Can anyone tell why this isnt working?

Similar Messages

  • I have written a binary file with a specific header format in LABVIEW 8.6 and tried to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I have written a binary file with a specific header format in LABVIEW 8.6 and tried  to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I can think of two possible stumbling blocks:
    What are your 8.6 options for "byte order" and "prepend array or string size"?
    Overall, many file IO functions have changed with LabVIEW 8.0, so there might not be an exact 1:1 code conversion. You might need to make some modifications. For example, in 7.1, you should use "write file", the "binary file VIs" are special purpose (I16 or SGL). What is your data type?
    LabVIEW Champion . Do more with less code and in less time .

  • HT1491 I purchased a year subscription for Huffington Post Magazine $19.99 and when I go to the Newsstand and try to read the latest issue it tells me I have to pay $0.99?

    I purchased a year subscription for Huffington Post Magazine $19.99 and when I go to the Newsstand and try to read the latest issue it tells me I have to pay $0.99?

    They are only free via the account orginally purchased or if they came pre installed on the computer. Depending on what you have purchased already us the one account for the app store - saves headace and hassel in the future thus not double buying software. Do you have iwork installed on your imac? meaning the iwork 09? if you do your should be able to to to the store and update it. Worked fine for me since i bought the DVD version of iwork 09 and Aperture 3. I did not want to have to rebuy them so the app store noticed i had them installed and changed the update via the app store.

  • I got an itunes card and you cannot read the card

    I was trying to use the itunes card and I cannot read the card
    I can give the GCA card:

    Help here.  iTunes Store: Invalid, inactive, or illegible codes
    Apple Gift Cards - FAQ's

  • I downloaded illustrator and can't read the taskbar items - too tiny. Help!

    i downloaded illustrator and can't read the taskbar items - too tiny. Help! zoom doesn't work- it's grayed out. control key and mouse wheel doesn't work. Please help no tech support for the next 2 days. I am a member of the creative cloud and have yet to be able to use any of this software!

    Be more precise and tell us the exact details. If you have issues with items being too small, your graphics settings and all that are critical, don't you think? Sorry, but just saying you're on some HP laptop with Win 7 is not helpful. Follow the instructions to obtain exact system info:
    Working with your Operating System’s Tools
    Also provide a fullscreen screenshot, if possible.
    Mylenium

  • Powershell script - how to read a registry hive and store the value in text file and then again read the text file to write the values back in registry

    Hi All,
    powershell script Method required to read a value from registry and then taking the backup of that values in some text file.
    For example the hive is
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path
    and under path i need to take back up  of values in some text file and then put some value in the registry after back is taken in text file.
    Also how to read the text file values so that we can again write to registry hive  back from the back up text file.
    Your help is much appreciated.
    Umeed4u

    I think you need to read this first:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • I can't open hotmail. After I write my e-mail addres and password becomes frozen the windows page log in.

    Recently I installed firefox in my MacBook Pro. When I need to open hotmail page log in to check my e-mails sometimes I can reach the page others time is frozen don't go through. Others time I reach the page log in through google search but when I am on the log in page, I write down my email address and password press log in or click enter but nothing hapen.

    Hi edquijano-
    If you are having trouble logging in, I would recommend going through this Support article on the topic:
    [[Cannot log in to websites]]
    Hope that helps!

  • BDC or BAPI for me01 and me02 please read the requirement below

    Hi Experts
    I am having one requirement ,that
    I need to write a BDC program for Source list
    My alt file is having 3 filed with
    matnr werks lifnr
    if the material no and werks are same and the lifnr is not existing then it has to add the new vendor with the material and werks to the source list
    if matnr  werks and lifnr are not existing then need to create a new source list
    flat file
    10000001 4200 0230000000
    10000001 4200 0230000000
    10000001 4200 0230000000
    10000001 4200 0230000001
    10000002 4210 0230000002
    see in this flat file I'm having two diffrent vendors
    suppose in eord table existing
    matnr , werks,lifnr
    10000001   4200 0230000000
    so nw it has to check for whether vendor is existing or not if existing nothing to do if not then it has to add the new vendor
    if matnr werks and lifnr or not existing then it has to create new source list       
    means create the vendor
    Is there any BAPI or any sample prog is thr    please provide me
    WILL GIVE YOU POINTS IMMEDIATELY
    Thanks in advance

    Hi
    You can search in SDN for regarding Table Control and also go through the below links:
    Here are some of the links
    Re: Handling The Table Control while working with BDC
    Re: how do we handle BDC table control
    Re: how to create bdc with table control
    Regards,
    Vishwa.

  • No music in iTunes library and it wont read the content of my iPod? Help please!

    So I recently updated to iTunes 10.7 and when I did, all of the content in the iTunes library was gone! i have tried many different things to get it to work, like restoring to a previous iTunes library, but it appears that all the previous iTunes libraries were also deleted when I updated! If there is no other way to get the music back than finding the original files and putting them into iTunes, I guess that will be ok.
    The second problem I am having is that when ever I try to sync my iPod it takes a very long time to load, and then it says that iTunes can't read the content of my iPod and that I should restore to the factory settings, but because there is no music or apps in my iTunes library I dont want to do that, because then I will have no way of getting all of my content back on. And I can't restore to a previous backup because it wont read it as my iPod, it just comes up as an unkown iPod. This is very frustrating and I have tried everything I can think of. Please help!

    Try:
    - Reset the iPod. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Try another cable and another USB port
    - Reboot the computer.
    - See if you can find the media by:
    - See if a third-party progtam like one of those discussed here will allow you to get the music off the iPod
    newer copy
    - I think you may end up restoring the iPod.

  • [Solved]Pacman can't find steam(and yes I read the other topics)

    To make it short, pacman really can't find steam.
    Options I tried:
    pacman -S steam
    pacman -Sy steam
    pacman -Syyu steam
    pacman -Ss steam
    And still got nothing.
    Here's my last attempt at it:
    $ sudo pacman -Syyu steam
    :: Synchronizing package databases...
    core                     112.7 KiB  49.9K/s 00:02 [######################] 100%
    extra                   1763.0 KiB  30.5K/s 00:58 [######################] 100%
    community                  2.3 MiB  74.2K/s 00:31 [######################] 100%
    error: target not found: steam
    Notes: I'm running arch on a VBox. Sorry if I sound cocky or anything but maybe it's my lack of sleep over this particular problem. Yes, I uncommented the multilib repo in pacman.conf.
    Anyone got any ideas?
    Last edited by Jackoz530 (2014-08-11 14:20:02)

    lucke wrote:Maybe you have failed to uncomment the multilib repo properly, as your output doesn't show its synchronizing.
    This worked for me. Found steam in the multilib repo when I properly uncommented the repo.
    Though it's weird that steam can't be found in the community repo, only in the multilib repo.
    $ pacman -Ss steam
    multilib/steam 1.0.0.48-1
    Digital distribution client bootstrap package
    Pacman.conf is as follows:
    # /etc/pacman.conf
    # See the pacman.conf(5) manpage for option and repository directives
    # GENERAL OPTIONS
    [options]
    # The following paths are commented out with their default values listed.
    # If you wish to use different paths, uncomment and update the paths.
    #RootDir = /
    #DBPath = /var/lib/pacman/
    #CacheDir = /var/cache/pacman/pkg/
    #LogFile = /var/log/pacman.log
    #GPGDir = /etc/pacman.d/gnupg/
    HoldPkg = pacman glibc
    #XferCommand = /usr/bin/curl -C - -f %u > %o
    #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
    #CleanMethod = KeepInstalled
    #UseDelta = 0.7
    Architecture = auto
    # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
    #IgnorePkg =
    #IgnoreGroup =
    #NoUpgrade =
    #NoExtract =
    # Misc options
    #UseSyslog
    #Color
    #TotalDownload
    CheckSpace
    #VerbosePkgLists
    # By default, pacman accepts packages signed by keys that its local keyring
    # trusts (see pacman-key and its man page), as well as unsigned packages.
    SigLevel = Required DatabaseOptional
    LocalFileSigLevel = Optional
    #RemoteFileSigLevel = Required
    # NOTE: You must run `pacman-key --init` before first using pacman; the local
    # keyring can then be populated with the keys of all official Arch Linux
    # packagers with `pacman-key --populate archlinux`.
    # REPOSITORIES
    # - can be defined here or included from another file
    # - pacman will search repositories in the order defined here
    # - local/custom mirrors can be added here or in separate files
    # - repositories listed first will take precedence when packages
    # have identical names, regardless of version number
    # - URLs will have $repo replaced by the name of the current repo
    # - URLs will have $arch replaced by the name of the architecture
    # Repository entries are of the format:
    # [repo-name]
    # Server = ServerName
    # Include = IncludePath
    # The header [repo-name] is crucial - it must be present and
    # uncommented to enable the repo.
    # The testing repositories are disabled by default. To enable, uncomment the
    # repo name header and Include lines. You can add preferred servers immediately
    # after the header, and they will be used before the default mirrors.
    #[testing]
    #Include = /etc/pacman.d/mirrorlist
    [core]
    Include = /etc/pacman.d/mirrorlist
    [extra]
    Include = /etc/pacman.d/mirrorlist
    #[community-testing]
    #Include = /etc/pacman.d/mirrorlist
    [community]
    Include = /etc/pacman.d/mirrorlist
    # If you want to run 32 bit applications on your x86_64 system,
    # enable the multilib repositories as required here.
    #[multilib-testing]
    #Include = /etc/pacman.d/mirrorlist
    [multilib]
    Include = /etc/pacman.d/mirrorlist
    # An example of a custom package repository. See the pacman manpage for
    # tips on creating your own repositories.
    #[custom]
    #SigLevel = Optional TrustAll
    #Server = file:///home/custompkgs
    I'm currently grabbing the steam in the multilib repo and gonna test it once I finished grabbing it.

  • Performace and how to read the plan

    Hi all, i am having some problem with a query. i cannot really read the explain plan. here it is
    VIEW of "LOT" #4 (Cost=559,177 Card=35,277,895 bytes=30,868,158,125)
      UNION-ALL
         HASH JOIN (Cost=558,852 Card=34,981,759 bytes=9,794,892,520)
            TABLE ACCESS (FULL) of "ENT" #27 Optimizer=ANALYZED (Cost=13 Card=6,214 bytes=267,202)
            HASH JOIN (Cost=541,331 Card=34,981,759 bytes=8,290,676,883)
               TABLE ACCESS (FULL) of "SMASTER" #28 Optimizer=ANALYZED (Cost=573 Card=282,970 bytes=17,261,170)
               HASH JOIN (Cost=459,945 Card=34,981,759 bytes=6,156,789,584)
               INLIST ITERATOR
                   TABLE ACCESS (BY INDEX ROWID) of "INTERFACES" #29 Optimizer=ANALYZED (Cost=2 Card=5 bytes=100)
                       INDEX (RANGE SCAN) of "INTERFACES_INDX1" UNIQUE Optimizer=ANALYZED (Cost=1 Card=1 bytes=)
               HASH JOIN (Cost=457,468 Card=153,919,741 bytes=24,011,479,596)
               TABLE ACCESS (FULL) of "POS" #25 Optimizer=ANALYZED (Cost=1,819 Card=5,756,878 bytes=132,408,194)
               TABLE ACCESS (FULL) of "L_POS" #26 Optimizer=ANALYZED (Cost=179,932 Card=153,840,627 bytes=20,460,803,391)
      TABLE ACCESS (FULL) of "HOLD" #31 Optimizer=ANALYZED (Cost=325 Card=296,136 bytes=40,866,768)can somebody tell me what is happening. what steps gets executed first then next and next, etc? it looks like the cost is a lot and this is hurting the performance.
    i know tuning involved a lot such as stats, index use, # of rows, etc.
    what i am looking for here is how to read the plan, any idea what this is doing? please explain. also any recommendation to improve the plan base on the plan above. thanks

    A quick search in google for oracle reading explain plan
    Top hits are very nice writeups...
    http://www.akadia.com/services/ora_interpreting_explain_plan.html
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm
    vr,
    Sudhakar B.

  • I have a neslab chiller and want to read the temperature by sending ASCII characters and graph the results, any advice?

    I am having difficulty having the chiller recognize (RT[CR]) which is the signal recognized by the chiller to read the temperature. The signal that is returned is (xxx.xx[CR]) which is the temperature. I am attempting to be able to read the temperature and graph this vs time and possibly be able to change the setpoint as well from the UIR.

    I agree with Randy that Hyperterminal is a good starting point to test cabling and communication.
    In your program, be careful to serial port initialization (how to set baud rate, parity, data bits and stop bits depends on the language used) and to termination character ([CR] means Carriage return: if you are usng CVI it DOESN'T add CR to the message unless you esplicitly put it in).
    Another interesting point is the time the instrument takes to respond to the message: it can vary from message to message and is usually described in the instrument's documentation. If you test for a shorter time, you catch a false 'no response'. You could make a while loop and test in it the number of bytes received, then decide whether to end the loop for timeout or answer recei
    ved...
    To continue help you, we need some details of your developing environment (CVI or LabVIEW?) and of problems you are having at present.
    Hope to hear you soon
    Roberto
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • I have an itunes gift card for $25 and I accidentally scratched it off too hard and i cannot read the numbers and letters

    It says to scratch off the gray part on the back with a nickel, so I did. When I was scratching it off, I must of scratched too hard because I cannot read the first 5 letters and numbers...any suggestions?? Please HELP!
    Thanks!

    iTunes Store: Invalid, inactive, or illegible codes

  • HT1199 I judge my judgments, was written on Wordoffice 2007 on the system used to windos7 and Apple cant Read the job on the 2012 Word of Apple

    I judge my judgments, was written on Word office 2007 on the system used to windos7 and Apple cant Read my judgments on the 2012 Wordoffice of Apple

    Try these 3 possible solutions:
    1. Restart iPad
    Hold down the Sleep/Wake button until the red slider appears. Slide your finger across the slider to turn off iPad. To turn iPad back on, hold down the Sleep/Wake until the Apple logo appears.
    2. Close inactive Apps
    Double-click the Home button; hold Apps down (in the Task Bar) for a second or two until you see the minus sign. Tap and close all inactive Apps.
    3. Reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Ignore the red slider.

  • Problems with and tags while reading the xml file

    Hi
    I am using the xml files in my project. The project uses Tomcat, JMS. The project is divided into some components which communicate with each oher thru JMS. The component for which I am responsible gets a dcoument object from the JMS which is a processed xml of the following format (the processing is done by the DBMS_XMLGEN package of oracle)
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <filename>157_1000000001</filename>
    <querydata>
    <tabdata>
    <tabinfo>Tab-id3</tabinfo>
    <queryset>
    <query name="Fax">
    select a.ARLN_NAME,d.TICKETED_ORIGIN,d.TICKETED_DESTINATION, d.ENDORSEMENTS,to_char(d.DATE_OF_ISSUE,'DDMONYY') as DATE_OF_ISSUE ,d.EXCHANGE_DOC_TYPE,
                   d.PASSENGER_NAME,d.ORIG_ISS_AIRLINE,d.ORIG_DOC_NO,d.ORIG_PLACE_OF_ISSUE,
                   to_char(d.ORIG_DATE_OF_ISSUE,'DDMONYY'),d.ORIG_ISSUE_AGENT,d.CUR_OF_SALE,d.GROSS_FARE,d.EQUIV_CUR_OF_SALE,d.EQUIV_FARE,
                   d.PANDA_DEAL_CODE,d.ISI,d.reporting_date
                   from airline_master a,ticket_main d,ticket_conj e where d.doc_no = e.doc_no and d.iss_airline = e.iss_airline
                   and e.conj_doc_no = (select DOC_NO from TICKET_CONJ where CONJ_DOC_NO = 1000000001 and ISS_AIRLINE = 157)
                   and e.ISS_AIRLINE = 157 and d.iss_airline = a.ARLN_NUM_CODE
    </query>
    </queryset>
    </tabdata>
    </querydata>
    the function on my side is like this
    private void processMessage(ObjectMessage objmessage)
         Document XMLreqObject = (Document) objmessage.getObject();
         Element root = XMLreqObject.getRootElement();                
         String resultFilename = root.getChildText("filename");
         Element tabSet = root.getChild("querydata");//doesnt work
         ArrayList tabSetlist = new ArrayList(tabSet.getChildren ("tabdata"));//doesnt work
    The code commented with "doesnt work", is not working. What must be the problem ?
    Thanks in Advance
    Martin

    Okay. Your original example XML didn't include < or > which was rather confusing if that particular feature was supposed to be the cause of the problem. Also calling them "tags" was rather confusing since "tags" is the term for the things that come at the beginning and of an element, like this:<data>...</data>Anyway, I assume your theory is that documents that don't have < in a text element process correctly and documents that do have < in a text element get "stuck" in the parser? Well, from your original description the process appears to be:
    1. Create XML
    2. Parse it into a Document
    3. Send the Document via JMS
    4. Receive the Document via JMS
    5. Process it.
    And it's step 4 that is "stuck"? That would be my guess based on the code you posted.

Maybe you are looking for