Could someone help me with class Process getErrorStream() ??

Hello
I want to execute process "/usr/bin/octave" .So I have to write to its input and read its output and error stream. I have written program and it works good until I need to read error stream of process. After I read the error stream of process i receive the IOException Broken pipe. It looks like after read the data from error stream process is closed so I coudn't write anything to the input stream (what i could do before reading from error stream). The errors I receive :
java.io.IOException: Broken pipe
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(Unknown Source)
at sun.nio.cs.StreamEncoder.flush(Unknown Source)
at java.io.OutputStreamWriter.flush(Unknown Source)
at java.io.BufferedWriter.flush(Unknown Source)
at wazna$3.run(octave.java:116)
at java.lang.Thread.run(Unknown Source)
And here is my code:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
public class octave{
public static void main(String[] args) throws IOException, InterruptedException {
Runtime r = Runtime.getRuntime();
final Process p= r.exec("/usr/bin/octave");
System.out.print(">>");
InputStream iss = p.getInputStream();
BufferedReader br =
new BufferedReader(new InputStreamReader(iss));
try {
while (iss.available() == 0) { }
while (br.ready())
System.out.println(br.readLine());
} catch (IOException e) { e.printStackTrace();}
String s=null;
do
System.out.print(">>");
BufferedReader in = new BufferedReader(new
InputStreamReader(System.in));
s = in.readLine();
if (s.equalsIgnoreCase("exit"))
System.out.print(">>");
System.out.print("END");
else
Thread reading = new Thread(
new Runnable()
synchronized public void run()
InputStream iss = p.getInputStream();
BufferedReader br =
new BufferedReader(new InputStreamReader(iss));
try {
while (iss.available() == 0) { }
while (br.ready()) {
System.out.println(br.readLine());
} catch (Exception e) {e.printStackTrace();                                                                                                                                } }
Thread error = new Thread(
new Runnable()
synchronized public void run()
InputStream err=p.getErrorStream();
BufferedReader er =
new BufferedReader(new InputStreamReader(err));
try {
while (err.available() == 0) {
while (er.ready()) {
System.err.println(er.readLine());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
final String g=s;
Thread writing = new Thread(
new Runnable()
synchronized public void run()
OutputStream oos = p.getOutputStream();
BufferedWriter bw =
new BufferedWriter(new OutputStreamWriter(oos));
try {
bw.flush();
bw.write(g);
bw.newLine();
bw.flush(); //LINE 116 where is an error
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
writing.start();
reading.start();
error.start();
while (!s.equalsIgnoreCase("exit"));
Message was edited by:
tazja
Message was edited by:
tazja

I know it's a bit late for this. But I hope it will help all the people who encountered this problem.
The only way to let octave work with streams is to use the --interactive switch (otherwise it will crash on the first error). Rembember that using this will need a different way to read data (BufferedReader won't work well).
Hope this helps anyone, I spent very much time figuring this.
Bye

Similar Messages

  • Could someone help me with instructions for doing a clean install for iMac with mountain lion 10.8.4 ?

       Could someone help me with instructions for doing a clean install for Could someone help me with instructions for doing a clean install for an early 2009 iMac 20"  with Mountain Lion 10.8.4 ?
       Thank You,
                                leetruitt

       Barney,  William,  nbar, Galt\'s Gulch:
       A nephew stayed with us to take a course at the local community college last semester. I allowed him use of my mac for research just after I installed Mountain Lion. He decided to "help out" and ran a 3rd party clean and tune up app., Magician.  The tune up wiped over 1200 titles of my music in iTunes,  also a path of folders with names containing nothing but more empty folders with names. Almost every program I open and run for a short time crashes, also folders and programs are in wrong places, or cannot be located (the nephew, for instance). Up to this time I have always been able to track a problem far enough to resolve it by careful persistence and good luck, but I do not have the tech savvy to solve this one without getting in deeper. I have run disk utility saveral times and always get  variations of this:
    ACL found but not expected on
    "private/etc/resolve.conf"
    "private/etc/raddb/sites-enabled/inner-tunnel"
    "private/etc/rabbd/sites-enabled/control-socket"
         Also, after four years of intense daily use it is cluttered with much junk,  and every app that I was curious about, and I am a very curious guy.
       So I know my limits, (and now my nephew). I dumped my pc for a Strawberry iMac a few years ago, and so far every problem I've encountered, or brought on myself, the Mac has resolved with its own inner elegance - in spite of my novice bungels - and now I honestly feel ashamed, in addition to the need to apologize to a machine for allowing a peasant into the Royal Grounds - so I am calling the Wise Ones in for this one.
       Crazy, I know, but to me a Mac represents something far beyond the ordinary  input ➛ process  ➛ output  title/function customarily assigned to a machine - I sense an odd kind of morality involved, one that I need to respect.
        So, these are my reasons for wanting to do a clean install, correctly.
            Thank you,  Truitt

  • Hello, Could someone help me with lightroom 6.  I can't seem to buy the upgrade from lightroom 5 to 6 on the desktop. Thanks.

    Hello, could someone help me with lightroom 6.  I can't seem to buy the upgrade from lightroom 5 to six on my desktop?  Thanks.

    Products
    if that link doesn't work for you contact adobe support by clicking here and, when available, click 'still need help', https://helpx.adobe.com/contact.html

  • Could someone help me with comparing the contents of 2 folders?

    I'm trying to compare my iTunes music folder which is located in it's default location with a external USB hard drive. I was reading this article on how to do it using Terminal but I have NO CLUE on what to type in the command line. I'm clueless on this! Could someone help me with the commands I need to compare the 2 folders? I've included the link about what I'm trying to accomplish.
    http://www.macworld.com/article/132219/2008/02/termfoldercomp.html

    I tell you how. But remember that Terminal isn't a good place to be kicking around if you're not sure of what your doing. You can issue many commands as root that are irreversible. Tread very carefully, or get yourself a good GUI utility that can do that.
    It's asking you to cd (change directory to the folder that your files for comparison are in.
    So, you type, cd (leave a space) then you can just drag the folder to the Terminal and it will fill in the rest of the path.
    Then press Return
    Then type this at the prompt:
    diff -rq folder1 folder2
    (replacing "folder1 folder2 with the name of your folders. Leave spaces where indicated.
    Press return.
    -mj

  • TS2755 Whenever I send a message to another iPhone user via iMessage it is sending my Apple ID instead of my phone number.  Could someone help me with this??

    Whenever I send a message to another iPhone user via iMessage it is sending my Apple ID instead of my phone number. Could someone help me with this???

    Check this article: iOS: About Messages
    Additional Information
    You can change your iMessage Caller ID setting on iOS devices in Settings > Messages > Receive At > Caller ID. Note that the Caller ID setting is used only for new conversations. If you would like to change the address from which messages are sent, first change your Caller ID, and then delete the existing conversation and start a new one.
    iMessage responses will be sent from the address the recipient most recently messaged. For example, on iPhone you can receive messages sent to your Apple ID and phone number. A friend sends you a message to your Apple ID. Responses in this conversation will be sent from your Apple ID, even if your Caller ID is set to your phone number.

  • Yesterday for the first time i turned on my macpro 2011 model and i got a crazy gray screen with lines all over it ,so i held down the power button and turn off then restarted and all was ok could someone help me with this,what caused this shut down. werd

    yesterday for the first time i turned on my macpro 2011 model and i got a crazy gray screen with lines all over it ,so i held down the power button and turn off then restarted and all was ok could someone help me with this,what caused this shut down. werd

    Are the lines like psychedelic herringbone?  If yes, I had that happen once, it was something serious, like the
    Logic board. The good news is that it was fixed without any loss of data on the hard drive. Take it in to have Apple look at it ASAP.  I took it to TekServe at the time, they are very nice about preserving your data and user library when possible.
    Good luck and don't panic.

  • Could Someone Help Me With An Old Cisco LocalDirector?

    Hello. I recently purchased an old Pix LocalDirector from eBay. As one would expect, it came with no documentation or configuration notes but for $20.00, it was hard to resist. The seller didn't know if it even worked. I thought I'd take a chance and to my suprise, the little old Pix fired right up and ran. Unfortunately, the last user failed to clear the enable password, so I can't get into it to reconfigure it for use in my little home network. I registered myself here on the Cisco web site in hopes I could download the unlock key file but the web site said I had to purchase a service agreement from Cisco before I coul;d get this file. Well, I know from myt professional IT past that I couild never afford one of those agreements for myself and considering this is a well-beyond end-of-life product, I doubt they would sell me one anyhow. So, can anyone tell me if there's a way to clear the password in the hardware? Is there peradventure someone at Cisco who might turn loose of of a key file to this old thing?  As I mentioned, it's a Pix LocalDirector running software version 4.2(4), according to the "show version" command. The serial number is: 18003122. Could someone out there help me with this? Thank-you. Mike.

    Well, I guess "Someone" ended-up being me. I located a source for the password recovery/resetting disk (using Micro$oft's search engine: Bing - much to my chagrin - Google, go hang your head in shame), and created one disk for the 520 and one for the LocalDirector. I then loaded them up, one at a time, reset, and Presto! The enable passwords were cleared and I am now able to reconfigure the interfaces and everything else. I'd pat myself on the back but it hurts and looks ridiculous. Bye for now, all!

  • Could someone help me with the correct syntax.

    I have the following statement in a scriplet:
    out.println( " <td width=\"22%\"><A HREF=\"ContractAdmin.jsp?contractNumber=" + <jsp:getProperty name="contractBean" property="cnum"/> + "\">" + <jsp:getProperty name="contractBean" property="cnum"/> + "</a>" );
    The JSP will not compile. Could someone tell me what I'm doing wrong.
    Thanks in advance.
    Dosteov

    Hi dosteov ! =O)
    I think, the problem is that You are trying to mix scriptlets & jsp tags. If you will correct Your expression to this one:
    out.println( " <td width=\"22%\"><A HREF=\"ContractAdmin.jsp?contractNumber=" + contractBean.getCnum() + "\">" contractBean.getCnum()+ "</a>" );
    it should work. Anyway - trying to execute the tags inside the scriptlet leads to the JSP compiling problems.
    I hope it helps.
    Regards =O)

  • Could someone help me with a Runtime Error while saving a PDF file?

    While saving a 28 page PDF file in Illustrator today, I got a window saying, "This application has requested the "Runtime" to terminate it in a unusual way." It said to contact the applications support team for more information. I keep getting the same thing each time I try it. Does anyone know how to fix this issue or how I contact the applications support team ?
    Thank you for any insight.
    Pam

    It is a 13.5x11 inch calendar. There are 14 pages with images on them and
    some text. The other pages have text, a grid and a colored background with a
    gaussian blur. I saved each page as an "outline".
    The printer I am using requested I save all pages in a pdf file. I was
    successful in saving all but about six pages, now I can't even open the
    file.
    What happens is... I open Illustrator
                                   I open the pdf file
                                   A window appears that says... Runtime Error,
    This application has requested the Runtime to terminate it in an unusual
    way. Please contact the application's support team for more information.
                                   I select ok
                                   then a window appears that says... Adobe
    Illustrator CS5 has stopped working. A problem caused the program to stop
    working correctly. Windows will close the program and notify you if a
    solution is available.
                                   Then the program closes.
    So far I have not been notified of anything.
    Please let me know if you need more details.
    Thank you so much for helping me with this.
    Pam

  • Could someone help me with this code??

    Hi!, I am really poor at Java, and was given this piece of code to fix. I have no idea why this compiles but does not run and have never dealt with packages either, so I would really appreciate it if someone could tell me what I could do to fix it!!
    package Arrays;
    import java.awt.*;
    import java.awt.event.*;
    *   This class demonstrates a simple application
    *   A rather primitive ATM machine (needs work)
    *   Quite similar to the CashRegister Applet
    public class VirtualATM extends Frame implements ActionListener
         // the "screen"
         TextArea  display = new TextArea(8, 20);
         // some local variables
         private String current    = new String("");
         private double amount     = 0d;
         private double balance = 5000.0;
         private int opCode;
         // op code constants
         static final int PINENTRY   = 0;
         static final int DEPOSIT    = 1;
         static final int WITHDRAWAL = 2;
         // button labels - an array
         String [] btnLabels =
             "1", "2", "3", "Deposit",
             "4", "5", "6", "Withdraw",
             "7", "8", "9", "New Customer",
             "0", ".","Enter","Quit"
    * Default constructor
    public VirtualATM()
         super();
    * Constructor with frame title
    public VirtualATM(String title)
         super(title);
         setSize(400, 400);
         // inner class to detect window closing and make sure
         // quit method is executed before exit, not vital in
         // this case but a good habit to get into
         addWindowListener(new WindowAdapter()
              public void windowClosing(WindowEvent e)
                   quit();
         // set up the display
         int nButtons = btnLabels.length;
         Panel keypad = new Panel();
         keypad.setLayout(new GridLayout(4, 4, 5, 5));
         Button[] keys = new Button[nButtons];
         for (int i = 0; i < nButtons; i++)
              keys[i] = new Button(btnLabels);
              keypad.add(keys[i]);
              keys[i].addActionListener(this);
              keys[i].setActionCommand(btnLabels[i]);
         setLayout(new GridLayout(2, 1, 10, 10));
         display.setEditable(false);
         add(display);
         add(keypad);
         setVisible(true);
         startup();
    * Check the button presses
    public void actionPerformed(ActionEvent e)
         String command = e.getActionCommand();
         char com = command.charAt(0);
         // see if the character is part of a number:
         if ((com >= '0') && (com <= '9') || (com == '.'))
              doNumber(com);
         else
              // check here for function buttons
              switch (com)
                   case 'D' :
                   current = "";
                        deposit();
                        break;
                   case 'W' :
                   current = "";
                        withdraw();
                        break;
                   case 'N' :
                        startup();
                        break;
                   case 'E' :
                        processOperation();
                        break;
                   case 'Q' :
                        quit();
                        break;
    * This method prompts for a deposit
    public void deposit()
         opCode = DEPOSIT;
         display.append("\nPlease enter amount to deposit: ");
    * This method processes number button presses
    * Could add PIN validation
    public void doNumber(char com)
         current += com;
         if (opCode == PINENTRY)
              display.append("*");
         else
              display.append("" + com);
    * This method does the processing!
    public void processOperation()
         amount = toDouble(current);
         switch (opCode)
              case PINENTRY :
                   display.setText("Please choose a transaction");
                   break;
              case DEPOSIT :
                   if (amount > 0.0)
                        balance += amount;
                        display.setText("Thank you, your new balance is: " + balance);
                   else
                        display.setText("You cannot deposit " + amount);
                   break;
              case WITHDRAWAL :
                   if (amount <= balance)
                        balance -= amount;
                        display.setText("Thank you, your new balance is: " + balance);
                   else
                        display.setText("You cannot withdraw " + amount);
                   break;
    * This method quits
    public void quit()
         System.exit(0);
    * This method sets up for a new customer
    public void startup()
         display.setText("Welcome to Virtual Banking with VOB\n\n");
         display.append("Please enter your PIN: ");
         amount = 0.0;
         current = "";
         balance = 5000.00;
         opCode = PINENTRY;
    * converts a string to a double
    private double toDouble(String s)
         double theValue = -1.0;
         try
              if (s != "")
                   Double d = new Double(s);
                   theValue = d.doubleValue();
         catch (NumberFormatException n)
              current = "";
         finally
              return theValue;
    * This method prompts for a withdrawal
    public void withdraw()
         opCode = WITHDRAWAL;
         display.append("\nPlease enter amount to withdraw: ");
    class main{
         * Initialises the Application
         * Creation date: (07-Dec-00 23:10:49)
         public static void main(String[] args)
              VirtualATM myATM = new VirtualATM("Virtual Overseas Bank");

    That sounds like a path or classpath issue issue. There are some instructions here for windows systems...
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
    Basically you want to set your path to where your java.exe file is.
    You can probably run it like this though (if you are in the dir where your ATM class is and you put the path where your jdk is installed):
    D:\jdk1.3\bin\java VirtualATM
    Here is the code, changed (note that this forum tends to screw up the code a little):
    package Arrays;
    import java.awt.*;
    import java.awt.event.*;
    * This class demonstrates a simple application
    * A rather primitive ATM machine (needs work)
    * Quite similar to the CashRegister Applet
    public class VirtualATM extends Frame implements ActionListener
    // the "screen"
    TextArea display = new TextArea(8, 20);
    // some local variables
    private String current = new String("");
    private double amount = 0d;
    private double balance = 5000.0;
    private int opCode;
    // op code constants
    static final int PINENTRY = 0;
    static final int DEPOSIT = 1;
    static final int WITHDRAWAL = 2;
    // button labels - an array
    String [] btnLabels =
    "1", "2", "3", "Deposit",
    "4", "5", "6", "Withdraw",
    "7", "8", "9", "New Customer",
    "0", ".","Enter","Quit"
    * Default constructor
    public VirtualATM()
    super();
    * Constructor with frame title
    public VirtualATM(String title)
    super(title);
    setSize(400, 400);
    // inner class to detect window closing and make sure
    // quit method is executed before exit, not vital in
    // this case but a good habit to get into
    addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent e)
    quit();
    // set up the display
    int nButtons = btnLabels.length;
    Panel keypad = new Panel();
    keypad.setLayout(new GridLayout(4, 4, 5, 5));
    Button[] keys = new Button[nButtons];
    for (int i = 0; i < nButtons; i++)
    keys[i] = new Button(btnLabels);
    keypad.add(keys[i]);
    keys[i].addActionListener(this);
    keys[i].setActionCommand(btnLabels[i]);
    setLayout(new GridLayout(2, 1, 10, 10));
    display.setEditable(false);
    add(display);
    add(keypad);
    setVisible(true);
    startup();
    * Check the button presses
    public void actionPerformed(ActionEvent e)
    String command = e.getActionCommand();
    char com = command.charAt(0);
    // see if the character is part of a number:
    if ((com >= '0') && (com <= '9') || (com == '.'))
    doNumber(com);
    else
    // check here for function buttons
    switch (com)
    case 'D' :
    current = "";
    deposit();
    break;
    case 'W' :
    current = "";
    withdraw();
    break;
    case 'N' :
    startup();
    break;
    case 'E' :
    processOperation();
    break;
    case 'Q' :
    quit();
    break;
    * This method prompts for a deposit
    public void deposit()
    opCode = DEPOSIT;
    display.append("\nPlease enter amount to deposit: ");
    * This method processes number button presses
    * Could add PIN validation
    public void doNumber(char com)
    current += com;
    if (opCode == PINENTRY)
    display.append("*");
    else
    display.append("" + com);
    * This method does the processing!
    public void processOperation()
    amount = toDouble(current);
    switch (opCode)
    case PINENTRY :
    display.setText("Please choose a transaction");
    break;
    case DEPOSIT :
    if (amount > 0.0)
    balance += amount;
    display.setText("Thank you, your new balance is: " + balance);
    else
    display.setText("You cannot deposit " + amount);
    break;
    case WITHDRAWAL :
    if (amount <= balance)
    balance -= amount;
    display.setText("Thank you, your new balance is: " + balance);
    else
    display.setText("You cannot withdraw " + amount);
    break;
    * This method quits
    public void quit()
    System.exit(0);
    * This method sets up for a new customer
    public void startup()
    display.setText("Welcome to Virtual Banking with VOB\n\n");
    display.append("Please enter your PIN: ");
    amount = 0.0;
    current = "";
    balance = 5000.00;
    opCode = PINENTRY;
    * converts a string to a double
    private double toDouble(String s)
    double theValue = -1.0;
    try
    if (s != "")
    Double d = new Double(s);
    theValue = d.doubleValue();
    catch (NumberFormatException n)
    current = "";
    finally
    return theValue;
    * This method prompts for a withdrawal
    public void withdraw()
    opCode = WITHDRAWAL;
    display.append("\nPlease enter amount to withdraw: ");
    * Initialises the Application
    * Creation date: (07-Dec-00 23:10:49)
    public static void main(String[] args)
    VirtualATM myATM = new VirtualATM("Virtual Overseas Bank");

  • Could someone help me with my iphone 5?

    I am not sure if anyone has this problem at all but please see the video below.
    http://i1343.photobucket.com/albums/o796/kyrasym/VID_20140524_172214_zps0e1eb0b4 .mp4
    I get this like 6 to 7 times a day which is very annoying. Whenever I press the sleep/wake button. My phone wakes but instantly goes back to sleep again. I have brought it to the apple authorised service center TWICE. The first time they told me that there is a problem with my sleep/wake button so they changed it. Brought it home used it for about 4 days and the problem came back. Brought it back again to the service center but they told me there is nothing wrong with my phone even when I showed them this video of my problem. If someone from apple could please advise what I am supposed to do?

    Kyrasym wrote:
    No one here has this problem?????
    It seems not

  • Could someone help me with this error: java.sql.SQLException: Closed Connec

    My code:
    <%@ include file="../setupcache.jsp"%>
    <%
    if(connectionPool_dig==null){
    %>
    <p>Could not connect to database. Please try again, thank!</p>
    <%          
         return ;
    Connection con = connectionPool_dig.getConnection();
    if(con==null){
    %>
    <p>Could not connect to database. Please try again, thank!</p>
    <%          
         return;
         String file = request.getParameter("m_FILE");
              file = "a";
         String sql = " SELECT *"+
              " FROM "+
              " FILEUPLOAD, SUBJECT"+
              " WHERE "+
              " FILEUPLOAD.SUBJECTCODE = SUBJECT.CODE AND UPPER(FILEUPLOAD.FILENAME) LIKE(UPPER(?))";
         PreparedStatement stmt = con.prepareStatement(sql);
         stmt.setString(1,"%"+file+"%");
         ResultSet rs = stmt.executeQuery();
         while(rs.next()){
              out.println("<br>"+rs.getString(1));
              out.println("<br>"+rs.getString(2));
              out.println("<br>"+rs.getString(3));
              out.println("<br>"+rs.getString(4));
         rs.close();
         stmt.close();
    try{
         con.close();
    }catch(SQLException e){}
    %>
    it usualy generate that error (once wrong then right then wrong....), but if I don't close connection (con.close), it work well. Could some one help me!

    Hi,
    I think that it should be better that returning the Connection
    instance back to the Connection Pool. The connection
    should not be close by you. it should controlled by the
    connection pool mechanism. So I think that you should
    check out your connection pool usage document for the
    right usage.
    If your code is the case, the connection in connection
    pool will get less and your connection pool mechanism
    may need to reallocate a new one for application. I
    don't think that it is right.
    good luck,
    Alfred Wu

  • Could someone help me with accessing a program for a limited account holder

    Hi I just updated my G4 Mirror door computer with 10.4.7 and I cannot allow a user to use a specific software application through parental controls. The user has access through "get info" (can read & write) but when I use the accounts settings/parental controls/locate and then add the application it seems to add it fine. I then click "ok" and when I open "locate" again to see if it has added the program to allow the user to use it; it isn't there. I tried running repair permissions; repair permissions from the install disc (locks up the machine) and reinstalled the software (Carrara 5) with no success. I also updated a G4 powerbook & a different G4 machine and the programs work fine. Any help would be greatly appreciated.
    G4   Mac OS X (10.4.7)  

    ..."when I open "locate" again to see if it has added the program to allow the user to use it; it isn't there."...
    The description is similar to a problem that was fairly common under "Panther" - complaints in "Tiger" still do pop up occasionally, but not as often so it may be a different issue. Under "Panther", the problem (which I don't think was ever resolved) was that the act of attempting to view the state of the system resulted in changes to the system. For whatever reason, the "Accounts" pref pane was not able to read 'mcx_settings' (where user limitations settings are stored), causing it to display incorrect information which was then saved when the pref pane was closed again. A workaround for that problem was to configure the user limitations, immediately closing the pref pane, and resisting the temptation to open the "Limitations" tab (now called "Parental Controls") - as long as the "Accounts" pref pane wasn't given the opportunity to overwrite the settings, the user was able to access the programme.
    There is another fairly common problem affecting user limitations where programmes lacking eg. a (unique) 'CFBundleIdentifier' can't be added to the "allowed" list. The fact that the current programme can be added on other machines suggests that this is not the issue here, but if there are older versions of the programme, or perhaps other programmes from the same company, their presence might affect the system's ability to recognize the specific programme so if any potential conflicts exist, it might be worth trying to hunt them down and eliminating them.
    A different approach might be to try using "Workgroup Manager.app" to configure 'mcx_settings' it is included with the "Server Admin Tools" which can be downloaded from Apple. It may not be as user friendly as the "Accounts" pref pane, but seems to be less finicky...
    By the way, if the account is a "Simple Finder" account rather than a "Some Limits" account, access to problematic apps can be granted directly by adding an "alias" file to the user's "home" directory, since "Simple Finder" doesn't actually restrict application use.

  • Could someone help me with sql tags?

    Good morning here in Brazil, rsrs!!
    Well, I can�t see why it is giving me this exception, the codes are below
    could you give me some explanation? Thanks!
    my conection class and getDetalhes method:
    package teste;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.HashMap;
    import java.util.Iterator;
    public class Data {
        PreparedStatement prepStmt;
        ResultSet rs;
        Connection con;
        Detalhes detalhes;
        int codigo;
        ArrayList list;
        public Data()throws Exception {       
            try {
                Class.forName("org.gjt.mm.mysql.Driver");
                con = DriverManager.getConnection("jdbc:mysql://127.0.0.1/loja?user=marcos&password=131283");            
            } catch (Exception ex) {
                throw new Exception(" Database not found!!" +
                    ex.getMessage());
        public void remove() {
            try {
                con.close();
            } catch (SQLException ex) {
                System.out.println(ex.getMessage());
        public void setCodigo(int codigo){
            this.codigo = codigo;
        public Detalhes getDetalhes(){               
            try {
                String selectStatement = "select * from livraria where codigo ?";           
                prepStmt = con.prepareStatement(selectStatement);
                prepStmt.setInt(1, codigo);
                rs = prepStmt.executeQuery();
                while(rs.next())
                     detalhes = new Detalhes(rs.getString("titulo"), rs.getString("autor"), rs.getDouble("preco"), rs.getInt("codigo"));          
                prepStmt.close();
            }catch(Exception e){           
                System.out.println(e.getMessage());
            }finally {
               // close prepared statements and result sets within finally blocks
               if (rs != null) {
                  try {
                     rs.close();
                  } catch (SQLException sqle) {
                      System.out.println(sqle.getMessage());
               if (prepStmt != null) {
                  try {
                       prepStmt.close();
                  } catch (SQLException sqle) {
                      System.out.println(sqle.getMessage());
            return detalhes;
        public ArrayList getList(){
            try {           
                list = new ArrayList();
                String selectStatement = "select * from livraria";
                PreparedStatement prepStmt = con.prepareStatement(selectStatement);
                ResultSet rs = prepStmt.executeQuery();
                while(rs.next()){
                     detalhes = new Detalhes(rs.getString(1), rs.getString(2), rs.getDouble(3), rs.getInt(4));          
                     list.add(detalhes);
                prepStmt.close();                       
            }catch(Exception e){
                System.out.println(e.getMessage());
            return list;
    }my inicial Context class
    package teste;
    import java.util.ArrayList;
    import javax.servlet.*;
    public final class ContextPage implements ServletContextListener {
        private ServletContext context = null;
        Data bookDB;
        public void contextInitialized(ServletContextEvent event) {
            context = event.getServletContext();
            try {           
                bookDB = new Data();          
                context.setAttribute("bookDB", bookDB);
            } catch (Exception ex) {
                System.out.println("Couldn't create bookstore database bean: " +
                    ex.getMessage());
        public void contextDestroyed(ServletContextEvent event) {
      /*      context = event.getServletContext();
            Data dados = (Data) context.getAttribute("bookDB");
            if (dados != null) {
                dados.remove();
            context.removeAttribute("bookDB");              
    }   my jsp page
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
    <p><b><h1>Resultado:</h1></b></p><br>
    <sql:setDataSource dataSource="teste.Data"/>
    <sql:query var="books" sql="select * from livraria">
    </sql:query>
    <c:forEach var="book" begin="0" items="${books.rows}">
        ${book.titulo}
      </c:forEach>and the excption it brings me:
    exception
    javax.servlet.ServletException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:830)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:763)
         org.apache.jsp.Resposta_jsp._jspService(Resposta_jsp.java:86)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    root cause
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276)
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159)
         org.apache.jsp.Resposta_jsp._jspx_meth_sql_query_0(Resposta_jsp.java:121)
         org.apache.jsp.Resposta_jsp._jspService(Resposta_jsp.java:69)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)

    I take that back. The problem is that you are trying to use something as a DataSource that is NOT a DataSource.
    The docs for the sql:setDataSource tag says:
    "Data source. If specified as a string, it can either be a relative path to a JNDI resource, or a JDBC parameters string as defined in Section 10.1.1."
    You are setting it as if it were requiring a JavaBean, which is not the case.
    You want to either use a JavaBean to do all the SQL (good thing) or the sql tags (not a good thing).
    If I were using your teste.Data bean, my JSTL would look like this:
        <jsp:useBean id="data" class="teste.Data"/>
        <c:set var="bookList" value="${data.list}" />
        <c:forEach var="book" items="${bookList}">
            ${book.titulo}<br />
        </c:forEach>If I were to use the sql tags (don't) then they would look like:
        <sql:setDataSource driver="org.gjt.mm.mysql.Driver"
                           url="jdbc:mysql://127.0.0.1/loja"
                           user="marcos" password="131283" />
        <sql:query var="bookResults" sql="select * from livraria"/>
        <c:set var="bookResultArray" value="${bookResults.rows}"/>
        <c:forEach var="bookRow" items="${bookResultArray}">
            ${bookRow.titulo}<br />
        </c:forEach>Note that the values coming out of the sql query tag are rows in the database, not your Detahles class. So you have to access the values via the names of your columns in the database, not by the properties (get methods) in your class.

  • Could someone help me with arrays & recursion??

    Hi, I'm new here and I'm having trouble.
    I have to write a java application which uses recursion to find the maximal contiguous sum in a list of integers.
    The input is read from a text file where each line represents a list containing the following integers:
    For example, it might contain
    7 -2 -4 30 15 -7 -5 1000
    2 -50 100
    6 1000 -2000 900 2800 -2900 2801
    4 100 -10 5 8
    4 100 -50 5 8
    And for the output, for each line of data read, I have to display the largest sum of consecutive integers in the list followed by the list itself. For example for the lists above, my output would be:
    (on the left side is the largest sum of consecutive integers and on the right is the list of integers)
    1033

    R.S. wrote:
    Hi, I'm new here and I'm having trouble.
    I have to write a java application which uses recursion to find the maximal contiguous sum in a list of integers.
    The input is read from a text file where each line represents a list containing the following integers:
    For example, it might contain
    7 -2 -4 30 15 -7 -5 1000
    2 -50 100
    6 1000 -2000 900 2800 -2900 2801
    4 100 -10 5 8
    4 100 -50 5 8
    And for the output, for each line of data read, I have to display the largest sum of consecutive integers in the list followed by the list itself. For example for the lists above, my output would be:
    (on the left side is the largest sum of consecutive integers and on the right is the list of integers)
    1033Where did this 1033 come from? Could you explain your problem in a bit more detail and also post what you have done so far and explain where you are stuck: only posting the problem description sound a bit like "can some one do it for me", it's better to ask a specific question here.

Maybe you are looking for

  • The refresh icon is not appearing in the customize box for the toolbar

    I went to View...Toolbars...Customize, but do not find the option "refresh" available to install on the toolbar...is there another place I should be looking for the "refresh" option?...thx

  • Problem in Displaying Date for Culture th-TH in SSRS 2010

    Hello, I have a text box of date/time type. And Language of the report is set to a parameter ex: @P_Culture_Name and parameter will take a value from Prompt (UI). Suppose default value of date/time text box is 1/22/2013 12:00:00 AM when i pass 'en-US

  • How to change /usr/bin/grep To /usr/local/bin/grep

    Hi I have installed GNU Grep but when I am giving the command #which grep it is showing me solaris grep i.e /usr/bin/grep. My question is how do I change it to /usr/local/bin/ Thanks in advance Sukrut

  • How to Check input

    HI i wont to do a test program  and i have rfc that in import i have pernr and if user put pernr he get table with employee name and... the problem is when user put vaild pernr i wont to bring a popup that pernr dosent exist . how i do that? Regards

  • WI_ID parameter in Application Parameter in webdynpro component using class

    Hi All, I want to use WI_ID parameter in Application Parameter in my webdynpro component. And i am using class instead of BOR. I used this with BOR earlier, but can any one let me know that how to do the same if i am using class. Currently i created