Unable to read InputStream in Signed Applet when interacting with ISA proxy

Background info:
We have an applet that we use for incremental refresh of data items.
The applet model works for all but one of our customers
Client info:
VeriSIgn signed applet.
IE 6.0 browser
Java JRE version: 1.5.0_06-b05
OS: Windows XP Version 2002 service pack 2
Problem description:
I am consistently getting a premature EOF exception when trying to read from a BufferedInputStream.
The stack trace, if captured ends up in the ChunkedInputStream reader.
I have tried a variety of request header settings to no avail.
Connection: close
Connection: Keep-Alive
etc...
Any comments are welcome
Thanks for reading and considering
Kurt

We are using the HttpURLConnection. If I have to go down the stack to the Socket object, well I guess I have to re event the wheel so to speak.
I have tried both Connection: close and Connection: Keep-Alive. Not at the same time :) but in different intrim releases of test applet.
// Here is the current incarnation of how I am trying to connect.
URL url = new URL(sURL);
trace("attempting to connect to URL: " + sURL, DEBUG);
connection = (HttpURLConnection)url.openConnection();
connection.setDoOutput(true);
connection.setDoInput( true );
connection.setRequestMethod("POST");
connection.setUseCaches( false );
connection.setInstanceFollowRedirects( true );
connection.setAllowUserInteraction( false );
connection.setRequestProperty("Pragma", "no-cache");
connection.setRequestProperty("Expires", "-1");
connection.setRequestProperty("Connection", "Keep-Alive");
connection.connect();
// Now I write our form POST data and flush and close the output stream.
BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream());
bos.write(sForm.getBytes());
          bos.flush();
bos.close();
// Get the input and read
bis = new BufferedInputStream(connection.getInputStream());
trace( "reading input stream for action: " + sAction );
byte[] responseBuffer = new byte[4096];
int bytesRead = 0;
while( (bytesRead = bis.read( responseBuffer, 0, responseBuffer.length )) != -1 )
sbResponse.append( new String( responseBuffer, 0, bytesRead ));
totalBytesRead += bytesRead;
catch (Throwable e)
e.printStackTrace();
try
m_connections.remove( sAction );
connection.disconnect();
catch ( Throwable t ) {}
finally
if ( bis != null )
try
bis.close();
catch( Throwable t ) {}
With the above code in place what I am now seeing, as opposed to a premature EOF exception, is blocking behavior on the read.

Similar Messages

  • How to run java signed applet in vista with changing IE security options

    how to run java signed applet in vista with changing IE security options. If i change the IE security settings to low. it works.
    without changing the security setting, how to run.

    j_nanaji9 wrote:
    how to run java signed applet in vista with changing IE security options. If i change the IE security settings to low. it works.
    without changing the security setting, how to run.Can't be done without changing the security setting.

  • Problems getting Reader (9.4 and up) to interact with WSDL, rights-enabled or not

    Somehow I must be doing something wrong - My form works just fine in Designer,
    Preview, Acrobat Pro, etc as expected. When I open the form in Reader, I am not gett
    ing my data back. I have rights-enabled the form, still no go. Am I mis
    sing something? Any suggestions appreciated!

    Thanks - Adobe is certainly misleading about what & where they are calling
    Reader Extension. Grrr.  Thanks so much for your answer!
    Tabi Freedman
    Developer
    BTS-PAS
    P. 212-919-3135  M. 917-370-7229
    7 Hanover Square H-4-A, New York, NY 10004
    The Guardian Life Insurance Company of America
    GuardianLife.com
    From:   pguerett <[email protected]>
    To:     Tabi M Freedman <[email protected]>
    Date:   07/29/2011 01:42 PM
    Subject:        Problems getting Reader
    (9.4 and up) to interact with WSDL, rights-enabled or not
    Thats your issue .....Acrobat does not add the right to enabe Web Services
    in Reader. That can only be done via LiveCycle Reader Extensions.
    Paul

  • Signed applet not working with weblogic 5.1

    I have a problem with a signed applet. The applet is signed correctly
    and it starts up the dynamic trust management console in java plugin
    1.3.1_02 when accessed locally with the browser. But when trying to
    access the applet through weblogic (5.1) the dynamic trust management
    doesn't popup, as if the applet is not recognized as signed. In the
    weblogic policy file in WLS I have set permissions to include the
    applet class (AllPermission given to codeBase https://-, and file:/-
    to be sure that it's not the problem).
    I have tryed to run it under both http and https. I'm not making an
    rmi connection back to WL. I'm simply trying to write on the local
    file system with the applet.
    The error received in the javaconsole is java.lang.SecurityException:
    java.lang.SecurityException: Unable to create temporary file
         at java.io.File.checkAndCreate(Unknown Source)
         at java.io.File.createTempFile(Unknown Source)
         at java.io.File.createTempFile(Unknown Source)
         at com.primelog.applet.DirectPrintAppletSigned.downloadFileToPrint(DirectPrintAppletSigned.java:64)
         at com.primelog.applet.DirectPrintAppletSigned.run(DirectPrintAppletSigned.java:32)
         at java.lang.Thread.run(Unknown Source)
    I really apreaciate any tips you might have!

    yeah. I noticed the same thing. now the splash screen comes on without the flashing green squares and just hangs. i tried unintalling and then reinstalling and still no go. kind of annoying but they will probably come out with an update pretty soon

  • Signed applet stopped working with 1.4.2_04

    We have a signed applet that accesses the file system. After installing 1.4.2_04 it produces this exception
    java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkExec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at edu.nebraska.foundation.applets.AccessApplet.openNewSession(AccessApplet.java:35)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    java.lang.Exception: java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)This was working in 1.4.2 and 1.3.1_08. Anyone else have this problem?

    When you run this signed applet, turn on the Java console and tracing, you can type 5 in Java console during start up, what is the tracing statements, especial for the security.
    If the jar file has been signed and you see a security dialog box, then you should be able to give all permission to it to run.
    If no security dialog box popup, then JRE think the certificate is bad. no permission will give anyway.

  • SSLSocketFactory proxy fails in Applet when using HTTP(S) proxy

    As part of some security feature of a new eID Applet, available at [http://code.google.com/p/eid-applet/|http://code.google.com/p/eid-applet/] I need to get access to the SSL session identifier. For this I'm using a custom SSLSocketFactory, of which the implementation is available at:
    [AppletSSLSocketFactory.java|http://code.google.com/p/eid-applet/source/browse/trunk/eid-applet-core/src/main/java/be/fedict/eid/applet/AppletSSLSocketFactory.java]
    Basically this custom SSLSocketFactory is delegating every method invocation to the original SSLSocketFactory. The only additional functionality is the readout of the SSL session identifier.
    I install my custom SSLSocketFactory via:
    SSLSocketFactory sslSocketFactory = HttpsURLConnection.getDefaultSSLSocketFactory();
    AppletSSLSocketFactory appletSslSocketFactory = new AppletSSLSocketFactory(sslSocketFactory);
    HttpsURLConnection.setDefaultSSLSocketFactory(appletSslSocketFactory);Now the eID Applet no longer works if I'm sitting behind a proxy server. I get an exception as shown below. Anyone any idea why this is happening? I read somewhere that HttpsURLConnection indeed is using the browser proxy settings. So I would expect that delegating everything to the original SSLSocketFactory wouldn't break anything...
    error: Broken pipe
    error type: java.net.SocketException
    at java.net.SocketOutputStream.socketWrite0:-2
    at java.net.SocketOutputStream.socketWrite:92
    at java.net.SocketOutputStream.write:136
    at com.sun.net.ssl.internal.ssl.OutputRecord.writeBuffer:295
    at com.sun.net.ssl.internal.ssl.OutputRecord.write:284
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecordInternal:734
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord:722
    at com.sun.net.ssl.internal.ssl.Handshaker.sendChangeCipherSpec:606
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.sendChangeCipherAndFinish:868
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverHelloDone:794
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage:226
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop:516
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record:454
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord:884
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord:746
    at com.sun.net.ssl.internal.ssl.AppInputStream.read:75
    at java.io.BufferedInputStream.fill:218
    at java.io.BufferedInputStream.read1:258
    at java.io.BufferedInputStream.read:317
    at sun.net.www.http.HttpClient.parseHTTPHeader:687

    You can get the session after the SSLSocket is fully constructed and connected. That depends on what else your createSocket() method does, but in general doing that just before you return is best.
    However the session is a property of the session, not the socket, or the factory, so the lifetimes are all wrong. The session can survive the SSLSocket, or the other way round. To avoid that I think you should set enableSessionCreation to false on the SSLSocket after the handshake.

  • Problem in Signed Applet while communicating with Javascript

    Hi,
    I’m facing a problem with applet. Applet calls JavaScript methods and vice versa. Applet works fine with JRE 5 to JRE 6 up to build no 1.6.0._7 but it fails with build no 1.6.0_10.
    The problem description is given below:
    After embedding applet in my HTML page using <OBJECT> tag, I’ve to check either any problem during applet’s execution, I want to get the error reason by calling my defined method getErrorReason() in applet that returns the error reason, I call the getErrorReason() against the applet’s object in JavaScript immediately after embed applet code in my HTML page, a JavaScript errors occurs and my applet fails to perform its execution.
    JavaScript error: Object does not support this property.
    The error points to the HTML page area where I’m calling getErrorReason() against applet object.
    The above JavaScript error occurs after the successful completion of Applet’s init(). I’m facing this problem only in JRE 6 build 1.6.0_10-b33.
    Please suggest me any solution.
    Thanks in advance.
    Regards,
    Israr Ahmed

    We are using the HttpURLConnection. If I have to go down the stack to the Socket object, well I guess I have to re event the wheel so to speak.
    I have tried both Connection: close and Connection: Keep-Alive. Not at the same time :) but in different intrim releases of test applet.
    // Here is the current incarnation of how I am trying to connect.
    URL url = new URL(sURL);
    trace("attempting to connect to URL: " + sURL, DEBUG);
    connection = (HttpURLConnection)url.openConnection();
    connection.setDoOutput(true);
    connection.setDoInput( true );
    connection.setRequestMethod("POST");
    connection.setUseCaches( false );
    connection.setInstanceFollowRedirects( true );
    connection.setAllowUserInteraction( false );
    connection.setRequestProperty("Pragma", "no-cache");
    connection.setRequestProperty("Expires", "-1");
    connection.setRequestProperty("Connection", "Keep-Alive");
    connection.connect();
    // Now I write our form POST data and flush and close the output stream.
    BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream());
    bos.write(sForm.getBytes());
              bos.flush();
    bos.close();
    // Get the input and read
    bis = new BufferedInputStream(connection.getInputStream());
    trace( "reading input stream for action: " + sAction );
    byte[] responseBuffer = new byte[4096];
    int bytesRead = 0;
    while( (bytesRead = bis.read( responseBuffer, 0, responseBuffer.length )) != -1 )
    sbResponse.append( new String( responseBuffer, 0, bytesRead ));
    totalBytesRead += bytesRead;
    catch (Throwable e)
    e.printStackTrace();
    try
    m_connections.remove( sAction );
    connection.disconnect();
    catch ( Throwable t ) {}
    finally
    if ( bis != null )
    try
    bis.close();
    catch( Throwable t ) {}
    With the above code in place what I am now seeing, as opposed to a premature EOF exception, is blocking behavior on the read.

  • Help! Every app crashes when interacting with plain text files

    I recently bought a 13" i7 MacBook Air. I love its design and I found OS X Lion unbelievably fast on it, yet I find myself in a very dark situation, now.
    From the Finder to iA Writer, to TextEdit, every single app crashes when working with plain text files. In Finder’s column view I don’t even have to open them: the instant one .txt is selected, Finder crashes.
    Creating a new user account seems to fix the bug for that account, but I just spent one whole day copying files from my old work MacBook (where Lion opened .txt files without a problem) to the new account and losing another entire day of work because of a stupid bug is out of question. Also, I feel it would be a very temporary fix. What if the bug presented itself again? Would I have to create a third, a fourth account, and so on?
    I didn’t use any migration tool because I wanted a very clean installation.
    On top of that, the machine is as App Store–only as one could be. The only “internet” apps I have on it are Chrome (for the occasional Flash video), Movist (I can’t work with Quicktime’s flying controls), and nvALT. I didn’t even had the time to install the Creative Suite on this one. I can’t for the life of me think this is app–related. I suspect it’s some weird OS bug.
    I work in advertising, and I do some work in Adobe’s Creative Suite but *all* my copy is stored in plain text files. I always did it that way so that my files would be future–proof. It is kind of ironic now. So please, if anyone as the slightest idea of how to fix this, please, please, help. I find myself with a brand new computer I can’t use for work.
    Alessandro

    What are the files named?
    Where are they being made? (What folder?)

  • Why is it unable to read URL through Java Applet ?

    I have tried to read an image with ImageIO.read(URL) in JApplet. But it failed to be initialized. Please refer to TEST.java. But if I read the image in MSDOS mode, it works. Please refer to DisplayImage.java. The only difference is Applet and MSDOS mode.
    I am using WindowsXP with j2sdk1.4.1_01 installed.
    //File one: TEST.java
    //Please run in Applet mode
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.applet.*;
    import javax.swing.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.net.*;
    public class TEST extends JApplet
         BufferedImage tempimg;
         public void init()
              try
                   tempimg = ImageIO.read(new URL("http", "www.footprint.org.hk", 80, "/newsphotos/N200301270_0.jpg"));
              catch(MalformedURLException murle){}
              catch(IOException ioe){}
              JFrame f = new JFrame("ImageDisplayer");
              f.setSize(new Dimension(550,350));
              f.setVisible(true);
    //End of TEST.java
    //File two: DisplayImage.java
    //Please run in MSDOS mode
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.applet.*;
    import javax.swing.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.net.*;
    public class DisplayImage extends JApplet
         ImagePanel imagePanel;
         public static void main(String[] args) throws MalformedURLException, IOException
              DisplayImage img = new DisplayImage();
              img.init();
         public void init()
              //Display Image
              try
                   imagePanel = new ImagePanel(ImageIO.read(new URL("http", "www.footprint.org.hk", 80, "/newsphotos/N200301270_0.jpg")));
              catch(MalformedURLException murle){}
              catch(IOException ioe){}
    JFrame f = new JFrame("ImageDisplayer");
              f.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              f.getContentPane().add(imagePanel, BorderLayout.CENTER);
              f.setSize(new Dimension(550,350));
              f.setVisible(true);
    class ImagePanel extends JPanel {
    Image image;
    public ImagePanel(Image image) {
    this.image = image;
    public void paintComponent(Graphics g) {
    super.paintComponent(g); //paint background
    //Draw image at its natural size first.
    g.drawImage(image, 0, 0, this); //85x62 image
    //End of DisplayImage.java

    The security model for applets does not allow them to read from a URL unless it is on the same host the applet was loaded from. If you must do this then you must sign your applet for it to work.

  • I am unable to use the Live View function when working with JavaScript in Dreamweaver.

    I am currently trying to set up my own website with dreamweaver and am very familiar with Java and JavaScript. However, whenever I try to use the Live View function it never lets me. Additionally, I am unable to preview my work in a browser as the option to do so is greyed out.
    However, I have noticed that when using html in a project, all these functions are available. Any ideas how I can be able to use these functions?

    Is it possible you meant to say you were "very unfamiliar with Java and javascript" in your initial post?
    Javascript doesn't do anything without an html page to affect.
    Java and javascript are not the same thing, they're really not even related other than browsers can be made to render both. Java is its own programming language while javascript is basically html's helper monkey. I don't think it's even feasible to "understand javascript" without knowing html. My last post still stands, if you are coding javascript, you need an html based page to turn it into anything but plain code to a browser, so the option to view it will never come up. When you preview the page it's attached to, it will function correctly (as long as it has been attached to the page correctly).
    Java on the other hand can create programs that run without a browser at all and I've never gotten close to touching that monster.
    You may need to explain what you're trying to do and post the code here to get the help you need.

  • Unable to read more than the 1st 8-channels with NI 9205

    First 8 channels only with the 9205 and 9171 sleeve

    amat wrote:
    I connected 12 analog inputs on 9205 and configured in MAX/DAQmx for Differential acquisition.
    I do read the correct values on the 1st 8-channels. on the actual hardware not a simulation.
    I'm using code very similar to "ContAcqGraph Volatage Int clk" example
     I try ai0:7 every thing is correct, when I select ai0:10 , I read only the first 8 and the last 3 are copies of channel 7 even though they are not connected. (Ghosting is another problem)
    However for ai8:10 I read the correct values on the last 3-channels only.
    I also tried in Measurement and Automation 5.3, when I select ai0:7 it works fine, no errors,
    but e.g. ai0:9 I get " error 200077 at Propertty node DAQmx Channel (arg 2) in daqmxcfg_DAQmx Create Channel"
    When you are configuring inputs to differential, the function reads the differential signal between ai0 and ai8, ai1 and ai9, ai2 and ai10 etc.
    In differential mode, the first 8 channels are paired with the next set of 8 channels.
    http://www.ni.com/white-paper/6962/en
    refer the above link for information of how differential mode of configuraiton works.
    If you wish to continue the differential input configuration, you should connect your signals 9 to 12 to the physical channles ai16 onwards.
    Connect the first 8 channels to ai0 to ai7 and the next 4 channels to ai16 onwards,.
    you should for this input configuration if your sensor signals are to read in the differntial mode.
    if you have signals which are to be read with respective to the same ground signal, then configure your input to 'RSE or NRSE'.
    Study the manual for the 9205 module for more details on the hardware connections.

  • Unable to click elements in menu bar when toggling (with alt) from hidden state

    I've put few elements in normally hidden menu bar, like "RSS icon" or "Downloaded files icon". After showing menu bar they look properly (e.g. icons highlight on mouse over), but won't execute action - menu bar will hide upon click on them.
    I've also put search bar there, selecting items from it works properly, after opening select search engine all other elements start to work, yet, after executing an action menu bar won't hide again until some menu is opened and closed. At the moment I'm using FF 5.0, but problem exists in 6.0 as well

    *bug541844(fix with autohide menubar): https://addons.mozilla.org/firefox/addon/bug541844fix-with-autohide-/

  • Google bookmarks asks for sign in when working with opened email

    After opening my Google email, I cannot access my Google bookmarks from the Google toolbar icon. It requests that I sign in. Please respond quickly as I have lost all my websites accessed by saving them in my Google bookmarks folders.

    Google has changed the domain for signing in to accounts.google.com and the Google toolbar is still using the old and longer working www.google.com/accounts domain
    You will have to update that domain yourself by editing a file used by the Google Toolbar.
    *Go to the extension folder in the Firefox profile folder and find the folder with the Google Toolbar
    *Open up lib\toolbar.js with a plain text editor
    *Replace: www.google.com/accounts with accounts.google.com
    You can also access the Google Bookmarks here:
    * http://www.google.com/bookmarks

  • Many Third Party Apps crash when interacting with Finder

    Hi everyone,
    I am having a bit of an issue with OS X Mavericks v10.9.4.
    Lately, whenever I try to do any 'Finder interactions' (Open, Save, etc) with third-party apps like Google Chrome, Brackets, and Photoshop*, it instantly shuts the program down, showing me a Problem Report, which doesn't really help me out, because I can't really understand it.
    *Replicating the error is easy on both Google Chrome and Brackets, but not on Photoshop.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    For this step, the title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    In the top right corner of the Console window, there's a search box labeled Filter. Initially the words "String Matching" are shown in that box. Enter the name of the crashed application or process. For example, if iTunes crashed, you would enter "iTunes" (without the quotes.)
    Each message in the log begins with the date and time when it was entered. Select the messages from the time of the last crash, if any. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    ☞ The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    ☞ Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ User Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of crash reports. The name of each report starts with the name of the process, and ends with ".crash". Select the most recent report related to the process in question. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.
    If you don't see any reports listed, but you know there was a crash, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report—they're very long and rarely helpful.

  • Applet and interaction with html page

    Hi,
    I want to create an applet that send parameter to html page like a <FORM>.
    Can I do this? How?
    thanks

    An applet is Client based, runs inside of HTML page.
    The applet can send data to the server it came from, or to another html page on the SAME server using URLConnection.

Maybe you are looking for