Socket reading: hanging when using java, but OK when using javaw

Tested and experienced on:
Windows 2000 Workstation, Windows XP SP1
jdk build 1.4.1_02-b06, build 1.4.2_04-b04
My app is a GUI application. I am creating a socket like this:
Socket socket = new Socket();
socket.connect(new InetSocketAddress(proxy_host, Integer.parseInt(proxy_port)), 8000);
BufferedReader in =
  new BufferedReader(
  new InputStreamReader(socket.getInputStream()));
PrintWriter out =
  new PrintWriter(
   new BufferedWriter(
    new OutputStreamWriter(socket.getOutputStream())),true);
String request = "GET url HTTP/1.1\r\n" +
                 "Accept: *\r\n" +
                 "Host: host\r\n" +
                 "Cookie: " + sessionCookie + "\r\n" +
                 "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; YComp 5.0.0.0)" + "\r\n" +
                 "Content-type: application/x-www-form-urlencoded" + "\r\n\r\n";
out.print(request);
out.flush();
String str = "";
while((str = in.readLine()) != null)
socket.close();I am reading a HTML document from server. If I use the call
java -jar MyJar.jar
the reading starts hanging by reading the list line of the document. By call
javaw -jar MyJar.jar
all is fine. What could be the problem. I am really perplexed!

Sounds like perhaps a timing issue. But a bigger issue is why aren't you simply using the higher-level java.net.URL, HttpURLConnection classes? You're reinventing the wheel here by writing low-level socket calls with HTTP protocol strings.

Similar Messages

  • Latest Reader Hangs when opening any pdf with 'tools' selected

    Any pdf will hang when opened in the latest Acrobat Reader (Either from file or open Acrobar Reader first.)
    However if I first open Reader and turn off the tools (Tools top right) I can then open any pdf without problems.
    Users who want to have the tools bar open are querying this.
    Can anyone help.
    Windows 7 64 bit systems.

    Try disabling Protected Mode [Edit | Preferences | Security (Enhanced)].

  • Sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loop

    sir i have given lot of effort but i am not able to solve my problem either with notifiers or with occurence fn,probably i do not know how to use these synchronisation tools.

    sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loopHi Sam,
    I want to pass along a couple of tips that will get you more and better response on this list.
    1) There is an un-written rule that says more "stars" is better than just one star. Giving a one star rating will probably eliminate that responder from individuals that are willing to anser your question.
    2) If someone gives you an answer that meets your needs, reply to that answer and say that it worked.
    3) If someone suggests that you look at an example, DO IT! LV comes with a wonderful set of examples that demonstate almost all of the core functionality of LV. Familiarity with all of the LV examples will get you through about 80% of the Certified LabVIEW Developer exam.
    4) If you have a question first search the examples for something tha
    t may help you. If you can not find an example that is exactly what you want, find one that is close and post a question along the lines of "I want to do something similar to example X, how can I modify it to do Y".
    5) Some of the greatest LabVIEW minds offer there services and advice for free on this exchange. If you treat them good, they can get you through almost every challenge that can be encountered in LV.
    6) If English is not your native language, post your question in the language you favor. There is probably someone around that can help. "We're big, we're bad, we're international!"
    Trying to help,
    Welcome to the forum!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Pdf file designed using IREPORT tool. when i preview in adobe reader bold fonts displaying correctly,but same file in mozilla adobe plugin displays fonts unbold

    I have designed a report using IReport tool with some text as BOLD, which generates report in PDF format. when i open the file with Adobe Reader IX it opens perfectly.
    but the problem is when i open the same file in mozilla add-on "Adobe Reader 11.0.3.37" and in previous versions it does not displaying the bold fonts.

    Is there a non-confidential example of this PDF that we could view?

  • I have used Pages 09 and Keynote without any major problems until this new update. I have read many of the fixes but have a problem. When you get Pages 09 and Keynote back, Apples continues to want to update the 09 system. So it stays updated.

    I have used Pages 09 and Keynote without any major problems until this new update. I have read many of the fixes but have a problem. When you get Pages 09 and Keynote back, Apples continues to want to update the 09 system. So it stays updated. I have had to turn off my auto updating that was nice but I'll do it one at a time in order to keep the Pages 09 and Keynote. When something works don't mess with it. Any fixes out there?

    I can't say that I have had a problem playing videos in Flash because I could always play them in browsers other than Firefox.
    In Firefox Tools>options>Advanced Hardware acceleration is turned on.
    I don't know if that is different that tuning it off and on in Flash or not, but for now it is a moot point.
    As I stated in my previous message, after following all earlier suggestions/instructions nothing helped. But The latest one, someone suggested that maybe version 17 of Flash might be a stable version.
    I made no other changes except to install it, a few days ago, and so far so good.
    Many thanks for your help,
    Giovanni

  • Java VM hangs when I start Derby Server

    Hey everyone,
    Help will be much appreciated so cheers in advance.
    I've made a desktop app through Netbeans that runs fine within the IDE but can't get it to work from outside (unless I've connected to the server from within Netbeans first so guessing its not the app itself rather the conenction to the server?)
    I'm using Java version 1.6.0_17 and am confuzled as to why the VM hangs when I try to start the Derby server from a Batch file.
    my batch file reads:
    set DERBY_HOME = M:\Business\Registers\Lodgements Registers\LodgementsDB\Sun\JavaDB
    Path = %DERBY_HOME%\bin;%Path%
    java -jar "%DERBY_HOME%\lib\derbyrun.jar" server start
    java -jar "M:\Business\Registers\Lodgements Registers\LodgementsDB\Lodgements\dist\Lodgements.jar"
    echo "Press any key to shutdown Server"
    pause
    java -jar "%DERBY_HOME%\lib\derbyrun.jar" server shutdown
    I've checked the Derby log file and its reading
    2010-02-16 09:00:37.530 GMT : Apache Derby Network Server - 10.5.3.0 - (802917) started and ready to accept connections on port 1527
    Just running java -jar "M:\Business\Registers\Lodgements Registers\LodgementsDB\Lodgements\dist\Lodgements.jar"
    gives all the usual java.sql.SQLNonTransientConnectionException .... I gather because it can't find the database if the server isn't open.
    The only other info I have to go on is the problem reporting in Vista which states the obvious (that the Java SE binary stopped working and was closed, tagging it with an AppHangB1)
    Also, in advance, is there a more common way of starting the server from outside nettbeans (eg code) that doesn't rely on command prompt- seems daft to me not to have this (and yes I am a first time derby user, used the Toplink persistence libs throughout my code if that helps?).

    Nothing is hanging, this is a misunderstanding of how a batch file works. A batch file is processed line by line, and only when the execution of the task or program (in this case your first call to Java) returns, execution will continue on the next line. As the first call starts Derby and only completes when Derby is stopped, your batch file will not continue with the next line until you kill Derby.
    You either need to start Derby separately, inside your application or using a batch command to launch Derby in a separate process so the batch file won't wait until completion. AFAIK this can be achieved using the command START (eg START java (rest of the commandline))

  • Swing hangs when using BufferedReader

    Swing hangs when I use a buffered reader. I must be doing something wrong but don't understand what it is. If I comment out the JFrame at the begining of the following code, the input part works but the Threads window won't display. If I add the JFrame then the window displays but hangs until I type something into the input. I have tried using invokeLater on the second thread with no success. What is going on?
    import boeing.agps.formatting.UtSys;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javax.swing.SwingUtilities;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.SimpleAttributeSet;
    import javax.swing.text.StyleConstants;
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments>Types
    * @author slr6053
    * @version $Id: $
    public class Test {
       static BufferedReader bufferedReadderIn = new BufferedReader(
                                                 new InputStreamReader( System.in ) );
       public static void main( String[] args ) {
          new JFrame();
          Thread t = new Thread( new Runnable() {
             public void run() {
                System.out.println( "Before while" );
                while ( true ) {
                   String input;
                   try {
                      System.out.println( "Before input" );
                      input = bufferedReadderIn.readLine();
                      System.out.println( "After input " + input );
                   } catch ( IOException e ) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                   } // read extension
          t.start();
          ThreadsWindow threadsWindow = new ThreadsWindow( "Test Thread" );
          threadsWindow.setVisible( true );
          Thread x = new Thread( threadsWindow, "Threads Window") ;
          x.start();
    * Create a stand-along window that displays the current hierarchy of
    * Thread-Groups and Threads, updating the information every second.
    * A typical output looks like:
    * Note: Thread "AGPS Main" will die and become "Thread-0" at the end of main().
    * <pre>
    * THREAD INFORMATION: 20-SEP-2002 17:49:28.0181
    * ThreadGroup "system": Max Priority = 10
    *  +-> "Signal dispatcher" Priority=5 Daemon=true
    *  +-> "Reference Handler" Priority=10 Daemon=true
    *  +-> "Finalizer" Priority=8 Daemon=true
    *  +ThreadGroup "main": Max Priority = 10
    *  +-+-> "AWT-EventQueue-0" Priority=6 Daemon=false
    *  +-+-> "SunToolkit.PostEventQueue-0" Priority=6 Daemon=false
    *  +-+-> "AWT-Motif" Priority=6 Daemon=false
    *  +-+-> "Screen Updater" Priority=5 Daemon=false
    *  +-+-> "TimerQueue" Priority=5 Daemon=true
    *  +-+-> "Thread-0" Priority=5 Daemon=false
    *  +-+-> "Help Thread" Priority=4 Daemon=false
    *  +-+-> "AGPS Execution" Priority=5 Daemon=false
    *  +-+-> "SEE Threads" Priority=5 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    * </pre>
    * @version $Id: ThreadsWindow.java,v 1.6 2007/08/22 14:39:02 slr6053 Exp $
    class ThreadsWindow extends JFrame implements Runnable, ActionListener {
       private JTextPane textArea ;
       private JButton startStop, closeBtn ;
       private boolean updateInformation = true ;
       private boolean exitThread = false ;
       private Document doc;
       private SimpleAttributeSet att;
       private SimpleAttributeSet attRed;
       private SimpleAttributeSet attBold;
       private SimpleAttributeSet attBold1;
        * Create and show a window that will display the Threads used in the
        * current JVM. The display will be updated every second from a newly
        * created Thread "SEE Threads".
        * @param title The window title for the window.
       public ThreadsWindow( String title ) {
          super( title ) ;
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          textArea = new JTextPane() ;
          att    = new SimpleAttributeSet();
          attBold1 = new SimpleAttributeSet( att );
          StyleConstants.setBold( attBold1, true );
          StyleConstants.setFontSize( attBold1, 14 );
          attBold = new SimpleAttributeSet( att );
          StyleConstants.setBold( attBold, true );
          attRed = new SimpleAttributeSet();
          StyleConstants.setForeground( attRed, Color.red);
          StyleConstants.setBold( attRed, true );
          doc = textArea.getStyledDocument();
          getContentPane().setLayout( new BorderLayout() ) ;
          getContentPane().add( new JScrollPane().add(
                 new JPanel().add( textArea ) ), BorderLayout.CENTER ) ;
          startStop = new JButton( "Start/Stop" ) ;
          closeBtn = new JButton( "CLOSE" ) ;
          JPanel buttons = new JPanel() ;
          buttons.setLayout( new GridLayout( 0, 2 ) ) ;
          buttons.add( startStop ) ;
          buttons.add( closeBtn ) ;
          startStop.addActionListener( this ) ;
          closeBtn.addActionListener( this ) ;
          getContentPane().add( buttons, BorderLayout.NORTH ) ;
          setSize( 300, 400 ) ;
       } // end of constructor()
        * Handle the buttons.
       public void actionPerformed( ActionEvent e ) {
          Object srcIn = e.getSource() ;
          if( srcIn instanceof JButton ) {
             JButton src = (JButton)srcIn ;
             if( src == startStop ) {
                updateInformation = !updateInformation ;
             } else if( src == closeBtn ) {
                updateInformation = false ;
                exitThread = true ;
                setVisible( true ) ;
                dispose() ;
             } // end else if
          } // end if
       } // end of actionPerformed()
        * While true, sleep 1 second and then repaint.
       public void run() {
          if ( SwingUtilities.isEventDispatchThread() ) new Exception().printStackTrace();
          setVisible( true );
          while( !exitThread ) {            // do forever
             try {
                Thread.sleep( 1000 ) ;  // update every second
             }catch( Exception sEx ) {
             if( updateInformation )
                repaint() ;
          } // end while
       } // end of run()
        * Display the hierarchy of Thread-Groups and Threads.
       public void paint( Graphics g ) {
          super.paint( g ) ;
          if( updateInformation ) {
             try {
                doc.remove(  0, doc.getLength() );
                doc.insertString( 0, "THREAD INFORMATION: " +
                               UtSys.datTimSec() + "\n", attBold1 ) ;
             } catch ( BadLocationException e1 ) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
             ThreadGroup rootT = Thread.currentThread().getThreadGroup();
             while( rootT.getParent() != null ) {
                rootT = rootT.getParent();
             }// end while
             try {
                buildThreadOutput( rootT, "" ) ;
             } catch ( BadLocationException e ) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } // end if
       } // end of paint()
        * Append to the textArea variable the passed ThreadGroup and any
        * Threads it contains. If it contains ant ThreadGroups, invoke this
        * method recursively on each of these threadGroups, etc...
        * @param tg The ThreadGroup to display
        * @param indent The indent-level String to preface each line with.
        *        This method appends "-+" to this String and passes it to the
        *        next recursive invocation.
        * @throws BadLocationException
       private void buildThreadOutput( ThreadGroup tg, String indent ) throws BadLocationException {
          doc.insertString( doc.getLength(),  "   ThreadGroup " +
                           "\"" + tg.getName() + "\":" +
                           " Max Priority = " + tg.getMaxPriority() +
                            "\n", attBold );
          indent = "      ";
          Thread threadArray[] = new Thread[ tg.activeCount() ];
          int threadCount = tg.enumerate( threadArray, false );
          for( int i = 0; i < threadCount; i++ ) {   // THREADS
             Thread thread = threadArray;
    doc.insertString( doc.getLength(), indent + thread.getId()+" "+
    " \"" +thread.getName() +
    "\" Priority=" + thread.getPriority() +
    " Daemon=" + thread.isDaemon() +
    " Active= "+ thread.isAlive() +
    " Interuppted= "+ thread.isInterrupted() +
    "\n", att ) ;
    } // end for
    ThreadGroup threadGroupArray[] = new ThreadGroup[
    tg.activeGroupCount() ];
    int threadGroupCount = tg.enumerate( threadGroupArray, false );
    for( int i = 0; i < threadGroupCount; i++ ) { // THREADGROUPS
    buildThreadOutput( threadGroupArray[i], indent ) ;
    } // end for
    } // end of buildThreadOutput
    } // end of ThreadsWindow class

    OK, this code is closer to my application. If I have the JFrame code in, it works but hangs - that is you can type in "doit" in the command line and the window comes up, and you need to type something else in the command window in order for the ThreadWindow to start updating. If you try to move the ThreadWindow it hangs.
    If you comment out the begining JFrame, the ThreadsWindow never starts. What is that I'm not understanding. The BufferedReader is not in the Main thread, it is in its own thread.
    import boeing.agps.formatting.UtSys;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.SimpleAttributeSet;
    import javax.swing.text.StyleConstants;
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments>Types
    * @author slr6053
    * @version $Id: $
    public class Test {
       static BufferedReader bufferedReadderIn = new BufferedReader(
                                                 new InputStreamReader( System.in ) );
       protected static boolean condition = false;
       public static void main( String[] args ) {
          new JFrame();
          Thread t = new Thread( new Runnable() {
             public void run() {
                System.out.println( "Before while" );
                while ( true ) {
                   String input;
                   try {
                      System.out.println( "Before input" );
                      input = bufferedReadderIn.readLine();
                      System.out.println( "After input " + input );
                      if ( input.equals( "doit" )) {
                         System.out.println("DOIT");
                         condition  = true;
                   } catch ( IOException e ) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                   } // read extension
          System.out.println("First thread started");
          t.start();
          ThreadsWindow threadsWindow = new ThreadsWindow( "Test Thread" );
          Thread x = new Thread( threadsWindow, "Threads Window") ;
          System.out.println("Second thread started");
          x.start();
        * @return Returns condition.
       public static boolean isCondition() {
          return condition;
    * Create a stand-along window that displays the current hierarchy of
    * Thread-Groups and Threads, updating the information every second.
    * A typical output looks like:
    * Note: Thread "AGPS Main" will die and become "Thread-0" at the end of main().
    * <pre>
    * THREAD INFORMATION: 20-SEP-2002 17:49:28.0181
    * ThreadGroup "system": Max Priority = 10
    *  +-> "Signal dispatcher" Priority=5 Daemon=true
    *  +-> "Reference Handler" Priority=10 Daemon=true
    *  +-> "Finalizer" Priority=8 Daemon=true
    *  +ThreadGroup "main": Max Priority = 10
    *  +-+-> "AWT-EventQueue-0" Priority=6 Daemon=false
    *  +-+-> "SunToolkit.PostEventQueue-0" Priority=6 Daemon=false
    *  +-+-> "AWT-Motif" Priority=6 Daemon=false
    *  +-+-> "Screen Updater" Priority=5 Daemon=false
    *  +-+-> "TimerQueue" Priority=5 Daemon=true
    *  +-+-> "Thread-0" Priority=5 Daemon=false
    *  +-+-> "Help Thread" Priority=4 Daemon=false
    *  +-+-> "AGPS Execution" Priority=5 Daemon=false
    *  +-+-> "SEE Threads" Priority=5 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    *  +-+-> "Basic L&F File Loading Thread" Priority=4 Daemon=false
    * </pre>
    * @author Tom Dickens
    * @version $Id: ThreadsWindow.java,v 1.6 2007/08/22 14:39:02 slr6053 Exp $
    class ThreadsWindow extends JFrame implements Runnable, ActionListener {
       private JTextPane textArea ;
       private JButton startStop, closeBtn ;
       private boolean updateInformation = true ;
       private boolean exitThread = false ;
       private Document doc;
       private SimpleAttributeSet att;
       private SimpleAttributeSet attRed;
       private SimpleAttributeSet attBold;
       private SimpleAttributeSet attBold1;
        * Create and show a window that will display the Threads used in the
        * current JVM. The display will be updated every second from a newly
        * created Thread "SEE Threads".
        * @param title The window title for the window.
       public ThreadsWindow( String title ) {
          super( title ) ;
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          textArea = new JTextPane() ;
          att    = new SimpleAttributeSet();
          attBold1 = new SimpleAttributeSet( att );
          StyleConstants.setBold( attBold1, true );
          StyleConstants.setFontSize( attBold1, 14 );
          attBold = new SimpleAttributeSet( att );
          StyleConstants.setBold( attBold, true );
          attRed = new SimpleAttributeSet();
          StyleConstants.setForeground( attRed, Color.red);
          StyleConstants.setBold( attRed, true );
          doc = textArea.getStyledDocument();
          getContentPane().setLayout( new BorderLayout() ) ;
          getContentPane().add( new JScrollPane().add(
                 new JPanel().add( textArea ) ), BorderLayout.CENTER ) ;
          startStop = new JButton( "Start/Stop" ) ;
          closeBtn = new JButton( "CLOSE" ) ;
          JPanel buttons = new JPanel() ;
          buttons.setLayout( new GridLayout( 0, 2 ) ) ;
          buttons.add( startStop ) ;
          buttons.add( closeBtn ) ;
          startStop.addActionListener( this ) ;
          closeBtn.addActionListener( this ) ;
          getContentPane().add( buttons, BorderLayout.NORTH ) ;
          setSize( 300, 400 ) ;
       } // end of constructor()
        * Handle the buttons.
       public void actionPerformed( ActionEvent e ) {
          Object srcIn = e.getSource() ;
          if( srcIn instanceof JButton ) {
             JButton src = (JButton)srcIn ;
             if( src == startStop ) {
                updateInformation = !updateInformation ;
             } else if( src == closeBtn ) {
                updateInformation = false ;
                exitThread = true ;
                setVisible( true ) ;
                dispose() ;
             } // end else if
          } // end if
       } // end of actionPerformed()
        * While true, sleep 1 second and then repaint.
       public void run() {
          while( !exitThread ) {            // do forever
             if ( Test.isCondition()  ) {
                setVisible( true );
                try {
                   Thread.sleep( 1000 ); // update every second
                } catch ( Exception sEx ) {
                if ( updateInformation )
                   repaint();
             } // end if
          } // end while
       } // end of run()
        * Display the hierarchy of Thread-Groups and Threads.
       public void paint( Graphics g ) {
          super.paint( g ) ;
          if( updateInformation ) {
             try {
                doc.remove(  0, doc.getLength() );
                doc.insertString( 0, "THREAD INFORMATION: " +
                               UtSys.datTimSec() + "\n", attBold1 ) ;
             } catch ( BadLocationException e1 ) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
             ThreadGroup rootT = Thread.currentThread().getThreadGroup();
             while( rootT.getParent() != null ) {
                rootT = rootT.getParent();
             }// end while
             try {
                buildThreadOutput( rootT, "" ) ;
             } catch ( BadLocationException e ) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          } // end if
       } // end of paint()
        * Append to the textArea variable the passed ThreadGroup and any
        * Threads it contains. If it contains ant ThreadGroups, invoke this
        * method recursively on each of these threadGroups, etc...
        * @param tg The ThreadGroup to display
        * @param indent The indent-level String to preface each line with.
        *        This method appends "-+" to this String and passes it to the
        *        next recursive invocation.
        * @throws BadLocationException
       private void buildThreadOutput( ThreadGroup tg, String indent ) throws BadLocationException {
          doc.insertString( doc.getLength(),  "   ThreadGroup " +
                           "\"" + tg.getName() + "\":" +
                           " Max Priority = " + tg.getMaxPriority() +
                            "\n", attBold );
          indent = "      ";
          Thread threadArray[] = new Thread[ tg.activeCount() ];
          int threadCount = tg.enumerate( threadArray, false );
          for( int i = 0; i < threadCount; i++ ) {   // THREADS
             Thread thread = threadArray;
    doc.insertString( doc.getLength(), indent + thread.getId()+" "+
    " \"" +thread.getName() +
    "\" Priority=" + thread.getPriority() +
    " Daemon=" + thread.isDaemon() +
    " Active= "+ thread.isAlive() +
    " Interuppted= "+ thread.isInterrupted() +
    "\n", att ) ;
    } // end for
    ThreadGroup threadGroupArray[] = new ThreadGroup[
    tg.activeGroupCount() ];
    int threadGroupCount = tg.enumerate( threadGroupArray, false );
    for( int i = 0; i < threadGroupCount; i++ ) { // THREADGROUPS
    buildThreadOutput( threadGroupArray[i], indent ) ;
    } // end for
    } // end of buildThreadOutput
    } // end of ThreadsWindow class

  • C++ process hangs when started from Java

    I am trying to execute a c++ code from java on a remote Windows machine. In order to deal with the remote part, I have created a Web service from where the actual command is run using Runtime.exec(). The c++ exe is not being called directly from the java code. I have a batch file that eventually calls the exe.
    The problem is, both java and c++ processes hang. The java code on server side does handle the output stream and error stream. Also, the c++ code is logging everything in a file on Windows. The strange thing is that, when I remove the WS call and run the java code on server side as a standalone java program, it succeeds. Also, execution of the batch file alone does not hang. Here is the java code:
    public class RunCPlusPlusExecutable {
    public int runExecutable() {
        int exitValue = 0;
        try {
            Process p = null;
            Runtime rt = Runtime.getRuntime();
            System.out.println("About to execute" + this + rt);
            p = rt.exec("c:/temp/execcplusplus.bat");
            System.out.println("Process HashCode=" + p.hashCode());
            StreamProcessor errorHandler = new StreamProcessor(p.getErrorStream(), "Error");
            StreamProcessor outputHandler = new StreamProcessor(p.getInputStream(), "Output");
            errorHandler.start();
            outputHandler.start();
            exitValue = p.waitFor();
            System.out.println("Exit value : " + exitValue);
            if (exitValue == 0)
                System.out.println("SUCCESS");
            else
                System.out.println("FAILURE");
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (Exception e) {
        return exitValue;
    class StreamProcessor extends Thread {
        private InputStream is = null;
        private String type = null;
        private InputStreamReader isr = null;
        private BufferedReader br = null;
        private FileWriter writer = null;
        private BufferedWriter out = null;
        StreamProcessor(InputStream is, String type) {
            this.is = is;
            this.type = type;
        public void run() {
            try {
                isr = new InputStreamReader(is);
                br = new BufferedReader(isr);
                writer = new FileWriter("*******path to log file********");
                out = new BufferedWriter(writer);
                String line = null;
                while ((line = br.readLine()) != null) {
                    Date date = new Date();
                    out.write("[" + type + "]: " + date + " : " + line);
                    out.newLine();
                writer.flush();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            } finally {
                try {
                    if (br != null)
                        br.close();
                    if (isr != null)
                        isr.close();
                    if (out != null)
                        out.close();
                    if (writer != null)
                        writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
    String line = null;
                while ((line = br.readLine()) != null) {
                    Date date = new Date();
                    out.write("[" + type + "]: " + date + " : " + line);
                    out.newLine();
                writer.flush();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            } finally {
                try {
                    if (br != null)
                        br.close();
                    if (isr != null)
                        isr.close();
                    if (out != null)
                        out.close();
                    if (writer != null)
                        writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
    The WS server is running from some admin user. And I have been running the standalone java program from some other user. It seems that the c++ executable is giving referenced memory error when being executed from WS call. There are pop-ups citing the error with OK and Cancel buttons(visible when logged in as admin). The error states
    The instruction at 0x05473030 referenced memory at 0x000001d4. The memory could not be read
    Any idea what is causing the problem and how to debug it? Why does this memory error comes only when the exe is run through WS call? Please note that I won't be able to debug the c++ code and the web service is an apache axis2 service.
    Thanks

    How can I know? Its your environment, not mine. The only thing we know is that when running the stuff through one path things blow up and when you run them through another path, things don't blow up. User rights is an obvious suspect, but not necessarily the actual problem. Generally when rights are the problem, you get some form of "access denied" exception, not a code hang.
    Another likely possibility is that of network settings; perhaps your server goes through a proxy and your local applications do not, or the other way around.
    Yet another likely possibility is that the version of Java used is different, or different versions of libraries are no the classpath causing differences in behavior. There is only one way to figure it out: get to know your environment very well and through solid reasoning and experimentation try to figure out where the breaking point is. It all starts with answering this question: what might be different in the environment of the web server, and outside of it? I can't know, only you can. Good luck.

  • Using Google GWT to create (Dashcode) widgets for iBook Author  I would like to embed interactive widgets in iBooks using iBookAuthor. The widgets in question started life in Java but GWT has allowed them to be converted to javascript and to run on web pa

    I would like to embed interactive widgets in iBooks using iBookAuthor. The widgets in question started life in Java but GWT has allowed them to be converted to javascript and to run on web pages (for example, http://softoption.us/content/node/437 scroll to the bottom). In theory, iBookAuthor can bring in most html5, and much javascript. The technique is to wrap the html in a folder, with 2 extra files, a plist and a default png and then change the extension of the folder to ‘.wdgt’. This is the technique for making Dashboard widgets for the Mac, and Apple even have the Dashcode software to do it. So what you really do is to make a Dashboard widget, then iBookAuthor can import it.  So far, so good. And some  folk have been doing this, for example http://www.prweb.com/releases/2012/2/prweb9242432.htm http://www.panophoto.org/forums/viewtopic.php?f=64&t=10417&p=158330#p158423 However, if you start with GWT and create a single page with one button and a Hello World, compile it, and get the WAR file (I use Eclipse here)… the Safari browser and others will run it properly (even on an iPad). Then if you wrap it, a proper Dashboard widget is created, which runs properly on a Mac. Then if you go to iBookAuthor and put a custom widget in the Text, then drag it in. It is accepted by the text and shown as being there. However, if you use Preview to look at it on an iPad, it is gone (or was never there in the first place). Anyone any ideas on this? [And iBook Author seems to give no warnings.] The widget is at https://dl.dropbox.com/u/46713473/Test6.wdgt.zip I have bells and whistles that I’d like to get into an iBook!
    Thanks for any insights.
    Martin

    I do have a little to add, which might help someone. Indeed, opening a blank page and dragging the widget straight in seems good in difficult cases. But, actually, I was also able to insert successfully from the Toolbar especially to blank pages. So, it may have been something to do with the columns and stuff like that. Anyway back then the insertion would show in iBooks Author but not in the Preview on the iPad. I moved on to actual Google Web Toolkit output javascript. Basically I had three at hand to try: a Hello World with a button which went straight it, one of moderate complexity, (for example with a built in Lisp interpreter), which also went straight in, and finally a more complex one that initially was rejected by iBook Author. Author complained that there was an unsupported media file (of course, Author does not tell you which one it is, that would be too easy). [Remember, this was a proper working Dashboard widget which could be installed on a Mac]. Among other things I had read remarks about .gif files. When looking through the GWT war directory at the actual javascript etc files, I noticed there were two gifs there one called ‘clear.cache.gif ‘  and a second one called  ‘0F89659FF3F324AE4116F700257E32BD.cache.gif’. (Now, there is obfuscation so the numbers here may be different from case to case.) The clear.cache.gif did not seem to be anything special. But the other one is an animation. It is three little boxes that twinkle (rather like a waiting spinning cursor).  So, I opened that file and saved it to itself (that picks the top frame of the animation and saves only that, leaving you with an unanimated gif). The resulting widget drags and drops into iBooks Author (and seems to work properly at a quick glance). So, if you are having trouble with ‘unsupported media files’ converting animated gifs into unanimated gifs might help in some cases.

  • Application hangs when using ProcessStartInfo and Process.WaitForExit.

    I've looked on different threads about this, but all of them uses the Process.RedirectStandardOutput = True, which I don't.
    I'm trying to open a process (console application, not made by me) to make it compile a special .acs file to a .o file. The structure is simple, the only argument is the file you want to compile.
    But on certain files my application hangs when trying to open the process. Here's my code:
    Dim p As New Process
    Dim ps As New ProcessStartInfo
    ps.Arguments = SavePath 'Path example: "C:\Program Files (x86)\Zandronum\File.acs"
    ps.FileName = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory(), "Script Compilers\Zandronum\acc.exe")
    ps.CreateNoWindow = False
    ps.ErrorDialog = False
    ps.UseShellExecute = True
    ps.WindowStyle = ProcessWindowStyle.Hidden
    ps.WorkingDirectory = Path.GetDirectoryName(SavePath)
    Dim ErrorCaptured As Boolean = False
    Try
    p = Process.Start(ps)
    Catch ex As Exception
    ErrorCaptured = True
    End Try
    If ErrorCaptured = False Then
    p.WaitForExit()
    End If
    If ErrorCaptured = True Then
    Exit Sub
    End If
    Thanks!
    //Visual Vincent
    EDIT:
    For starting the process I use pretty much the same code that another guy made in C#. And his code is working perfectly...
    // Setup process info
    processinfo = new ProcessStartInfo();
    processinfo.Arguments = args;
    processinfo.FileName = Path.Combine(this.tempdir.FullName, info.ProgramFile);
    processinfo.CreateNoWindow = false;
    processinfo.ErrorDialog = false;
    processinfo.UseShellExecute = true;
    processinfo.WindowStyle = ProcessWindowStyle.Hidden;
    processinfo.WorkingDirectory = this.workingdir;
    try
    process = Process.Start(processinfo);
    catch(Exception e)
    // Unable to start the compiler
    General.ShowErrorMessage("Unable to start the compiler (" + info.Name + "). " + e.GetType().Name + ": " + e.Message, MessageBoxButtons.OK);
    return false;
    // Wait for compiler to complete
    process.WaitForExit();
    I hope your day has been better than yesterday, but that it's worse than tomorrow...
    Please mark as answer if I solved your problem. :)

    Hi,
     Have you compared the FileNames and Arguments of ones that work and ones that don`t? Is there any difference in them such as the ones that work do not contain blank spaces in the FileName or arguments and the ones that do work don`t contain blank spaces
    in them? If you find that to be the problem then you need to add Quotes to the beginning and end of the FileName or Arguments.
     My first guess is the Arguments needs the Quotes like this because, i see blank spaces in your example of the Arguments.
    ps.Arguments = Chr(34) & SavePath & Chr(34)
    If you say it can`t be done then i`ll try it
    This actually made it. I had forgotten that blank spaces makes it a new argument, silly me. I don't use process arguments that often. ;)
    Thanks alot!
    I hope your day has been better than yesterday, but that it's worse than tomorrow...
    Please mark as answer if I solved your problem. :)

  • WLS 8.1 hanging when using XA

    I am having an issue with BEA 8.1 hanging when using XA. I have configured it
    on several other Windows 2000 machines and not seen an issue. This particular
    machine seems to hang and then give a time out error. ANy suggestions would
    be appreciated. Below is the error that I am getting back and a thread dump.
    java.lang.Exception: Exception while commiting Tx : Name=[EJB com.level3.ds9.business.ejb.SearchEJB.getLocations(java.lang.String,com.level3.ds9.common.L3Environment)],Xid=BEA1-001E3F8C31D9BB58DEB7(18601996),Status=Unknown,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=122,seconds left=2878,XAServerResourceInfo[lidPool]=(ServerResourceInfo[lidPool]=(state=new,assigned=none),xar=null),SCInfo[mydomain+brettjason]=(state=active),SCInfo[ds9FT+ds9server3]=(state=active),properties=({weblogic.transaction.name=[EJB
    com.level3.ds9.business.ejb.SearchEJB.getLocations(java.lang.String,com.level3.ds9.common.L3Environment)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=brettjason+10.1.44.74:7001+mydomain+t3+,
    XAResources={},NonXAResources={})],CoordinatorURL=ds9server3+10.1.19.141:7001+ds9FT+t3+);
    nested exception is: javax.transaction.SystemException: Timeout during commit
    processing
    Exception while commiting Tx : Name=[EJB com.level3.ds9.business.ejb.SearchEJB.getLocations(java.lang.String,com.level3.ds9.common.L3Environment)],Xid=BEA1-001E3F8C31D9BB58DEB7(18601996),Status=Unknown,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=122,seconds left=2878,XAServerResourceInfo[lidPool]=(ServerResourceInfo[lidPool]=(state=new,assigned=none),xar=null),SCInfo[mydomain+brettjason]=(state=active),SCInfo[ds9FT+ds9server3]=(state=active),properties=({weblogic.transaction.name=[EJB
    com.level3.ds9.business.ejb.SearchEJB.getLocations(java.lang.String,com.level3.ds9.common.L3Environment)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=brettjason+10.1.44.74:7001+mydomain+t3+,
    XAResources={},NonXAResources={})],CoordinatorURL=ds9server3+10.1.19.141:7001+ds9FT+t3+);
    nested exception is: javax.transaction.SystemException: Timeout during commit
    processing
    "ExecuteThread: '12' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x2
    770EB70 nid=0xa34 in Object.wait() [2868f000..2868fd88]
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <054801B8> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '11' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x2
    76E6858 nid=0x5f8 in Object.wait() [2864f000..2864fd88]
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <05480230> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '10' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x2
    76E5C70 nid=0x670 in Object.wait() [2860f000..2860fd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <054802A8> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <054802A8> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '9' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x27
    6E50B0 nid=0x9c8 in Object.wait() [285cf000..285cfd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <05480320> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <05480320> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '8' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x27
    71B350 nid=0x9bc in Object.wait() [2858f000..2858fd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <05480398> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <05480398> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '7' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x27
    71BC10 nid=0x7b8 in Object.wait() [2854f000..2854fd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <05480410> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <05480410> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '6' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x27
    71D7D8 nid=0x848 in Object.wait() [2850f000..2850fd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <05480488> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <05480488> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '5' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x27
    71C8F0 nid=0x9dc in Object.wait() [284cf000..284cfd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <05480500> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <05480500> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '4' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x27
    71C798 nid=0x824 in Object.wait() [2848f000..2848fd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <05480578> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <05480578> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '3' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x27
    60B420 nid=0x770 in Object.wait() [2844f000..2844fd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <054805F0> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <054805F0> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '2' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x26
    F9FA10 nid=0xa64 in Object.wait() [2840f000..2840fd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <05480668> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <05480668> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '1' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x27
    580CC0 nid=0x8d8 in Object.wait() [283cf000..283cfd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <054806E0> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <054806E0> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '0' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x26
    F8F6B0 nid=0x7a0 in Object.wait() [2838f000..2838fd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <05480758> (a weblogic.kernel.ExecuteThread)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
    - locked <05480758> (a weblogic.kernel.ExecuteThread)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "Signal Dispatcher" daemon prio=10 tid=0x008B4850 nid=0x978 waiting on condition
    [0..0]
    "Finalizer" daemon prio=9 tid=0x008FF7F8 nid=0x73c in Object.wait() [26cff000..2
    6cffd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <052A72C8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
    - locked <052A72C8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=10 tid=0x008FE370 nid=0xa08 in Object.wait() [26
    cbf000..26cbfd88]
    at java.lang.Object.wait(Native Method)
    - waiting on <052A7330> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:426)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113)
    - locked <052A7330> (a java.lang.ref.Reference$Lock)
    "main" prio=5 tid=0x002358F8 nid=0x8a8 in Object.wait() [6f000..6fc40]
    at java.lang.Object.wait(Native Method)
    - waiting on <052A7508> (a weblogic.t3.srvr.T3Srvr)
    at java.lang.Object.wait(Object.java:426)
    at weblogic.t3.srvr.T3Srvr.waitForDeath(T3Srvr.java:1170)
    - locked <052A7508> (a weblogic.t3.srvr.T3Srvr)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:384)
    at weblogic.Server.main(Server.java:32)
    "VM Thread" prio=5 tid=0x008FD138 nid=0x88c runnable
    "VM Periodic Task Thread" prio=10 tid=0x008B3390 nid=0x8bc waiting on condition
    "Suspend Checker Thread" prio=10 tid=0x008B3E68 nid=0x524 runnable

    Running Windows XP (even fully patched up with SP3 and latest fixes), you probably will have an increasing risk of Windows and IE being attacked. Windows XP has been getting security patches every month for over a decade. So it seems likely that people will continue to discover vulnerabilities in Windows XP that, over time, will be exploited (i.e., used in attacks).
    Windows 8.1? For a good experience, you probably would be better off getting a new computer than installing 8.1 on a system that is several years old. I realize not everyone's budget permits.
    What else can you do? It remains useful and important to keep your third party applications, such as Firefox, and your browser add-ons, such as Flash, up-to-date. It's also a good idea to run quality security software. And practice safe browsing habits like avoiding questionable websites and peer-to-peer networking, and being suspicious of email attachments.

  • Java.io.File give incorrect chinese filenam when using javaw.exe

    I am running Chinese Win2000 Pro (SP2) with jre1.3.1 installed. If I use javaw.exe to run my application, java.io.File does not give the correct filename for chinese filename when I use it to run through a directory, though all English filenames show correctly.
    When the same program is run by java.exe instead of javaw.exe, the program runs with no problem and all chinese name are obtained successfully from java.io.File. Does anyone know the reason behind this ?
    I need to use javaw.exe since I am invoking Java from VC++. I don't want a black command prompt window to pop up behind my java application. Please help.

    Hi,
    I am sorry for not replying to ur query. Infact I am facing my own problem and after reading your problem I thought you could help me out in it because you are already successful in invoking java from VC++.
    My problem is that I want to invoke java class from VC++ in such a way that I want to capture the stdout of java class that I invoke from VC++ and use it in VC++. Let me explain first thing first. I am not able to invoke java class from withing vc++. I have looked at JNI help on SUN site but it is giving me lots of compilation error when I include JNI.h in my VC++ program. If you could help me out in this problem, it would be great.
    Thanks in advance.
    Regards
    Rakesh

  • Applications Hang when selecting / attaching a file using Spotlight

    Hi,
    Having a problem since upgrading to Snow Leopard with applications 'hanging' when trying to attach a file using Spotlight. I can repeatedly cause the failure in Mail and Safari - and probably others as well - but these two applications I use most often and need to attach files to most often.
    When I select "Attach a file", and use Spotlight to find the file to attach, the file dialog box closes and the attachment is apparently made - seconds later the spinning wheel appears and the dock tells me "Application Not Responding."
    Any ideas as to how / why this is happening? Help make it stop!
    Thank you,
    Gordon.

    OK Search box
    Mine is OK so something is screwy..
    In your Finder Prefs > Advanced > When performing a search drop down. Search this Mac seems to be default and the one I have set. Have you got it set to search the current folder or use the previous search instead?
    I'd then pull out the com.apple.finder.plist from your user Library > Preferences to the desktop and let finder make a new one. If all is OK trash the old one.
    Relaunch Finder by holding down the option key while right clicking Finder icon in the dock. Relaunch will be on the bottom of the context menu.
    S.

  • After installing the latest upgrade firefox just hangs when opening - was fine before. have tried deleting restore session but worse not better now

    after installing the latest upgrade firefox just hangs when opening - was fine before. have tried deleting restore session but worse not better now. no change with firewall.
    == This happened ==
    Every time Firefox opened
    == yesterday, after installing the upgrade ==
    == User Agent ==
    Opera/9.80 (Windows NT 5.1; U; en-GB) Presto/2.5.24 Version/10.54

    I'm using Mac OS 10.4.11 & even typing this message the characters appear so slowly that I could get a hammer and chisel and inscribe the words faster than the new Firefox runs. WTF?

  • I am confused about something.  How do I read a book on my MacBook Pro?  I can't find the iBook app anywhere, which is what I use on my iPad.  The book I want to read is in my iTunes but I can't click on it.  My iBook library does not show up in iTunes.

    I am confused about something.  How do I read a book on my MacBook Pro?  I can't find the iBook app anywhere, which is what I use on my iPad.  The book I want to read is in my iTunes but I can't click on it.  Some of my iBooks show up in my iTunes but they are "grayed" out.  The only books that respond in iTunes are audiobooks and that's not what I'm looking for.  Is this a stupid question?

    Nevermind - I answered my own question, which is I CAN"T READ ANY BOOKS I purchased in iBooks on my MacBook Pro.  If I want to read on my mac I have to use Kindle or Nook.  Which means any book I've already purchased through iBooks has to be read on my iPad.  Kind of a drag because there are times when it's more convenient for me to read while I'm sitting with my Mac.

Maybe you are looking for