FileInputStream.available() & Thread.dumpStack()

Hello !
Although the copying of text is OK and text is copied correctly from Source.txt to Target but
there are a few things I need hlep with :
1. Is dumpStack() the correct method to get a complete Stack trace in case of an exception.
2. fa.available() is giving zero '0' in class CopyingTxt but is working correctly in the main() giving an actual number of bytes of files size.
God bless you all.
NADEEM.
import java.io.* ;
public class CopyingText {
public static void main(String args[])  { 
Thread t = new Thread();
  try {
   System.out.println("Enter java CopyingText Source.txt Target.txt");
   FileInputStream  a = new FileInputStream(args[0]);
   FileOutputStream b = new FileOutputStream(args[1],true);        
   System.out.println("Source size: " + a.available());
   System.out.println(a.getFD());
    CopyingTxt rw  = new CopyingTxt(a,b);
    rw.fileCopying();
//    rw.bytesAvailable();             Giving IOException: Bad file descriptor : Reason ?
  } catch(Exception e) {
    System.out.println("Exception : main() :" + e );
    t.dumpStack();
class CopyingTxt   {
  private int i  , j  ;
  FileInputStream  fa ;
  FileOutputStream fb ;
  CopyingTxt(FileInputStream a, FileOutputStream b) {
   fa = a ;
   fb = b ;
  public int bytesAvailable() throws IOException {
   System.out.println(fa.getFD());
   System.out.println(fa.available());
   return fa.available() ;
  public void fileCopying() throws IOException {
   do {
    i = fa.read();
    j++ ;                                  
    if(i != -1) fb.write(i) ;
   } while(i != -1);                       //EOF condition  -1 .
   System.out.println("Bytes read : " + (j-1) + " / " + fa.available());
   bytesAvailable();
   fa.close();
//    fa.finalize();
   fb.close();
//    fb.finalize();
}

On the other hand
Thread.dumpStack()
Prints a stack trace of the current thread. This method is used only for debugging.
is meant to get a Thread stacktrace, in case of Exceptions we usually print out:
Throwable.printStackTrace()
Prints this throwable and its backtrace to the standard error stream.
Are you sure you want the Thread stacktrace???
FreeZotic
Just starting with the Thread chapter!
forgive forgive

Similar Messages

  • Collection not in context? java.lang.Exception: java.lang.Thread.dumpStack(Thread.java:1342)

    Hi
    I am using JDev12c. I have an isolated taskflow that is consuming three more taskflow as a region.
    This is the scenario: I have a viewObject showing UserDetails. So I have make a taskflow to show the user details in a form. Now, the userDetalsVO has a ViewLink with itself (Managers having employees under their supervision).
    LoggedInUser (userVO)
         - Employees (userVO)
    I have created the list of employee using the Employees Iterator. However, every time I select an employee the console throw the following error:
    <The row key or row index of a UIXCollection component is being changed outside of the components context. Changing the key or index of a collection when the collection is not currently being visited, invoked on, broadcasting an event or processing a lifecycle method, is not valid. Data corruption and errors may result from this call. Turn on fine level logging for a stack trace of this call. Component ID: {0}>
    java.lang.Exception: Stack trace:
    at java.lang.Thread.dumpStack(Thread.java:1342)
      at org.apache.myfaces.trinidad.component.UIXCollection._verifyComponentInContext(UIXCollection.java:2212)
      at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:524)
      at oracle.adf.view.rich.component.rich.data.RichListView.visitChildren(RichListView.java:112)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at oracle.adf.view.rich.component.fragment.UIXRegion.visitChildren(UIXRegion.java:952)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at oracle.adf.view.rich.component.fragment.UIXRegion.visitChildren(UIXRegion.java:952)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXShowOne.visitTree(UIXShowOne.java:135)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:445)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:423)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:703)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:566)
      at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:362)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._deliverPostRestoreStateEvents(LifecycleImpl.java:852)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._restoreView(LifecycleImpl.java:791)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:397)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:225)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:478)
      at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:478)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:303)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:208)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:225)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3367)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2220)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
    The front end behaves fine though but that error in the console is bugging me.
    Any Ideas??
    Regards

    Well, have you run the app with logging set to fine as the message suggested?
    Turn on fine level logging for a stack trace of this call. Component ID: {0}
    Then a test case and a detailed description on how to reproduce the error, built on the hr  schema, can help.
    Timo

  • Non-static version of java.lang.Thread.dumpstack?

    hi,
    it would be useful sometimes to have a graphical debug panel on an application I'm working on which shows the active threads and allows further information to be shown if wanted - the problem is that I can't find an API call to get the current stack dump of an arbitrary thread - does anyone know if this is possbile somehow without a full debug environment?
    java.lang.Thread.dumpstack would be ideal if only it were an instance method..
    thanks,
    asjf

    what's the probelm? you call this in the threads class
    and each thread (object) executes this statement and
    therefore prints its stacktrace ...ok - here is some mocked up (and plain wrong in terms of the tree model's consistency over sequential method calls) code that shows what I'd like to achieveimport java.io.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    import javax.swing.event.*;
    public class JThreadExp extends JPanel {
       JTree tree;
       JTextArea jta;
       public JThreadExp(TreeModel model) {
          super(new GridLayout(1,2,4,4));
          tree = new JTree(model);
          jta = new JTextArea();
          add(tree);
          add(jta);
          tree.addTreeSelectionListener(new TreeSelectionListener() {
             public void valueChanged(TreeSelectionEvent e) {
                PrintStream stderr = System.err;
                String msg=null;
                try {
                   TreePath tp = e.getPath();
                   System.out.println(tp.getLastPathComponent());
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   PrintStream ps = new PrintStream(new BufferedOutputStream(baos, 1024*1024));
                   System.setErr(ps);
                   Thread t = (Thread) tp.getLastPathComponent();
                   try {
                      t.dumpStack();
                   } catch(Throwable ee) {}
                   ps.close();
                   jta.setText(baos.toString()); //newXML.toString());
                } catch(Exception e2) {
                   msg = e2.getMessage();
                System.setErr(stderr);
                if(msg!=null)
                   System.out.println(msg);
       public static void main(String[]arg) throws Exception {
          JFrame frame = new JFrame("JThreadExp");
          JThreadExp jte;
          final ThreadModel tm = new ThreadModel();
          frame.getContentPane().add(jte = new JThreadExp(tm));
          frame.pack();
          frame.setVisible(true);
          final JTree tree = jte.tree;
          new Thread(new Runnable() {
             public void run() {
                try {
                   while(true) {
                      TreeModelEvent tme = new TreeModelEvent(this, new Object [] {tm.getRoot()});
                      for(Iterator i = tm.listeners.iterator(); i.hasNext(); )
                         ((TreeModelListener) i.next()).treeStructureChanged(tme);
                      Thread.sleep(5000);
                      new Thread(new Runnable() {
                         public void run() {
                            try { Thread.sleep(50000); } catch(Exception e) {e.printStackTrace();}
                      } ).start();
                } catch(Exception e) {
                   e.printStackTrace();
          } ).start();
    class ThreadModel implements TreeModel {
       public boolean isLeaf(Object node) { return (node instanceof Thread); }
       public Object getRoot() {
          ThreadGroup uppermost = Thread.currentThread().getThreadGroup();
          while(uppermost.getParent()!=null)
            uppermost = uppermost.getParent();
          return uppermost;
       public Object getChild(Object p, int i) {
          Object result = "<unavailable>";
          if(p instanceof ThreadGroup) {
             ThreadGroup parent = (ThreadGroup) p;
             ThreadGroup[] tg = new ThreadGroup[parent.activeGroupCount()];
             Thread[] t = new Thread[parent.activeCount()];
             parent.enumerate(tg, false);
             parent.enumerate(t, false);
             if(i<tg.length)
                result = tg;
    else if(i<tg.length+t.length)
    result = t[i-tg.length];
    return result;
    public int getChildCount(Object node) {
    int result = 0;
    if(node instanceof ThreadGroup) {
    ThreadGroup parent = (ThreadGroup) node;
    ThreadGroup[] tg = new ThreadGroup[parent.activeGroupCount()];
    Thread[] t = new Thread[parent.activeCount()];
    result += parent.enumerate(tg, false);
    result += parent.enumerate(t, false);
    return result;
    public int getIndexOfChild(Object parent, Object child) {
    for(int i=0; i<getChildCount(parent); i++) {
    if(getChild(parent,i).equals(child))
    return i;
    return -1;
    Set listeners = new HashSet();
    public void addTreeModelListener(TreeModelListener l) {
    listeners.add(l);
    public void removeTreeModelListener(TreeModelListener l) {
    listeners.remove(l);
    public void valueForPathChanged(TreePath path, Object newValue) { // this shouldn't be called - Tree is not editable
    System.out.println("valueForPathChanged");
    } The problem is that I'd like to obtain a reference to a Thread object (which I haven't written the code for) and get a (vaguely accurate if not exact) stack dump from it.
    I'll have a look over JDB in the meantime thanks :)
    thanks,
    asjf

  • Could anyone tell me what usage of the Thread.dumpStack(); method?

    I am looking the java api , and found one method in the Thread.
    The method is public static void dumpStack().
    and the api description is "Prints a stack trace of the current thread. This method is used only for debugging. " .
    is there anyone to tell me exactly on what situation the method is used.
    it's better that there is a sample to show that.
    i have write a sample program. as following , but i still don't exactly understand the usage of this method.
    code:
    public class ThreadDumpStack {
    public ThreadDumpStack() {
    public static void main(String[] args) {
    ThreadDumpStack threadDumpStack1 = new ThreadDumpStack();
    System.out.println(threadDumpStack1.hello());
    Thread.currentThread().dumpStack();
    System.out.println(threadDumpStack1.string());
    public int hello () {
    int i = 10;
    int j =10;
    return i+j;
    public String string() {
    String a = "hello";
    String b ="world";
    return a + " " + b;
    result:
    java.lang.Exception: Stack trace
         at java.lang.Thread.dumpStack(Thread.java:1071)
         at api.ThreadDumpStack.main(ThreadDumpStack.java:21)
    20
    hello world

    It is for when you have got a large complex application, which is not working (as in running, but returning the wrong value, or getting into an ever lasting loop). You can then use this to work out what your application is doing.

  • JRun Thread Pool Issue

    I'm running CF 9.0.1 on Ubuntu on an "Medium" Amazon EC2 instance. CF has been crashing intermittently (several times per day). At such times, running top gets me this (or something similar):
    PID
    USER
    PR
    NI
    VIRT
    RES
    SHR
    S
    %CPU
    %MEM
    TIME+COMMAND                                                                                                   
    15855
    wwwrun
    20
    0
    1762m
    730m
    20m
    S
    99.3
    19.4
    13:22.96 coldfusion9
    So, it's obviously consuming most of the server resources. The following error has been showing up in my cfserver.log in the leadup to each crash:
    java.lang.RuntimeException: Request timed out waiting for an available thread to run. You may want to consider increasing the number of active threads in the thread pool.
    If I run /opt/coldfusion9/bin/coldfusion status, I get:
    Pg/Sec  DB/Sec  CP/Sec  Reqs  Reqs  Reqs  AvgQ   AvgReq AvgDB  Bytes  Bytes
    Now Hi  Now Hi  Now Hi  Q'ed  Run'g TO'ed Time   Time   Time   In/Sec Out/Sec
    0   0   0   0   -1  -1  150   25    0     0      -1352560      0      0
    In the administrator, under Server Settings > Request Tuning, the setting for Maximum number of simultaneous Template requests is 25. So this makes sense so far. I could just increase the thread pool to cover these sort of load spikes. I could make it 200. (Which I did just now as a test.)
    However, there's also this file /opt/coldfusion9/runtime/servers/coldfusion/SERVER-INF/jrun.xml. And some of the settings in there appear to conflict. For example, it reads:
    <service class="jrunx.scheduler.SchedulerService" name="SchedulerService">
      <attribute name="bindToJNDI">true</attribute>
      <attribute name="activeHandlerThreads">25</attribute>
      <attribute name="maxHandlerThreads">1000</attribute>
      <attribute name="minHandlerThreads">20</attribute>
      <attribute name="threadWaitTimeout">180</attribute>
      <attribute name="timeout">600</attribute>
    </service>
    Which a) has fewer active threads (what does this mean?), and b) has a max threads that exceed the simultaneous request limit set in the admin. So, I'm not sure. Are these independent configs that need to be made to match manually? Or is the jrun.xml file supposed to be written by the CF Admin when changes are made there? Hmm. But maybe this is different because presumably the CF Scheduler should only use a subset of all available threads, right...so we'd always have some threads for real live users. We also have this in there:
    <service class="jrun.servlet.http.WebService" name="WebService">
      <attribute name="port">8500</attribute>
      <attribute name="interface">*</attribute>
      <attribute name="deactivated">true</attribute>
      <attribute name="activeHandlerThreads">200</attribute>
      <attribute name="minHandlerThreads">1</attribute>
      <attribute name="maxHandlerThreads">1000</attribute>
      <attribute name="mapCheck">0</attribute>
      <attribute name="threadWaitTimeout">300</attribute>
      <attribute name="backlog">500</attribute>
      <attribute name="timeout">300</attribute>
    </service>
    This appears to have changed when I changed the CF Admin setting...maybe...but it's the activeHandlerThreads that matches my new maximum simulataneous requests setting...rather than the maxHandlerThreads, which again exceeds it. Finally, we have this:
    <service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService">
      <attribute name="activeHandlerThreads">200</attribute>
      <attribute name="minHandlerThreads">1</attribute>
      <attribute name="maxHandlerThreads">1000</attribute>
      <attribute name="mapCheck">0</attribute>
      <attribute name="threadWaitTimeout">300</attribute>
      <attribute name="backlog">500</attribute>
      <attribute name="deactivated">false</attribute>
      <attribute name="interface">*</attribute>
      <attribute name="port">51800</attribute>
      <attribute name="timeout">300</attribute>
      <attribute name="cacheRealPath">true</attribute>
    </service>
    So, I'm not certain which (if any) of these I should change and what exactly the relationship is between maximum requests and maximum threads. Also, since several of these list the maxHandlerThreads as 1000, I'm wondering if I should just set the maximum simultaneous requests to 1000. There must be some upper limit that depends on available server resources...but I'm not sure what it is and I don't really want to play around with it since it's a production environment.
    I'm not sure if it pertains to this issue at all, but when I run a ps aux | grep coldfusion I get the following:
    wwwrun   15853  0.0  0.0   8704   760 pts/1
    S
    20:22   0:00 /opt/coldfusion9/runtime/bin/coldfusion9 -jar jrun.jar -autorestart -start coldfusion
    wwwrun   15855  5.4 18.2 1678552 701932 pts/1  
    Sl
    20:22   1:38 /opt/coldfusion9/runtime/bin/coldfusion9 -jar jrun.jar -start coldfusion
    There are always these two and never more than these two processes. So there does not appear to be a one-to-one relationship between processes and threads. I recall from an MX 6.1 install I maintained for many years that additional CF processes were visible in the process list. It seemed to me at the time like I had a process for each thread...so either I was wrong or something is quite different in version 9 since it's reporting 25 running requests and only showing these two processes. If a single process can have multiple threads in the background, then I'm given to wonder why I have two processes instead of one...just curious.
    So, anyway, I've been experimenting while composing this post. As noted above I adjusted the maximum simulataneous requests up to 200. I was hoping this would solve my problem, but CF just crashed again (rather it slogged down and requests started timing out...so effectively "crashed"). This time, top looked similar (still consuming more than 99% of the CPU), but CF status looked different:
    Pg/Sec  DB/Sec  CP/Sec  Reqs  Reqs  Reqs  AvgQ   AvgReq AvgDB  Bytes  Bytes
    Now Hi  Now Hi  Now Hi  Q'ed  Run'g TO'ed Time   Time   Time   In/Sec Out/Sec
    0   0   0   0   -1  -1  0     150   0     0      0      0      0      0
    Obviously, since I'd increased the maximum simultaneous requests, it was allowing more requests to run simultaneously...but it was still maxing out the server resources.
    Further experiments (after restarting CF) showed me that the server became unusably slogged after about 30-35 "Reqs Run'g", with all additional requests headed for an inevitible timeout:
    Pg/Sec  DB/Sec  CP/Sec  Reqs  Reqs  Reqs  AvgQ   AvgReq AvgDB  Bytes  Bytes
    Now Hi  Now Hi  Now Hi  Q'ed  Run'g TO'ed Time   Time   Time   In/Sec Out/Sec
    0   0   0   0   -1  -1  0     33    0     0      -492   0      0      0
    So, it's clear that increasing the maximum simultaneous requests has not helped. I guess what it comes down to is this: What is it having such a hard time with? Where are these spikes coming from? Bursts of traffic? On what pages? What requests are running at any given time? I guess I simply need more information to continue troubleshooting. If there are long-running requests, or other issues, I'm not seeing it in the logs (although I do have that option checked in the admin). I need to know which requests exactly are those responsible for these spikes. Any help would be much appreciated. Thanks.
    ~Day

    I really appreciate your help. However, I haven't been able to find the JRun Thread settings you describe above.
    Under Request Tuning, I see:
    Server Settings > Request Tuning
    Request Limits
    Maximum number of simultaneous Template requests
      Restricts the number of simultaneously processed requests. Use this setting to increase overall system performance for heavy load applications. Requests beyond the specified limit are queued. On Standard Edition, you must restart ColdFusion to enable this setting. 
    Maximum number of simultaneous Flash Remoting requests
      The number of Flash Remoting requests that can be processed concurrently.
    Maximum number of simultaneous Web Service requests
      The number of Web Service requests that can be processed concurrently.
    Maximum number of simultaneous CFC function requests
      The number of ColdFusion Component methods that can be processed concurrently via HTTP. This does not affect invocation of CFC methods from within CFML, only methods requested via an HTTP request.
    Tag Limit Settings
    Maximum number of simultaneous Report threads
      The maximum number of ColdFusion reports that can be processed concurrently.
    Maximum number of threads available for CFTHREAD
      The maximum number of threads created by CFTHREAD that will be run concurrently. Threads created by CFTHREAD in excess of this are queued.  On Standard Edition, the maximum limit is 10. 
    And under Java and JVM, I see:
    Server Settings > Java and JVM
        Java and JVM settings control the way ColdFusion starts the Java Virtual Machine when it starts.  You can control settings like what classpaths are used and how memory is allocated as well as add custom command line arguments.  Changing these settings requires restarting ColdFusion.  If you enter an incorrect setting, ColdFusion may not restart properly. 
       Backups of the jvm.config file are created when you hit the submit button. You can use this backup to restore from a critical change. 
       Java Virtual Machine Path
      Specifies the location of the Java Virtual Machine.
       Minimum JVM Heap Size (MB)         Maximum JVM Heap Size  (MB)       
       The Memory Size settings determine the amount of memory that the JVM can use for programs and data. 
       ColdFusion Class Path
      Specifies any additional class paths for the JVM, with multiple directories separated by  commas.
       JVM Arguments
      -server -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib
      Specifies any specific JVM initialization options, separated by spaces.
    I did go take a look at FusionReactor and found it's not free (which would be fine, of course, if it would actually help). It looks like there's a fully functional demo, which is cool...but I've haven't been able to get it to install yet, so we'll see.
    Thanks again!
    ~Day
    (By the way, I've cross-posted this inquiry on StackOverflow. So if you're able to help me arrive at a solution you might want to answer there as well.)

  • Thread management in servlet

    Here is the problem that i am trying to solve - and get better understanding of issues to look out for.
    1) Problem to solve
    Clients sends an http request to an distributor server. The request contains a list of tasks. Each such task can be sent to a particular handling server (out of a known set) which can handle the request. Each task has a task type, which identifies which server the request needs to be passed to. The responses from the handler servers are then to be collected and passed back the client as a consolidated response.
    On the distributor server, the servlet thread that is handling the request will
    a. need to spread the requests for various handling servers
    b. send the requests in parallel to handling servers
    b. get all the responses , consolidate and send back
    2)Proposed solution
    I was thinking of having a thread pool - one thread for each handling server, initialized within servlet . When the distributor server receives a request - the tasks would be spread to these handling threads. The distributor thread would then wait, until the handling threads notify.
    When a notification is received - the distributor thread will need to check if all responses are received. If not - it would need to wait (till a max_timeout) else return the response to client
    3)Questions
    - This involves waiting on the thread created by serlvet container (the distributor thread) and creating a threadpool. Thread creation and management by application in web-container is generally dissuaded - but given this issue - i see no other alternative
    suggestions ? Its been a long email - thanks for considering
    Fred

    How many clients for the entry server do you presume for the application ? I ask this because it is very possible that the server to remain without available threads and give errors. If you use different servers for the final requests I suppose that are some very time consuming processes. What kind of application are running on these servers so that you want to use this kind of distributed computing ?
    Why did you choose as an entry point a servlet container and http request for this kind of problem ? Do you need a graphic response in the browser ? If the response time is too long, the browser (Internet Explorer) will show exception and will not wait for the response (for this you must set some variabiles on client). Also the J2EE server must be set so that not to throw a time-out exception.
    To prevent these, you could do so that not to block the distributor thread and let it send the answer back to the client. Then you can tell to client browser to query the server from time to time to check the status of the execution (you can do that from javascript). When the execution is ready you can retrun the response to the client. Doing this way you will not block the application server threads.
    Now in the back end, you must somehow to take some identificators from the processes and sent them back to the client.
    You can use a database to make the bridge between the central server and the other processes (here you can put the processes identificators). When the processes end up they update their results in the database.
    The client, when will make the repetitive requests, will check the status of the processes in the database with given identificators.
    Sounds like an interesting project.

  • Thread pool

    Hi everybody.
    How can I change the number of threads available in the thread pool in the JRE ?
    Any hint is very welcome.
    Best regards
    Susanne

    Hi.
    No, I mean some settings of the Java Runtime . In a application (byed one) I am getting the following errormessage:
    Java.lang.RuntimeException: "Request timed out waiting for an available thread. You May want to consider increasing the number of active threads in the thread pool."
    JRE is 1.4, Operation System is Solaris 8.
    How I may increase this number of active threads ? Is it an argument to java -Dsomething or is it rather an OS issue ?
    Regards
    Susanne
    Message was edited by:
    SusanneK

  • MDB / threads allocation : doubt

              Hello Tom,
              you wrote that :
              "Remember that an MDB will use up to half+1 of the thread pool."
              Sorry, but I've not understood.
              Do you mean that, if I have one MDB, 12 available threads (considering 3 threads
              for container's activities), I can have a max concurrency of 6+1 MDB executing
              I've implemented a simple MDB with a sleep inside.
              I've sent 12 messages to the destination (queue).
              All 12 threads have been "occupied" by the MDBs (and the 13th message is not processed,
              until one of the 12 MDBs wakes up), and I've not seen this limit (half+1).
              Please can you explain ?
              Thanks in advance
              Sergi
              

              Thanks Tom !
              Sergi
              Tom Barnes <[email protected]> wrote:
              >
              >Sergi Vaz wrote:
              >> Hello Tom,
              >> thanks for the reply.
              >>
              >> I've done my test with 6.1sp4, and I did not see this limit (I've occupied
              >all
              >> threads with MDBs waiting in the default queue).
              >>
              >> I've verified it with a thread dump.
              >>
              >> What have I done wrong ?
              >
              >Nothing. The internal tracking system I consulted
              >stated that the limit was added in SP4, but
              >it didn't make it in until SP5. This time
              >I checked the actual source code. Sorry about
              >the confusion. For now, just set
              >"max-beans-in-free-pool" to limit the concurrency.
              >
              >Tom
              >
              >
              >>
              >> Thanks in advance
              >>
              >> Sergi
              >>
              >>
              >>
              >> Tom Barnes <[email protected]> wrote:
              >>
              >>>Hi Sergi,
              >>>
              >>>It turns out that the "half+1" MDB thread usage
              >>>limit was put in effect in 6.1SP4, 7.0SP1, and 8.1.
              >>>In previous versions, I highly
              >>>recommend setting the MDB's "max-beans-in-free-pool"
              >>>to something reasonably smaller than the default execute thread
              >>>pool size to help prevent possible dead locks.
              >>>
              >>>To provide more control, 7.0SP? and 8.1 allow you to
              >>>specify "dispatch-policy" in the weblogic descriptor xml
              >>>to cause the MDB run in a thread pool you
              >>>have configured. In which case the "half-plus-one"
              >>>limit is not imposed.
              >>>
              >>>Tom
              >>>
              >>>Sergi Vaz wrote:
              >>>
              >>>>Hello Tom,
              >>>>
              >>>>you wrote that :
              >>>>
              >>>>"Remember that an MDB will use up to half+1 of the thread pool."
              >>>>
              >>>>Sorry, but I've not understood.
              >>>>
              >>>>Do you mean that, if I have one MDB, 12 available threads (considering
              >>>
              >>>3 threads
              >>>
              >>>>for container's activities), I can have a max concurrency of 6+1 MDB
              >>>
              >>>executing
              >>>
              >>>>?
              >>>>
              >>>>I've implemented a simple MDB with a sleep inside.
              >>>>I've sent 12 messages to the destination (queue).
              >>>>
              >>>>All 12 threads have been "occupied" by the MDBs (and the 13th message
              >>>
              >>>is not processed,
              >>>
              >>>>until one of the 12 MDBs wakes up), and I've not seen this limit (half+1).
              >>>>
              >>>>Please can you explain ?
              >>>>
              >>>>Thanks in advance
              >>>>
              >>>>Sergi
              >>>>
              >>>>
              >>>>
              >>>
              >>
              >
              

  • Thread problems in Swing

    I'm building I guess its like an online strategy game. On the map, when you move your mouse to within 50 of the bounds of the applet, it'll start scrolling the map at a predetermined speed.
    When working with applets/painting/threads this worked like a dream. Java was too fast for itself and I had to even slow the scrolling down.
    Now, I'm building the whole thing in swing instead. The map is technically a JLabel inside of a Container that gets loaded into the main contentPane.
    The only way I could use setLocation in my threads run method was to setLocation on the Container, not the JLabel. Odd fix to that problem. (I kept getting a null pointed exception otherwise)
    My problem is, when the mouse is in that 50 pixels, the program knows it, but it just /lags/. Horribly. I set a counter to print to the console and when the mouse enters the area it moves to like 15 (in 0.001 seconds), and stops. I move my mouse around, and a few seconds later I see 700-705, then it stops, and jumps ahead again if I move my mouse.
    So my program will now scroll the map in very small, /very/ jagged bits.
    It's not an intensive program or code. I don't see how or why the thread can't continually run it.
    My run method:
    public void run() {
              while (true) {
                   if (mouseX > 650 && mouseX <= 700)
                        moveRight = true;
                            if (moveRight == true) {
                        if (mapCurrentX + screenX < (xDimension)) {
                             mapCurrentX -= moveSpeed;
                             contentPane.setLocation(mapCurrentX, mapCurrentY);
                   try {
                        // Stop thread for 20 milliseconds
                        Thread.sleep(20);
                   catch (InterruptedException ex) {
                        // do nothing
                   Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
         }

    I got this when I ran it ^_^;; Gonna try to fix it
    Wrong Thread
    java.lang.Exception: Stack trace
         at java.lang.Thread.dumpStack(Unknown Source)
         at ThreadCheckingRepaintManager.checkThread(ThreadCheckingRepaintManager.java:13)
         at ThreadCheckingRepaintManager.addInvalidComponent(ThreadCheckingRepaintManager.java:6)
         at map.<init>(map.java:74)
         at ClientMain3.init(ClientMain3.java:12)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

  • Waiting request threads in 6.0 SP2

    we have noticed that in some situations, over time, the number of available request threads will drop, and the number of
    current requests will rise!
    pretty normal stuff, but once in a while they do not return to the waiting request pool, and the the current request
    never seems to go away.
    naturally this could be explained by setting up pages which never return. we stayed always from that!
    requests that never returned. we also managed to avoid that.
    but still over time, some requests never seem to get answered, the request threads never get back to the pool, and
    eventually the number of available threads declines, till there are none.
    is there a reporting mechanism within iPlanet to help diagnose these situations? perhaps giving stackcrawls of all
    current request threads from the kjs at any given time. one option of of course to use -Xrunhprof with the VM to catch
    threads in contention under Solaris. but are there other possibilities?
    iPlanet seems to have a dearth of internal reporting tools.

    You didn't give the specs on the boxes but 300 threads is probably way too
    high. Here's a good rule of thumb:
    NT/1CPU = 14 free exec threads when idle (use ctrl-break to verify)
    NT/2CPU = 28 free exec threads when idle
    SolSparc/2CPU = 48 free exec threads when idle (use kill -3 to verify)
    SolSparc/4CPU = 96 free exec threads when idle
    Note that some exec threads get gobbled by WL itself so after setting the
    value you need to figure out how many you actually have available. For
    example, if you set it to 15 you may end up with only 10 which means your
    expectation is 33% off reality.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Kirk Everett" <[email protected]> wrote in message
    news:[email protected]..
    We are getting out-of-memory errors on solaris using 6.0 SP2. We are
    seeing the heap size just grow and grow at a steady pace as the
    application is stressed tested using load runner. The tests simulate
    only about 30-60 users with a fairly light workload. We've run basically
    the same tests on NT without the memory problems so I'm wondering if it
    has anything to do with our env. We've basically trimed the script to
    do just login/logout and the heap grows to over 600MB in about 2 hours.
    We've poured over our login/logout code and can't find any places where
    we are holding onto memory. Just before the process runs out of memory
    we get a log of full gc messages that take about 30 seconds with no
    significant change in the heap size. Their are 4 instances running with
    a 1GB heap and 300 execute threads each (2 weblogic instances on a
    box). Could the heap size/execute thread be causing problems? I think
    the heap and execute thread size is a bit excessive given there are only
    50 db connections. I'd like to hear anyone's opinion on this problem
    and our settings. Thanks.
    Kirk

  • Regarding Java Thread

    Hi,
    Iam having a problem......
    My work is to process IP address one by one from a LOG file.
    As the log file is very big so iam using Threads to reduce time.
    Like if iam having 77 ip address then iam opening 10 connections
    at a time by 10 thread...and the rest 7 ip are processed one by one..
    But the thing is that when i start to run the application
    the console window(JBILDER console window) goes off and next time it works or may the other time it works...i have to run again and again untill the out put comes............
    if the log file is big then i have to run the application
    2-3 times after than i get the console window stays..and gives the output..
    But if iam not using the threads then the window nevers goes off
    but the time to process is very high..3 hrs to process 100 ip address
    jbuilder console window...
    AppAccelerator(tm) 1.2.010 for Java (JDK 1.2), x86 version.
    Copyright (c) 1997-1999 Inprise Corporation. All Rights Reserved.
    robot.szukacz.pl
    Company Name: 24 GODZINY SP. Z O.O.
    street: UL. GARAZOWA 7
    city: 02-651 WARSZAWA
    location: PL
    handle: nsk241211
    phone: +48.226077884
    Press Ctrl+C to terminate the application...
    here as i run only one single ip so no problem ,
    but i run a big log file 2 mb then this window goes off......
    after trying 2-3 times then the window stays and gives the output..
    thanks..
    so can any one help me...
    Ranjan...
    U can mail me at [email protected]

    Precisely what are you doing with a individual line which causes it to take so long ? If that isn't the result of a algorithm which is inefficient then you could possibly thread that portion out. You'd probably use some sort of thread pool, cause if you had 50000 ips then you'd be spawning 50000 threads. Something like 10-20 threads is ok I guess. So your log file parse gets a line and picks a available thread from the pool, if there is one free, and then send it off to the thread for processing. You need to gurantee that your thread can do it's job in polynomial time(that means in a reasonable amount of time) for this to be effective and consider how the main program is going to communicate with the threads.
    I suggest first taking a look at your algorithm first before embarking on a threading quest (ie look for potential bottlenecks). It's just simpler (IMO) to handle.
    ps. It's quite difficult to read responses in CAPS. Causes eyeaches. :(
    >
    YA YOU ARE RIGHT BUT IF WE GO BY SEQUENTIALLY THEN IT
    WILL TAKE LONG TIME AS TAKE A IP ADDRESS FROM LOG FILE
    AND FIND THE ADDRESS OF THE IP
    LIKE 191.191.19.11 BELONGS TO SOME ONE .WE CAN FIND
    OUT FROM ARIN.NET,
    APNIC.NET OR RIPE.NET...
    I HOPE U UNDERSTAND WHAT I MEAN TO SAY......
    SO TO MAKE THINGS FAST IAM TRYING TO MAKE 10
    CONNECTIONS AND
    EACH THREAD HANDLES ONE CONNECTION.....
    BUT WHEN I RUN FOR THE 1ST TIME THE JBUILDER CONSLOLE
    WINDOW GOES OFF
    AND AFTER TRYING AGAIN IT WORKS.....OR MAY AFTER ONE
    MORE TIME.....
    IF U STILL HAVE SOME DOUBTS THEN ASK ME
    THANKS
    RANJAN

  • Pooling threads

    I know the Doug Lea util.concurrent package, and there is a thread pool implementation. I also know some apps that use thread pools.
    But the Thread class doesn't allow running more than one instance of a runnable... and it's not possible to change the runnable instance in a Thread once it'was created. I think you can run it twice (after it stopped, but never tried).
    So how do you implement a thread pool in java? As far as I know, the Doug Lea's pool creates a new thread every time, it only limits the maximun amount of threads, am I right?

    The trick is to wrap Runnable with another inner Runnable.
    Basically:
    You have a queue, and bunch of threads whose runnables have settable inner runnables.
    1. While a Thread's Runnable's inner runnable is null it waits...
    2. You put a runnable on the queue.
    3. It waits for the next available thread, removes it from the pool, sets it's runnables inner runnable to the one you actually want to run.
    4. Stuff happens...
    5. When the runnable is finished executing your runnable it adds the thread back to the pool.

  • How to override InputStream.available()

    Hi,
    InputStream.available() always returns zero.
    now i have a requirement where I want to know total size of data in an InputStream.
    Note: I don't want to read all the data byte by byte into an byte[] etc etc.
    the reason is that data can be huge and i don't want to keep it in memory.
    Regards
    Apratim

    I'm glad you don't want to keep huge amounts of data in memory but I would consider 512Mb as huge myself.
    To override InputStream.available() all you have to do is override InputStream.available(). But if the information you want isn't available, tough.
    FileInputStream.available() returns the length of the unread portion of the file, although I don't rely on it personally. Various other implementations of available() return zero. For example, SSLSocket.getInputStream().available(), because the stream can't know without decrypting, and it mightn't have an entire cipher block to decrypt, and you wouldn't want it to block getting the rest of the cipher block so it could decrypt so it could tell you how much data was available without blocking, so what else can it do?

  • Weblogic work manager - Control min./max. threads & fair share

    I have an application which is running on Weblogic 10.3.2. I need to be able to control the number of threads the server assigns to this application. The application has 3 MDBs and for each of these MDBs, we need to assign a weight so that that the available threads are distributed among the 3 MDBs according to the weight.
    After going through the Weblogic documentation, it looks like I could create 3 work managers with the min. threads, max. threads and fair share. These work managers could be assigned to each of the MDBs. But, this does not control the total number of threads the server assigns to the application.
    Question:
    Is there a way we can create a work manager with the min. threads and max. threads and assign it to the whole application? This could be used to control the min./max. threads assigned to the application. Then we could define 3 work managers with the fair share and assign them to the individual MDBs.

    Hi ,
    You can create a work manager with min. threads and max. threads constraints defined. Check this:
    http://www.oracle.com/technetwork/articles/entarch/workload-management3-087769.html
    Thanks,
    Sharmela

  • IOException: Not enough storage is available... ?

    Hello,
    I write a tool who can convertes xml data into another kind of data.
    Data will read in by "readLine()" from "BufferedReader" about console.
    When I start my programm in command promt in windows this routine works normally very fine.
    I copy some data, paste it into and my program works. But when I paste to many or to long lines into,
    the program abortes with following error :
    C:\>java Converter
    Insert Data::
    <?xml version="1.0" encoding="UTF-8"?>
    java.io.IOException: Not enough storage is available to process this command
    java.io.IOException: Not enough storage is available to process this command
    at java.io.FileInputStream.available(Native Method)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:282)
    at java.io.FilterInputStream.read(FilterInputStream.java:93)
    at java.io.InputStreamReader.fill(InputStreamReader.java:173)
    at java.io.InputStreamReader.read(InputStreamReader.java:249)
    at java.io.BufferedReader.fill(BufferedReader.java:139)
    at java.io.BufferedReader.readLine(BufferedReader.java:299)
    at java.io.BufferedReader.readLine(BufferedReader.java:362)
    -funnily enough the first line was read
    What is the problem? Is this a problem of Bufferedreader or a problem of my DOS-promt?
    All my research in web wasn't successful. Please try to help me.
    thx

    Hi,
    I have the same problem on WinNT with JDK 1.3.1_06 and JDK 1.4.1_01 .
    To solve the problem I used the following code to read the console:
        private static boolean wasCR  = false;
        private static boolean wasEoF = false;
        private static int readLine(int maxLen, StringBuffer buffer) throws IOException {
            if (wasEoF)
                return -1;
            int len = 0;
            while (len < maxLen) {
                int ch = System.in.read();
                if (ch < 0) {
                    wasEoF = true;
                    if (len == 0)
                        return -1;
                    break;
                } else if (ch == '\r') {
                    wasCR = true;
                    break;
                } else if (ch == '\n') {
                    if (wasCR) {
                        wasCR = false;
                        continue;
                    break;
                wasCR = false;
                buffer.append((char) ch);
                len++;
            return len;
        private static String readLine(int maxLen) throws IOException {
            if (wasEoF)
                return null;
            StringBuffer buffer = new StringBuffer(maxLen);
            return (readLine(maxLen, buffer) >= 0) ? buffer.substring(0) : null;

Maybe you are looking for

  • Question mark (?) where My Boot Camp Applications used to be

    I have just upgraded to Mountain Lion and therefore needed to upgrade my Parallels to version 7.  However on the upgrade to Mountain Lion, the My Boot Applications Folder became a question mark (?) and I was prompted to upgrade to Parallels 7 which I

  • Maintaining the purchase requisition field mandetory for certain PO Doc typ

    Hi, I have tried to maintain the purchase requistion field in PO as mandetory field for certain PO docuemnt types and for transaction code ME21N. I copied the standard fields setting NBF to ZBF and assigned the same to PO docuemnt types as well and i

  • Customize EDI interface

    Hi - I am required to customize an EDI interface, here's what I need to do.. While triggering DELVRY03 Idoc from delivery doc, I need to go to couple of z-tables(X-references) and pick required data (corresponding values) and insert it in Idoc by ove

  • HT1476 do I need a step-down transformer to charge iPhone in Suriname?

    I'm travelling to Suriname,  I have adaptor for round 2 prong Euro-like plugs.  Electricity is 220-240 v.  Do I need transformer step-down when charging my iPhone 4s (OS 5.0) thanks

  • When I download an app ?

    When i download a program or an app how do I open its zip or user file to make it run and save the programs as in windows. And how do I make the app show up iin my dock. This is confusing for a newbie like me to the intriguing mac world.