Closing an anonymous stream in method call

Will an anonymous stream in a method call be closed in the same manner an anonymous stream that is created in an object instantiation will be?
I know this will close the anonymous FileInputStream:
DataInputStream in =
new DataInputStream(new FileInputStream("filename.txt"));
/* ... code ... */
in.close();But will this?
MyPropertiesClass myPropertiesClass = new MyPropertiesClass();
myPropertiesClass.store(new FileOutputStream("file.txt"));MyPropertiesClass extends Properties, and uses its store().
I know the JavaDoc for Properties says:
"After the entries have been written, the output stream is flushed. The output stream remains open after this method returns."
My question is will the FileOutputStream("file.txt") be closed and garbage collected eventually after this method call because I don't have a reference to it? myPropertiesClass sticks around for a long time afterwards, will the FileOutputStream as well?
Thanks for any insight,
KJ

My question is will the FileOutputStream("file.txt") be closed and garbage collected eventually after this method call because I don't have a reference to it? > myPropertiesClass sticks around for a long time afterwards, will the FileOutputStream as well?Your only hope would be if FileOutputStream overrode finalize and closed the stream there -- but it doesn't (check the API -- finalize isn't overridden). I doubt if Properties retains a reference to the OutputStream you pass to store -- why would it need to? In any case, the bottom line is that output stream isn't being closed until your process exits.
Why not bite the bullet and rewrite that line of code so that you can explicitly close the stream?
OutputStream out = new FileOutputStream("file.txt");
try {
    myPropertiesClass.store(out);
} finally {
    out.close();
}It's not one line, but who cares? You could wrap it up in a short utility method:
static void storeProperties(Properties properties, String path) {...}

Similar Messages

  • Socket Exception when closing Server Socket Streams if Client closes first

    Hi
    I have 2 processes - a Server socket and a client socket. If I close the Client process first, and then try closing down the Streams on the Server process, I get a SocketException with message "Socket is closed" when I try and close the 2nd Stream. It does not matter on the order of the Stream being closed down, the exception is always thrown when I try and close the second stream. The code snippets are below:
    SERVER =======
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class ServerSocketTest {
    public static void main(String args[]) {
    try {
    ServerSocket ss = new ServerSocket(9999);
    Socket s = ss.accept();
    // Get refs to streams...
    InputStream is = s.getInputStream();
    OutputStream os = s.getOutputStream();
    // sleep to let client shutdown first...
    try {
    Thread.sleep(10000);
    } catch (InterruptedException e) {
    System.err.println(e);
    System.err.println("B4 inClose: isBound=" + s.isBound());
    System.err.println("B4 inClose: isClosed=" + s.isClosed());
    System.err.println("B4 inClose: isConnected=" + s.isConnected());
    System.err.println("B4 inClose: isInputShutdown=" + s.isInputShutdown());
    System.err.println("B4 inClose: isOutputShutdown=" + s.isOutputShutdown());
    s.getInputStream().close();
    System.err.println("After inClose: isBound=" + s.isBound());
    System.err.println("After inClose: isClosed=" + s.isClosed());
    System.err.println("After inClose: isConnected=" + s.isConnected());
    System.err.println("After inClose: isInputShutdown=" + s.isInputShutdown());
    System.err.println("After inClose: isOutputShutdown=" + s.isOutputShutdown());
    s.getOutputStream().close(); // will break here with SocketException!
    System.err.println("After outClose: isBound=" + s.isBound());
    System.err.println("After outClose: isClosed=" + s.isClosed());
    System.err.println("After outClose: isConnected=" + s.isConnected());
    System.err.println("After outClose: isInputShutdown=" + s.isInputShutdown());
    System.err.println("After outClose: isOutputShutdown=" + s.isOutputShutdown());
    s.close();
    } catch (Exception e) {
    System.err.println(e);
    CLIENT ======
    import java.net.Socket;
    public class ClientSocket {
    public static void main(String args[]) {
    try {
    Socket s = new Socket("localhost", 9999);
    try {
    // sleep to leave connection up for a while...
    Thread.sleep(2000);
    } catch (InterruptedException e) {
    System.err.println(e);
    s.close();
    } catch (Exception e) {
    System.err.println(e);
    The debug shows that isClosed() is set to 'true' after the first call to s.getInputStream().close(). The Sun API Socket class getOutputStream() has a call to isClosed() at the start of the method - it then throws the SocketException that I get. Why does the SocketImpl do this before I get a chance to call a.getOutputStream().close()?
    One final thing, the calls to s.isInputShutdown() and s.isOuputShutdown always seem to return false even if the Streams have had their .close() method called.
    Any ideas/help here greatly appreciated.
    Thanks
    Gaz

    Ok, I know what's going on now - I needed something to do on Friday afternoon anyhow!
    Basically if you call either getOutputStream.close() or getInputStream().close(), the underlying Sun implementation will close the Socket.
    Here's what's happening under the covers in the Sun code:
    s.getInputStream() is called on the Socket class.
    The Socket class holds a reference to the SocketImpl class.
    The SocketImpl class is abstract and forces sublclasses to extend it' s getInputStream() method.
    The PlainSocketImpl extends SocketImpl.
    PlainSocketImpl has a getInputStream() method that returns a SocketInputStream. When the stream is created for the first time, the PlainSocketImpl object is passed into the Constructor.
    The SocketInputStream class has a close() method on it. The snippet of code below shows how the socket is closed:
    <pre>
    * Closes the stream.
    private boolean closing = false;
    public void close() throws IOException {
         // Prevent recursion. See BugId 4484411
         if (closing)
         return;
         closing = true;
         if (socket != null) {
         if (!socket.isClosed())
              socket.close();
         } else
         impl.close();
         closing = false;
    </pre>
    So, it seems that out PlainSocketImpl is getting closed for us, hence the SocketException being thrown in Socket.getOutputStream() when I call it after Socket.getInputStream()/
    I've not had a look at the reason why the calls to s.isInputShutdown() and s.isOuputShutdown always seem to return false even if the Streams have had their .close() method called though - any thoughts appreciated.
    Thanks
    G

  • Lead to Oppy Method call or Workflow

    Hi All,
    When shall we use the option of method call and workflow for automatic creation of Oppt from lead.
    We can use method call and also workflow for  it. but whats the pros and cons of these two methods.when do we use what.
    Sanjana

    Hi Sanjana
    The correct (and customizable) way to do so is to use the so-called post processing framework (PPF), which exists in CRM only. In transaction sppfcadm you can define an action profile with an action which calls a COPY_DOCUMENT and passes as a parameter the opportunity process type. You then have to define a start condition (e.g. qualification status = hot) and a planning condition (e.g. status = closed) and then it runs automatically.
    Please also have a look at the existing examples for the opportunity sales methodology, in standard customizing there is something similar set up between activities and opportunities.
    Regards, Kai

  • Retrieving client identity during method call

    Hy,
    I have written an RMI application wich uses JSSE with client authentication. I would like to get the client Identity (Certificate information) each time the client perform a method call.
    Can anybody help me?

    This is rather complicated but it can be done. You need:
    1. an RMIServerSocketFactory which returns
    2. a wrapper ServerSocket implementation around a real ServerSocket, which delegates everything to the real ServerSocket except for the accept method, which does the delegation but then wraps the result in
    3. a wrapper Socket implementation around the real Socket which delegates everything to the real Socket
    except getInputStream, which does the delegation but then wraps the result in
    4. a wrapper InputStream implementation around the real InputStream, which delegates everything to the real input stream but which registers the underlying Socket (the delegate, not your wrapper) in a ThreadLocal when any read method is called.
    Are you with me so far? ;-)
    The registered Socket will really be an SSLSocket. Now, inside your remote method implementation, you can do threadLocal.get() to get the SSLSocket associated with the current client (because you're in the same thread as in (4), because the socket is actually read for the first time in the method despatching thread. You can now do SSLSocket.getSession() and get hold of the client certificates.
    Sample of (2) to get you started:
    public class WrappedServerSocket extends ServerSocket
    SSLServerSocket serverSocket;
    public WrappedServerSocket(int port) throws IOException
    { this.serverSocket = SSLServerSocketFactory.createServerSocket(port); }
    public Socket accept() throws IOException
      Socket socket = serverSocket.accept();
      return new WrappedSocket(socket);
    // all other methods should delegate to serverSocket
    }EJP

  • Read method calls from a file.

    I am working on an event driven program that has various events listed in a file that are supposed to be read in and used. I can go through the pain staking process of using StringTokenizer and .substring to figure which event is which, but I want to know if there would be an easier process of reading in the events. (Can't Cast them)
    Any suggestions?
    Shawn

    Hi Again
    U can go for StreamTokenizer in java.io
    this is useful for tokenizing a Stream based on delimiters
    It has Two Cons for both Type of Streams either Char or Bin
    public java.io.StreamTokenizer(java.io.InputStream);
    public java.io.StreamTokenizer(java.io.Reader);
    The StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time. The parsing process is controlled by a table and a number of flags that can be set to various states. The stream tokenizer can recognize identifiers, numbers, quoted strings, and various comment styles.
    U hav to invoke a method called nextToken Form which u will get a token which can be compared to find wether it is a word or character ....using the constanrs avlbl in StreamTokenizer class
    TT_WORD indicates that the token is a word.
    TT_NUMBER indicates that the token is a number.
    TT_EOL indicates that the end of line has been read. The field can only have this value if the eolIsSignificant method has been called with the argument true.
    TT_EOF indicates that the end of the input stream has been reached
    Alll the Very Best
    Rgds
    Sriram

  • Please help on how to use variables inside a method call

    Hello guys,
    How's it goin?
    Pardon me if you find my question silly, but I am relatively
    new in ActionScript 2.0 programming.
    I have here a simple problem. It seems I can't use a variable
    inside a method call of an object. Here's the code. Please note of
    the authParams string variable below.
    import AkamaiConnection;
    import mx.services.WebService;
    var GeneratedToken:String;
    var authParams:String;
    // Create a Web Service object
    var TokGenService:WebService = new WebService("
    http://webservice.asmx?wsdl");
    // Call the web service method
    var myToken:Object = TokGenService.GenerateToken();
    // Create an AkamaiConnection object
    var connection:AkamaiConnection = new AkamaiConnection();
    connection.addEventListener("onConnect", this);
    connection.addEventListener("onError", this);
    // If you get a result from the web service, save the result
    in a variable
    myToken.onResult = function(result)
    // If you get a result from the web service, save the result
    in a variable
    myToken.onResult = function(result)
    GeneratedToken = result;
    authParams = GeneratedToken +
    "&aifp=v001&slist=37414/test/Streaming/";
    //Call the Connect method of the AkamaiConnection class
    connection.connect("cp37414.edgefcs.net/ondemand",true,true,5,true,false,"443","rtmpt",
    authParams);
    But then, if I use a hard-coded string value in lieu of the
    variable, the method call works!
    connection.connect("cp37414.edgefcs.net/ondemand",true,true,5,true,false,"443","rtmpt",
    "testStringvalue");
    I don't know what I'm missing or what I'm doing wrong... Can
    somebody help me please? I am using a 30-day trial version of Adobe
    Flash CS3. Also, when I Trace output the variables, the values are
    there. It just that they can't be read or recognize inside the
    method call. Is this a ActionScript limitation?
    Thanks so much in advance!

    The result param is a returned, “Decoded ActionScript
    object version of the XML”. I am not exactly sure what that
    means but I have had issues of returned XML values and their
    datatype. When I did have these issues I had to cast or convert
    into the desired datatype. Try one of the following, assuming the
    problem is related to the code that you have bolded.
    GeneratedToken = result.toString();
    authParams = GeneratedToken +
    "&aifp=v001&slist=37414/test/Streaming/";
    Or
    GeneratedToken = String(result);
    authParams = GeneratedToken +
    "&aifp=v001&slist=37414/test/Streaming/";
    Or
    GeneratedToken = result.toString();
    authParams = String(GeneratedToken +
    "&aifp=v001&slist=37414/test/Streaming/");

  • Logging method calls

    Hi all!
    I'm working on a complex java system and have problems debugging it. One of the problems is, that sometimes the program stops with a NullPointerException. Unfortunately this happens in third party code, which I do not have as source. However, I'm sure that the bug is caused by a module developed by my as exchanging this module with another implementation stops the problem.
    Is there an easy way to generate a list of method calls for an entire run of a program? At the time the exception is raised, none of my methods remains in the call stack, i.e. the exception is triggered by the foreign code, but probably caused by a value returned earlier from one of my methods. I would therefore like to see what methods have been called before the exception is triggered.
    I'm currently working with JBuilder 6. It offers a debugger, but this debugger is terrible slow and very bad when the code that is to debug is not available. You could set a method breakpoint for every method I have implemented, but this would take ages. Even with only one such exception defined, the programm takes several minutes in debug mode, while it usually takes only a fraction of a second. This seems to be completely unworkable. Another thing I have tried was the built-in profiler of the JVM, but it shows results in an aggregated and messy way, not much of a help either.
    Any better tools/techniques out there?
    Thanx in advance,
    Mathias

    A method for writing to a log file is not a problem, but I would need to add at least one line of code for every
    of my methods and, more important, a meaningful log message like the method name and arguments.
    One of the reasons I decided not to implement this, was the impossibility to determine the name or signature
    of the current method automatically.Below the code I wrote for my dissertation project. I assert my authorship and copyright of this code, and hereby grant anyone who wants it permission to reproduce this and to create derivatives. It determines the name of the current method automatically, and runs under Java 1.1 (Microsoft machine - I think the Sun machine dislikes using null as the argument for the StringStream constructor, but I wasn't worried about fixing that so haven't investigated too closely). The Tracer.enter() method appends the method name and "{" to the log file. It's proof of concept - I may write an improved version after my exams. Comments cut short to avoid annoying people who don't want to scroll too far.
    import java.io.*;
    public abstract class Tracer
        static File trace_file;
        static FileWriter fw;
        static final int METHOD = 0;
        static final int FLOW = 2;
        static final int MAJOR = 4;
        static final int MINOR = 6;
        static final int trace_level = 7;
        /* Params:    IN  filename    - a String containing the desired name for */
        /*                              the trace file.                          */
        public static void open(String filename)
            try
                trace_file = new File(filename);
                fw = new FileWriter(trace_file);
            catch (IOException ioe)
                System.out.println("IOException in Tracer.open()");  
        /* Params:    IN  s           - the String containing the trace message  */
        /*            IN  level       - the level of detail of the message       */
        /* Operation: If the specified level is sufficiently low, this method    */
        /*            constructs a Throwable and processes its stack trace to    */
        /*            find the name of the method which called trace.  It then   */
        /*            writes this method name and the trace message to the trace */
        /*            file, terminating the line with a Microsoft EOL (LF-CR).   */
        private static void trace(String s, int level)
            if (level <= trace_level)
                StringStream stringStream = new StringStream(null);
                Throwable bomb = new Throwable();
                bomb.printStackTrace(stringStream);
                String method = stringStream.getMethod();
                try
                    fw.write(method+"  "+s + "\015\012");
                    fw.flush();
                catch (IOException ioe)
                    System.out.println("IOException in Tracer.trace()");  
        /* Operation: Closes the FileWriter and sets the File and FileWriter to  */
        /*            null.                                                      */
        public static void close()
            try
                fw.close();
            catch (IOException ioe)
                System.out.println("IOException in Tracer.close()");  
            trace_file = null;
            fw = null;
        /* Operation: Calls trace with message "{" and trace level METHOD.  This */
        /*                method should be called whenever a method is entered.  */
        public static void enter(String method)
            trace("{", METHOD);
        /* Operation: Calls trace with message "}" and trace level METHOD.  This */
        /*            method should be called just before any return statement,  */
        /*            or before the final } of a method with return type void.   */
        public static void exit()
            trace("}", METHOD);
        /* Params:    IN  flow_statement                                         */
        /*                            - a description of the branch just taken   */
        /* Operation: Calls trace with message flow_statement and trace level    */
        /*            FLOW.  NB This method should be called at the start of any */
        /*            block except a method body, when enter should be called.   */
        public static void flow(String flow_statement)
            trace(flow_statement, FLOW);  
        /* Operation: Calls trace with message major_statement and trace level   */
        /*            MAJOR.  This method should be used for displaying the      */
        /*            results of important steps.                                */
        public static void major(String major_statement)
            trace(major_statement, MAJOR);
        /* Operation: Calls trace with message minor_statement and trace level   */
        /*            MINOR.  This method should be used for displaying the      */
        /*            results of minor steps.  It would probably be overkill to  */
        /*            call minor after every single statement.                   */
        public static void minor(String minor_statement)
            trace(minor_statement, MINOR);
    import java.io.*;
    /* This class, which extends PrintStream, exists to allow me to get the   */
    /* name of the method invoking trace by creating a Throwable and          */
    /* examining its stack trace.  This is more reliable than tracking the    */
    /* stack myself.                                                          */
    class StringStream extends PrintStream
        StringBuffer sb = new StringBuffer();
        int state = 0;
        public StringStream(OutputStream out)
            super(out);
        public StringStream(OutputStream out,
                            boolean autoFlush)
            super(out, autoFlush);
        String getMethod()
            String return_value = sb.toString();
            sb = new StringBuffer();
            state = 0;
            return return_value;
        public void print(char[] chars)
            for (int j = 0; j < chars.length; j++)
                print(chars[j]);
        public void print(char ch)
            switch (state)
                case 0:
                case 1:
                case 2:
                    if (ch == '\t')
                        state++;
                    break;
                case 3:
                    if (ch == ' ')
                        state++;
                    break;
                case 4:
                    if (ch == ' ')
                        state++;
                    else if (ch == '/')
                        sb.append('.');
                    else
                        sb.append(ch);
                    break;
                default:
                    // do nothing
    }

  • "Application authentication required. Incorrect method call." on server start with Queues

    Hi people!
    I am using a message-driven EJB listening on a queue.
    Everytime a start the server, the server deploys the enterprise
    application with the MDB and the queue, and then gives this error
    message:
    "Application authentication required. Incorrect method call."
    What am I missing?
    Here are more details: The server is in fact CFMX6.1 in
    standalone installation and I am using the hidden JRun inside it.
    Here is an extract of ejb-jar.xml:
    <message-driven>
    <ejb-name>ij.portal.EventExecutor</ejb-name>
    <ejb-class>ij.portal.EventExecutor</ejb-class>
    <transaction-type>Container</transaction-type>
    <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
    <message-driven-destination>
    <!--javax.jms.Queue or javax.jms.Topic-->
    <destination-type>javax.jms.Queue</destination-type>
    <!--Durable or NonDurable-->
    <subscription-durability>Durable</subscription-durability>
    </message-driven-destination>
    <!--
    The queue that this MDB listens to. The name must be mapped
    to
    a real JNDI name in jrun-ejb-jar.xml.
    -->
    <resource-env-ref>
    <resource-env-ref-name>EventQueue</resource-env-ref-name>
    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
    </resource-env-ref>
    </message-driven>
    A part of the jrun-ejb-jar.xml is:
    <message-driven>
    <ejb-name>ij.portal.EventExecutor</ejb-name>
    <jndi-name>ij.portal.EventExecutor</jndi-name>
    <resource-env-ref>
    <resource-env-ref-name>EventQueue</resource-env-ref-name>
    <jndi-name>jms/queue/EventQueue</jndi-name>
    <mdb-destination>jms/queue/EventQueue</mdb-destination>
    </resource-env-ref>
    <message-driven-subscription>
    <client-id>MDBSubscriber</client-id>
    </message-driven-subscription>
    </message-driven>
    Finally, here is the jrun-resources.xml that defines the
    queue:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    <!DOCTYPE jrun-resources PUBLIC "-//Macromedia Inc.//DTD
    jrun-resources 4.0//EN"
    http://jrun.macromedia.com/dtds/jrun-resources.dtd">
    -->
    <jrun-resources>
    <jms-destination>
    <jndi-name>jms/queue/EventQueue</jndi-name>
    <destination-name>EventQueue</destination-name>
    <destination-type>javax.jms.Queue</destination-type>
    </jms-destination>
    <jms-connection-factory>
    <!-- jms provider factory name. Optional-->
    <factory-name>QueueConnectionFactory</factory-name>
    <!-- jndi name - name under wich this connection factory
    will be available -->
    <!-- to client in jndi. Required. -->
    <jndi-name>jms/jndi-QueueConnectionFactory</jndi-name>
    <!-- connection factory type (required ifno -->
    <!-- can be one of the -->
    <!-- following: -->
    <!-- javax.jms.QueueConnectionFactory, -->
    <!-- javax.jms.XAQueueConnectionFactory, -->
    <!-- javax.jms.TopicConnectionFactory -->
    <!-- javax.jms.XATopicConnectionFactory -->
    <type>javax.jms.QueueConnectionFactory</type>
    <!-- jms transport (rmi, tcpip, rmiiiopi, intravm).
    -->
    <!-- Required if no factory name was specified. -->
    <transport>RMI</transport>
    <!-- userName and password required if seamless
    authorization will be used -->
    <!-- (can be specified and updated, upon application
    deployment via resorce-ref) -->
    <username>guest</username>
    <password>guest</password>
    </jms-connection-factory>
    <!-- MDB specifc connection factory - utilizes intra vm
    connection, cannot be used by remote client -->
    <jms-connection-factory>
    <!-- jms provider factory name. Optional-->
    <factory-name>MDBQueueConnectionFactory</factory-name>
    <!-- jndi name - name under wich this connection factory
    will be available -->
    <!-- to client in jndi. Required. -->
    <jndi-name>jms/jndi-MDBQueueConnectionFactory</jndi-name>
    <!-- connection factory type (required ifno -->
    <!-- can be one of the -->
    <!-- following: -->
    <!-- javax.jms.QueueConnectionFactory, -->
    <!-- javax.jms.XAQueueConnectionFactory, -->
    <!-- javax.jms.TopicConnectionFactory -->
    <!-- javax.jms.XATopicConnectionFactory -->
    <type>javax.jms.QueueConnectionFactory</type>
    <!-- jms transport (rmi, tcpip, rmiiiopi, intravm).
    -->
    <!-- Required if no factory name was specified. -->
    <transport>INTRAVM</transport>
    <!-- username and password required if seamless
    authorization will be used -->
    <!-- (can be specified and updated, upon application
    deployment via resorce-ref) -->
    <username>guest</username>
    <password>guest</password>
    </jms-connection-factory>
    </jrun-resources>
    What am I doing wrong? I should add that the queue and the
    MDB actually work. I just want to get rid of the error message.
    I have found out that the error message comes from the class
    jrun.jms.wrapper.enterprise.JRunConnectionFactoryWrapper, method
    createQueueConnection, when instance variable m_useContainerAuth is
    false.

    I dont think you should it on server-side - you can do it in client side logic. Start playing live stream - if no data is coming - i think you can use ns.time for checking this - then switch to recorded file play.

  • Rmi method call timeout

    i was wondering if there was any way to timeout a rmi method call.
    the situation i had was that a client would envoke an rmi method, and
    the method would deadlock in weblogic. the client making the call will
    hang forever.
    thanks

    Thank you for this enlightening addition. I regret I failed to perceive
    earlier that your comments were to be interpreted as evidence of sincere
    commitment to solving this problem.
    Regarding 7.0, you'll note that I described the timeout attribute solution
    as "improving stability" rather than as a complete cure. It should be borne
    bear in mind that this is an alternative to a completely locked system. When
    stress tested, this change did allow the application to recover and run for
    the rest of the day.
    I'm obliged to you for your concern regarding any liability I might be
    incurring in relation to the BEA licensing agreement. Fortunately I think I
    may be able to put your mind at rest on this matter relatively easily. If I
    may direct your attention to the BEA support site, my experience is that on
    entering the search terms "rmi descriptor timeout", the relevant information
    will be revealed. Also, I suspect that, as a fellow engineer, it has not
    escaped your attention that the RMI descriptor is a valid XML document. As
    such, it has a DTD named "rmi.dtd" which (alas) also fails to conceal this
    attribute.
    While we're pursuing what has now become a gratifyingly productive vein,
    let's offer another possible approach to this issue, namely the use of
    per-VM timeouts for socket calls. These were introduced in the Sun JDK 1.4.1
    and so are available to people running WebLogic 8.1 today. Again these
    suggestions have been tested for basic socket I/O (I haven't tried RMI). To
    my knowledge these are not endorsed by BEA:
    For client connections, timeouts can be set globally by passing the
    following startup parameters to the JVM:
    sun.net.client.defaultConnectTimeout (default: -1)
    sun.net.client.defaultReadTimeout (default: -1)
    sun.net.client.defaultConnectTimeout specifies the timeout (in milliseconds)
    to establish the connection to the host.
    sun.net.client.defaultReadTimeout specifies the timeout (in milliseconds)
    when reading from input stream when a connection is established to a
    resource.
    (reference: Sun's Networking Properties documentation at
    http://java.sun.com/j2se/1.4.1/docs/guide/net/properties.html )
    Supplying non-default values for these properties should allow a server to
    recover from a blocked downstream system if socket I/O is being used.
    Regards
    Alex
    On Fri, 30 Jan 2004 09:02:23 -0800, Andy Piper <[email protected]>
    wrote:
    Alex Thomas <[email protected]> writes:
    Hardly a constructive response to what is clearly a significant problem.
    First, it should be obvious that this issue will be encountered in any
    distributed system using T3 or RMI, not because of any shortcoming in
    WebLogic services but because of blocking behaviour in downstream systems.That's why it is a new feature in 9.0. I'm not arguing that the
    use-case is invalid, simply that your suggestion should not be tried.
    Second, the solution I proposed has been tested (on 7.0SP1) and does improve
    overall stability, as other people here have apparently discovered.Tested by who? Not by us because we know there are significant,
    dangerous, problems with the approach you describe. Support are
    under strict instructions not to offer this as a solution to
    anyone. If anyone in BEA told you, they shouldn't have. If you
    discovered it by decompiling the code then you are in violation of
    your license agreement.
    There is a supported mechanism for timing out connect attempts in 7.0
    and later which you can get through support, but for timing out RMI
    calls you will have to wait until 9.0 (or cook up a business case for
    a backport).
    Hope this clears things up.
    andy

  • Taskflow Method call receiving null parameter.

    Hi all,
    I am using 11.1.1.6. I have created in my application an extra project which is pure Java objects and exposed a master class as a POJO DC. In my application, I have a taskflow where I have dragged and dropped one method from my POJO DC - 2 of the parameters of this methods are coming from an application scope bean. I have debugged the application, and made sure that the object being returned by the getter of my app scope bean is not null. So basically, when the breakpoint is in the return statement of my getter the oject is not null and it has been correctly initialized. Just after that, the next breakpoint is in the class receiving the parameter in my POJO DC class. In there, the object is NULL.
    Does anyone knows wat could be the reason??

    Hi Frank Nimphius-Oracle,
    That is precisely the problem.  The object is being passed as to the taskflow as an input parameter (getting it from my application scope bean). If I access the pageFlowScope inside my taskflow I see it and its there, correctely intialized. However, when I call a method call activity that consumes that object as parameter, all what it gets is null.
    The method that consumes this object is in a separate project, and its exposed in a POJO DC. I don't know if it has to be with the complexity of the object I am passing or what but I don't understand why its not being passed correctly to the DC Method.

  • Using a dynamic variable in the Import command of a Method call

    Hi,
    I am trying to make a Method call fully dynamic.
    I have found out how to make the Method name dynamic, but I am having trouble figuring out how to make the Importing statement dynamic.
    in my code below:
          CALL METHOD o_main->(v_call)
            IMPORTING
              it_ekko = i_ekko.
    I would like to know if it's possible to make both "it_ekko" AND "i_ekko" dynamic so I can use this same call for various tables.
    Hope that makes sense...thanks for your help.
    Andy

    Hi Andrew,
    The method call is fully dynamic; not only the parameters can be specified dynamically but also the method name.
    This is a help extract:
    DATA: line     TYPE c LENGTH 80,
          text_tab LIKE STANDARD TABLE OF line,
          filename TYPE string,
          filetype TYPE c LENGTH 10,
          fleng    TYPE i.
    DATA: meth  TYPE string,
          class TYPE string,
          ptab TYPE abap_parmbind_tab,
          ptab_line TYPE abap_parmbind,
          etab TYPE abap_excpbind_tab,
          etab_line TYPE abap_excpbind.
    DATA: exc_ref TYPE REF TO cx_sy_dyn_call_error,
          exc_text TYPE string.
    class    = 'CL_GUI_FRONTEND_SERVICES'.
    meth     = 'GUI_DOWNLOAD'.
    filename = 'c:\temp\text.txt'.
    filetype = 'ASC'.
    ptab_line-name = 'FILENAME'.
    ptab_line-kind = cl_abap_objectdescr=>exporting.
    GET REFERENCE OF filename INTO ptab_line-value.
    INSERT ptab_line INTO TABLE ptab.
    ptab_line-name = 'FILETYPE'.
    ptab_line-kind = cl_abap_objectdescr=>exporting.
    GET REFERENCE OF filetype INTO ptab_line-value.
    INSERT ptab_line INTO TABLE ptab.
    ptab_line-name = 'DATA_TAB'.
    ptab_line-kind = cl_abap_objectdescr=>changing.
    GET REFERENCE OF text_tab INTO ptab_line-value.
    INSERT ptab_line INTO TABLE ptab.
    ptab_line-name = 'FILELENGTH'.
    ptab_line-kind = cl_abap_objectdescr=>importing.
    GET REFERENCE OF fleng INTO ptab_line-value.
    INSERT ptab_line INTO TABLE ptab.
    etab_line-name = 'OTHERS'.
    etab_line-value = 4.
    INSERT etab_line INTO TABLE etab.
    TRY.
        CALL METHOD (class)=>(meth)
          PARAMETER-TABLE
            ptab
          EXCEPTION-TABLE
            etab.
        CASE sy-subrc.
          WHEN 1.
        ENDCASE.
      CATCH cx_sy_dyn_call_error INTO exc_ref.
        exc_text = exc_ref->get_text( ).
        MESSAGE exc_text TYPE 'I'.
    ENDTRY.
    BR,
    Valentin

  • Error on /SafeMode: error while trying to run project uncaught exception thrown by method called

    i try run VS 2012 with /SafeMode. I create new empty Winform. When I start debug, I got:
    "error while trying to run project uncaught exception thrown by method called through reflection"

    Hi Matanya Zac,
    Did you restart your machine? How about installing the VS2012 update 4?
    >>error while trying to run project uncaught exception thrown by method
    Did you install the VS update in your VS IDE? I met this issue before which was related to the VS update:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/5ead8ee9-ea09-4060-88b0-ee2e2044ff82/error-while-trying-to-run-a-project-uncaught-exception-thrown-by-method-called-through-reflection?forum=vsdebug
    If still no help, I suggest you repair your VS, and then restart your machine, test the result.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • AcquireConnection method call to the connection manager Excel connection Manager failed

    I used VS Studio 2008 (BIDS version 10.50.2500.0) on an WinXp machine (v 5.1.2600 SP3 Build 2600) to create a package that writes multiple query results to different tabbed sheets of a single excel spreadsheet. The package was working just fine and has run
    successfully multiple times, but all of a sudden when opening the project, every single Data Flow task with an Excel Connection Manager displayed error icons. Each raises the following error message when attempting to open the Advanced Editor:
    SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005 Description: "Unspecified error". Error at DataFlow task name: SSIS error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method
    call to the connection manager Excel connection Manager failed with error code 0xC0202009. There may be error messages posted before this with more information on why the Acquire Connection method call failed. Exception from HRESULT: 0Xc020801c (Microsoft.SQlServer.DTSPipelineWrap)
    From the time I created the original package (when it worked fine) until now:
     1) I have been using the same computer, the same login account and the same permissions.
     2) I have been writing to the same (32 bit) 2010 Excel file (which I created) in a folder on my local machine.
     3) The filename and location have not changed; a template file is used each time to move and overwrite the previous file. Both are in the same locations.
     4) I can independently open the target Excel file and the template Excel files with no errors.
     6) The ConnectionString has not changed. The Connnection String I am using is
      Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Conversion\Conversion\Results_dt01.xlsx;Extended Properties="EXCEL 12.0 XML;HDR=YES;".
     7) Run64BitRuntime is set to False.
    8)  Delay Validation is set to true
    9) This is not running under a SQL job  
    10) There are no child packages being run
    I CAN create a NEW Excel Connection Manager, assigning it the exact same target Excel spreadsheet, successfully, but when I attempt to assign it to the Data Flow destination this error occurs:
    "Test connection failed because of an error in initializing provider. Unspecified error."
    Thinking that the driver might be corrupt, I opened a second SSIS package, which also uses the Excel Connection Manager (same driver) and this package continues to work fine on the same workstation with no errors.
    I have searched online for causes of this error for many hours and found nothing that helps me to solve this issue.
    Does anyone have any suggestions for me?

    Yes, I have verified that the Excel file is not in use or opened by anyone, including me. It has been two months since I opened this particular package, although I have been working with other packages in this project. I just discovered that another
    package in the same project has the same problem - all Data Flows that output to an Excel Destination now have the same error icons. This second packages outputs to an entirely different Excel file than in the first package.  A summay:
    Package #1 has error on every Excel Destination and uses templateA to overwrite fileA and then writes to fileA
    Package #2 has error on every Excel Desintation and uses templateB to overwrite fileB and then writes to fileB
    Package #3 has no error on any Excel Destination and is linked to multiple files (none are A or B)
    Package #1 and #2 are in the same project, but Package #3 is in a separate project .
    I will try replacing the Excel files with new ones for Package 1 and 2.

  • [Load data from excel file [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messa

    Error
    [Load data from excel file [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There
    may be error message
    I am using BIDS Microsoft Visual Studio 2008 and running the package to load the data from excel .
    My machine has 32 bit excel hence have set property to RUN64BITRUNTIME AS FALSE.
    But the error still occurs .
    I checked on Google and  many have used Delay validation property at Data flow task level to true but even using it at both excel connection manager and DFT level it doesnt work
    Mudassar

    Thats my connection string
    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\SrcData\Feeds\Utilization.xlsx;Extended Properties="Excel 12.0;HDR=NO";
    Excel 2010 installed and its 32 bit edition
    Are you referring to install this component -AccessDatabaseEngine_x64.exe?
    http://www.microsoft.com/en-us/download/details.aspx?id=13255
    Mudassar
    You can try an OLEDB provider in that case
    see
    http://dataintegrity.wordpress.com/2009/10/16/xlsx/
    you might need to download and install ms access redistributable
    http://www.microsoft.com/en-in/download/details.aspx?id=13255
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • What are the methods called while navigating from one applet to another one

    Hi All,
    Could any one brief me about "When you navigate from one applet to another what are the methods called ?".
    Thanks in advance.
    Best Regards,
    N.Madhusudhanan.

    http://forum.java.sun.com/thread.jsp?forum=421&thread=426771&tstart=0&trange=100

Maybe you are looking for

  • How to create a form that requires thousands of checkboxes?

    Hello forum members, I have Adobe Acrobat 8 Professional.  I've been searching the internet/forums for the past few hours and I can't seem to find any information on how to create a form with many checkboxes.  I do not want to have to give individual

  • DVD plays well on some machines, gets stuck on others

    Made a 20-minute DVD, having done all my editing, etc. in iMovie and exported to iDVD5. Once burned, tested it on my iMac and it worked fine. Also worked fine in a friend's stand-alone DVD player. But some users since have this problem: the DVD plays

  • Power converter and non-Apple Adapters

    I am traveling to London and Paris next month. Do I actually need the power brick or can I use an adapter with USB cable? I am traveling with two iphones, and two cameras. I expect to have very few outlets. Also has anyone used these non apple adapte

  • ISE has no updates for SEP 12.1.x

    Hi all, i am trying to test posture with clients that have Symantec Endpoint Protection 12.1.x installed and it appears when I try and include that version of Symantec in the Posture Condition, that particular version is not fully up to date. Yet the

  • TS1277 Authorizing itunes with windows 8 can?

    I am trying to authorize itunes on my new windows 8 device and these is no option to authorize on the store drop down menu. Help