Need help: mq_open returns -1 at run time

#include <stdio.h>
#include <unistd.h>
#include <mqueue.h>
#include <sys/stat.h>
mqd_t mymq;
struct mq_attr msgAttr;
int main(int argc, char **argv)
int close;
msgAttr.mq_maxmsg = 100;
msgAttr.mq_msgsize = 128;
msgAttr.mq_flags = 0;
/* Creating a message queue. */
mymq = mq_open("/home/karthik/test", O_CREAT|O_RDWR,S_IRWXU, &msgAttr);
if (mymq == (mqd_t) -1)
printf("Unable to create the message = %d\n",mymq);
else
"msgSend1.c" 30 lines, 591 characters
$
$ gcc msgSend1.c -lposix4
$ ./a.out
Unable to create the message = -1

errno returns "interrrupted system call"
#include <stdio.h>
#include <unistd.h>
#include <mqueue.h>
#include <sys/stat.h>
#include <string.h>
mqd_t mymq;
struct mq_attr msgAttr;
int main(int argc, char **argv)
int close;
int errno;
msgAttr.mq_maxmsg = 5;
msgAttr.mq_msgsize = 5;
msgAttr.mq_flags = 0;
/* Creating a message queue. */
mymq = mq_open("/home/karthik/test", O_CREAT|O_RDWR,S_IRWXU, &msgAttr);
if (mymq == (mqd_t) -1)
printf("Unable to create the message = %d errno = %d errorString = %s\n"
,mymq,errno,strerror(errno));
else
/* Release access to message queue */
close = mq_close(mymq);
"msgSend1.c" 32 lines, 672 characters
$
$ gcc msgSend1.c -lposix4
$ ./a.out
Unable to create the message = -1 errno = 4 errorString = Interrupted system cal

Similar Messages

  • I Need Help for the popup message every time I go to safari: "Warning! Old version of Adobe Flash Player detected. Please download new version."???

    I Need Help for the popup message every time I go to safari: "Warning! Old version of Adobe Flash Player detected. Please download new version."???

    If you are talking about Safari on the iPad, there is no version of Adobe Flash for iOS and there never has been. Clear Safari, close the app and reset the iPad.
    Go to Settings>Safari>Clear History and Website Data
    In order to close apps, you have to drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.
    If you are talking about Safari on your Mac, you are in the wrong forum. But I would still clear the cache, quit Safari and restart the Mac.

  • Help to create item at run time

    Hi all
    Please help to create item at run time
    I want to create item at run time
    is it Possible ???
    thank you

    Hi,
    As mentioned several times above, you cannot use Forms for displaying dynamic columns. So, you have two options (AFAIK).
    1. Create maximum number of items and set their visibility off based on the user input.
    2. Create a PJC (may be by extending JTable), and display dynamic columns (i feel it is a bit complicated and not straight forward as it sounds). Here is a [simple howto|http://sheikyerbouti.developpez.com/forms-pjc-bean/first-bean/first_bean.pdf] to build the PJC.
    -Arun

  • Need help on returning input

    Hi. I'm making a DateTimePicker (DTP), and I need help on getting a method to return a Date only when the DTP is closed, and I want this to be done in the DTP class itself.
    For now, I've used an infinite loop and it seems to work fine without lagging the computer (my computer is above average), but I'm not sure if there's another more efficient way.
    I would prefer not to use threads, but if that's the only option then I suppose it's unavoidable.
    I'm using:
    while(true){
        switch(returnState){
        case UNINITIALIZED: continue;
        case SET: return cal.getTime();
        case CANCELED:
            default:
            return null;
    }Screenshots:
    http://i34.tinypic.com/53rb7n.png
    http://i33.tinypic.com/2nsxct4.png
    Azriel~

    You could put any component in a JOptionPane or a JDialog and then easily query the component for results once it has returned.
    For example:
    QueryComponent.java creates a component that can be placed in a JOptionPane and then queried.
    import java.awt.GridLayout;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JComponent;
    import javax.swing.JTextField;
    * A simple component that has two JTextFields and two
    * corresponding "getter" methods to extract information
    * out of the JTextFields.
    * @author Pete
    public class QueryComponent
      private JPanel mainPanel = new JPanel();
      private JTextField firstNameField = new JTextField(8);
      private JTextField lastNameField = new JTextField(8);
      public QueryComponent()
        mainPanel.setLayout(new GridLayout(2, 2, 5, 5));
        mainPanel.add(new JLabel("First Name: "));
        mainPanel.add(firstNameField);
        mainPanel.add(new JLabel("Last Name: "));
        mainPanel.add(lastNameField);
      public String getFirstName()
        return firstNameField.getText();
      public String getLastName()
        return lastNameField.getText();
      // get the mainPanel to place into a JOptionPane
      public JComponent getComponent()
        return mainPanel;
    }QueryComponentTest.java places the component above into a JOptionPane, shows the pane, and then queries the QueryComponent object for the results.
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JComponent;
    public class QueryComponentTest
      private JPanel mainPanel = new JPanel();
      public QueryComponentTest()
        JButton getNamesBtn = new JButton("Get Names");
        getNamesBtn.addActionListener(new ActionListener()
          public void actionPerformed(ActionEvent e)
            getNamesAction();
        mainPanel.add(getNamesBtn);
      // occurs when button is pressed
      private void getNamesAction()
        // create object to place into JOptionPane
        QueryComponent queryComp = new QueryComponent();
        // show JOptionPane
        int result = JOptionPane.showConfirmDialog(mainPanel,
            queryComp.getComponent(), // place the component into the JOptionPane
            "Get Names",
            JOptionPane.INFORMATION_MESSAGE);
        if (result == JOptionPane.OK_OPTION) // if ok selected
          // query the queryComp for its contents by calling its getters
          System.out.println("First Name: " + queryComp.getFirstName());
          System.out.println("Last Name:  " + queryComp.getLastName());
      public JComponent getComponent()
        return mainPanel;
      private static void createAndShowUI()
        JFrame frame = new JFrame("QueryComponentTest");
        frame.getContentPane().add(new QueryComponentTest().getComponent());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args)
        java.awt.EventQueue.invokeLater(new Runnable()
          public void run()
            createAndShowUI();
    }Edited by: Encephalopathic on Sep 29, 2008 8:16 PM

  • Need help created state machine that is time based

    I need help with my labview program. My goal is to write a program that allows the user to turn a toggle button on/off. When they do this it will start a loop witch turns on a digital switch for 45 minutes then off for 30 seconds and on and on till the user toggles the switch off. The timing does not have to be precise. I am using the NI 9476 digital output card.
    I have written the code to turn the switch on/off. I know need to add the looped fuction for on 45 minutes/off 30 seconds. I assume the most efficient method would be using a state machine, but I was having trouble figuring it out.
    Attached is the program I have written thus far without the loops.
    Thanks,
    Barrett
    Solved!
    Go to Solution.
    Attachments:
    Test Setup X01.vi ‏16 KB

    I cannot see your code since I don't have 2010 installed. A state machine would be good approach but in order to allow the user to cancel and possibly abort the process at any time your state machine should have a state such as "Check for timeout". In teh loop containing the state machine use a shift register to pass the desired delay value and the start time time for that particular delay. Once the user starts the process set the delay time to your desired time (45 minutes expressed as seconds) and have another shift register that contains the next state to go to after the delay completes. Use a small delay (100ms to 500ms depending on how accurate you want your times to be) to prevent your state machine from free running and then check the delay again. Use the current time and compare it to the start time. If the desired time has passed then go to the next state. You can store the next state in a shift register. No do the same thing for your Off Time state.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot
    Attachments:
    Simple Delay in State Machine.vi ‏14 KB

  • Need help with returning an array of object

    hello, i've been trying to make a method that returns bot ha boolean and a colour for a render for a Jtable and the code for the method is:
         public Object[] isHighlightCellsWithColour(int xInternal, int colInternal) {
              Object[] returnWithTwoValue;
              boolean isHighLight = false;
              returnWithTwoValue = new Object[2];
              returnWithTwoValue[0] = isHighLight;
              returnWithTwoValue[1] = null;
              if (colourPassed == true && this.foundDupeInternal > -1) {
                   for (int c6 = 0; c6 < foundDupeInternal; c6++) {
                        if (this.rows[c6] == xInternal && this.cols[c6] == colInternal) {
                             isHighLight = true;
                             Color colourToSet = errorColourList[c6];
                             returnWithTwoValue = new Object[2];
                             returnWithTwoValue[0] = isHighLight;
                             returnWithTwoValue[2] = colourToSet;
                             return returnWithTwoValue;
              } else {
                   return returnWithTwoValue;
              return null;
         }and when i go and try to use it at
              check = new Object[2];
              check = isHighlightCellsWithColour(xCurrentlyDrawing, colCurrentlyDrawing);
              boolean z = false;
              try {
                   z = (Boolean) check[0];
              } catch (NullPointerException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              Color x = Color.white;
              try {
                   x = (Color)check[1];
              } catch (NullPointerException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              it gives me a nullpointerexception, which i try to catch, but it STILL gives me that error, i have no clue on how to cast from object back to boolean or colour after they are cast into objects
    or else is there a way to pass two different types of data back from a method? Other than using static variables that is, since that gave me problems, it only draws the first cell in colum that is in error in the colour specified , not the rest...
    thanks for your time
    Edited by: TheHolyLancer on Mar 8, 2008 12:42 AM

    yay that got it working, but the method still only draws the first cell with the colour only, need another way to do this one...
    now comes another puzzeling question, it is giving me an null pointer exception again in:
    System.out.println("setting colour "+ x.getBlue() + " On cell " + xCurrentlyDrawing + colCurrentlyDrawing);when i add that to the part where i set the colour, and colour is set to x (which is a color that is passed down by the method) and this will only run if it is determined that a colour is already passed, but it still gives me null pointer error?
    maybe i'll take this to the swing forum tommrow
    Edited by: TheHolyLancer on Mar 8, 2008 2:17 AM
    Edited by: TheHolyLancer on Mar 8, 2008 2:19 AM

  • Need help getting my applet to run..

    Hi, I am having the utmost trouble getting my applet to run. First I spent a month correcting syntax and other errors generated during compile. Now I find myself spending another month getting the compiled product to run. I don't care if the screen is completely blank and my logic is all messed up, I don't mind logic debugging. My applet just will not run at all, it won't even initialize.
    First when I tried to run my applet in Internet Explorer I got the following error in the statusbar:
    "load: tsorgi5 can't be instantiated"
    So, I researched that error message, and the solution appeared to be that I would need to use the Java Plug-In. So, I use that and now I find this message in the statusbar:
    "exception: null."
    That happens when the text "Loading Java Applet ..." is in the centre of the applet, and Internet Explorer acts like it is still doing something no matter how long I wait.
    I tried researching this, but only found "exception: null" with other things after the text "null."
    In Forte, when I choose "Execute" I get the following in the Output Window, I/O tab:
    java.lang.NoSuchMethodError: main
    Exception in thread "main"
    I would assume it expects me to add a method "main()," but I also get that same message with a different applet (which doesn't have a method "main()") which runs perfectly fine.
    I usually try to solve many of my problems myself, but with this one I have no idea where to start looking for answers. I'm relatively new to Java, been using Java for only half a year, so this particular problem is like looking for a four-leaf clover in the streets of New York City..
    I'm going to be chopping my applet into pieces, having a separate class file for each major engine. (It is a role-playing game, so I'll separate battle engine from cut-scene engine from world exploration engine etc..) Hopefully I will be able to narrow down my search for what is causing me all of these problems. Then once I solve my problems I can piece everything back together.
    In the meantime, I am hoping that some of you could help me out so that I may know what I am looking for.
    Thank You for your time,
    -Tony Slater

    Ah.. Forte is still a bit confusing to me, I have not and probably will not take the time to learn much about Forte, as the only real reason I use it is because unlike wordpad, I can see line numbers. =] Very helpful with my program being the size that it is.
    I do not think that the simple applet idea will be of much use, because one of my earlier applet projects (a main menu for my current project) which I mentioned above as another applet without a main() method which worked perfectly fine is very simple. Although I will try it anyway, as it could help and you are most likely much more experienced than I. =]
    Okay, I typed the following in the Dos Prompt:
    appletviewer TestApplet.class
    ..It printed a blank line, paused a little bit, then brought me back to the prompt, just like running a dos program that does not give any output. I'm not sure, but I would assume it should print a line containing the text "Here?" I have not used appletviewer before, so I do not know what it is supposed to do. =P
    I have already tried using System.out.println, but the problem occours even before the applet is started. I'll try enabling the Java Console first thing tomorrow morning, since a restart is required when enabling it.
    Now, I would be happy to post some code, but I'm not sure it would be best to post the code when my program is 2814 lines.. although 800 lines are probably comments, and most of those comments are probably irrelevant. Also I can sometimes be a messy coder. Although I can post some general information and can probably (with a little work) post an "outline" of the code.
    Since it is getting late I'll just post some portions of code which hopefully will prove important.
    // Import Packages
    import java.awt.Graphics;
    import java.awt.Color;
    import java.awt.*;
    import java.applet.*;
    import java.lang.System;
    import java.lang.reflect.Array;
    import java.lang.Math;
    import java.lang.Double;
    import java.math.*;
    import java.util.Random;
    import java.io.*;
    variable/object types created and/or declared between "public class.." and "public void init()...":
    int
    byte[]
    String
    RandomAccessFile
    int[][]
    double
    int[]
    double[][][]
    Random
    Image
    int[][][]
    arrays are filled in the init() method.
    public String getIniStrValue(String iniFile, String iniGroup, String iniItem) // Used for retrieving information from the game's external file system.
    another method getIniIntValue(int, String, String, String) is used for int values stored in external files.
    Within public void paint(), gameplay modes are detected and dealt with accordingly. With Cut-Scenes, proper charecter images and text is displayed, all cut-scene information is stored externally. Other modes do virtually the same, display graphics and text based on internal game data or un-changing external data files.
    Within public void mouseClick(), in certain modes of the game the mouse click will trigger a change no matter where the user clicked (such as cut-scenes, to advance to the next line of dialog), or different variables are set depending on where the user clicked. (What I like to call.. custom buttons) At the end of the method repaint(); is used, and the paint() method will alter the screen according to any changes that may have happened.
    public void charAttack() is a method called to handle battle equations when a playable and controllable charecter is making a move. It will detect the current charecter, detect the move being made by the charecter (attack, special move, magic, etc) and will change any variables accordingly and will then use repaint(); so that the player may know what has happened. (Whether or not attack was successful, how many HP the enemy lost, etc)
    public void loadBattle() is called when the charecter encounters an enemy. It will load possible enemies of the current part of the world being explored, select one, then load that enemy's "stats" from external game data files, and will then specify the new mode (Battle Menu, where the player chooses the moves to be made for the turn) by setting the int value "Mode." repaint(); is then called and it will paint the battle menu.
    public boolean keyDown() is of course used to detect keyboard events. In world exploration, the charecter will be moved accordingly. In modes such as cut-scenes, a variable will be changed to advance to the next line of speech. In menus, the keyboard events are used to switch between options. repaint(); is used to update the screen accordingly.
    Well, even though I very briefly summarized the code, it appears to have taken half an hour to do. I'll be getting some sleep in a few minutes, and when I wake up tomorrow morning I hope to both see and make some progress on solving this problem.
    Thank You,
    -Tony Slater.

  • Need help with my alarm clock, with Timer task and Timer classes

    k everything is almost complete to get this alarm to work. It goes off and everything. But the thing is that it has a start button and when you click it to start the alarm the text changes to "Stop". This way if the user wants he can turn it off. Yet it works fine, the only problem is when the alarm actually goes off, the button text doesnt change back to "Start". Im not sure how to control private data members in classes from other classes. This is very fustrating, help would be apprieciated. here is the code that i have so far:
    import java.awt.*;
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Timer;
    public class Alarm extends JFrame implements ActionListener
         private AlarmSetup as;
         private DigitalClock dc = new DigitalClock();
         private JComboBox amPmBox = new JComboBox();
         private JTextField hourField = new JTextField(2),
                             minuteField = new JTextField(2);
         private JPanel panel = new JPanel();
         private JLabel colon = new JLabel(":");
         private JButton start = new JButton("Start");
         private JMenuBar jmb = new JMenuBar();
         private JMenu file = new JMenu("File"), timeSetting = new JMenu("Time Setting");
         private JMenuItem startItem = new JMenuItem("Start");
         private JRadioButtonMenuItem standard = new JRadioButtonMenuItem("Standard", true),
                                            military = new JRadioButtonMenuItem("Military");
         private boolean standardToMilitary = false;
         private int hour, minute;
         private int[] arr;
         public Alarm()
              setTitle("Alarm");
              Container c = getContentPane();
              panel.add(hourField);
              panel.add(colon);
              panel.add(minuteField);
              panel.add(amPmBox);
              amPmBox.addItem("AM");
              amPmBox.addItem("PM");
              c.setLayout(new BorderLayout());
              c.add(dc, BorderLayout.NORTH);
              c.add(panel, BorderLayout.CENTER);
              c.add(start, BorderLayout.SOUTH);
              setJMenuBar(jmb);
              jmb.add(file);
              file.add(timeSetting);
              timeSetting.add(standard);
              timeSetting.add(military);
              file.add(startItem);
              ButtonGroup bg = new ButtonGroup();
              bg.add(standard);
              bg.add(military);
              military.addActionListener(this);
              standard.addActionListener(this);
              //the start things need to be implemented still in the action
              //performed
              start.addActionListener(this);
              startItem.addActionListener(this);
         public static void main(String[] args)
              Alarm frame = new Alarm();
              frame.pack();
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e)
              String actionCommand = e.getActionCommand();
              if(e.getSource() instanceof JButton)
                   if(actionCommand.equals("Start")){
                   //long seconds;
                   arr = dc.getTimeMilitary();
                   hour = Integer.parseInt(hourField.getText().trim());
              minute = Integer.parseInt(minuteField.getText().trim());
              String comboSelection = (String)amPmBox.getSelectedItem();
              as = new AlarmSetup(this, arr, hour, minute);
              as.setupAlarm(comboSelection, standardToMilitary);
              start.setText("Stop");}
              else if(actionCommand.equals("Stop")){
                   as.stopTimer();
                   start.setText("Start");}
              else if(e.getSource() instanceof JRadioButtonMenuItem)
                   if(actionCommand.equals("Military"))
                        dc.setTimeFormat(DigitalClock.MILITARY_TIME);
                        standardToMilitary = true;
                        panel.remove(amPmBox);
                   else if(actionCommand.equals("Standard"))
                        dc.setTimeFormat(DigitalClock.STANDARD_TIME);
                        standardToMilitary = false;
                        panel.add(amPmBox);
    import javax.swing.*;
    import java.util.Timer;
    import java.util.*;
    public class AlarmSetup
         private Timer alarmTimer = new Timer(true);
         private long seconds;
         private int[] timeArray;
         private int textHour, textMinute;
         public AlarmSetup()
         public AlarmSetup( int[] aarr, int ahour, int aminute)
              timeArray = aarr;
              textHour = ahour;
              textMinute = aminute;
         public void setTimeArray(int[] array)
              timeArray = array;
         public void setHour(int xhour)
              textHour = xhour;
         public void setMinute(int xminute)
              textMinute = xminute;
         public void stopTimer()
              alarmTimer.cancel();
         public void setupAlarm(String combo, boolean tester)
              if(!tester)
                   if(combo.equals("AM"))
                        seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                   else
                        seconds = (textHour + 12 - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
              else if(tester)
                   seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                   try
                        alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
                   catch(IllegalArgumentException iae)
                        seconds = (24*3600) + seconds;
                        alarmTimer.schedule(new AlarmTask(alarm), seconds*1000);
    import java.util.*;
    public class AlarmTask extends TimerTask
         public void run()
              System.out.println("Billy the goat");
              //dont know what to put to change the Alarm button text

    well im trying to get this down. So i made a private class inside the alarmsetup class. But now when i try to use the schedule method on the timer object it says that it doesnt know it? whats the deal? here is my code for that class
    import javax.swing.*;
    import java.util.Timer;
    import java.util.*;
    public class AlarmSetup
         private Alarm alarm;
         private Timer alarmTimer = new Timer();
         private long seconds;
         private int[] timeArray;
         private int textHour, textMinute;
         private class AlarmTask
              public void run()
                   alarm.changeButtonText();
                   System.out.println("Billy the Goat");
         public AlarmSetup(Alarm a)
              alarm = a;
         public AlarmSetup(Alarm al, int[] aarr, int ahour, int aminute)
              alarm = al;
              timeArray = aarr;
              textHour = ahour;
              textMinute = aminute;
         public void setTimeArray(int[] array)
              timeArray = array;
         public void setHour(int xhour)
              textHour = xhour;
         public void setMinute(int xminute)
              textMinute = xminute;
         public void stopTimer()
              alarmTimer.cancel();
         public void setupAlarm(String combo, boolean tester)
              if(!tester)
                   if(combo.equals("AM"))
                        seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
                   else
                        seconds = (textHour + 12 - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                        try
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
                        catch(IllegalArgumentException iae)
                             seconds = (24*3600) + seconds;
                             alarmTimer.schedule(new AlarmTask(), seconds*1000);
              else if(tester)
                   seconds = (textHour - timeArray[0])*3600 + (textMinute - timeArray[1]) *60 - timeArray[2];
                   try
                        alarmTimer.schedule(new AlarmTask(), seconds*1000);
                   catch(IllegalArgumentException iae)
                        seconds = (24*3600) + seconds;
                        alarmTimer.schedule(new AlarmTask(), seconds*1000);

  • Need help to create an self running pgm

    Hi Guys,
                 I want to develop an program which should run on midnight 1 everyday n do some deletion of records in database tables i don't want to schedule this program i want to put some logic so that it will run everyday at 1 am. 
                   please help me in the logic .
    points will be rewarded.
    ravi

    hi,
    develop a report program and goto SM36 for scheduling it and assign it as background job. while assigning give time for executing that job. u should also give inputs for the program in the form of variants as ur giving background jobs.
    if any errors u can dfind it there inn SM36 only. it displays the status of our pending jobs , current jobs.........................
    if helpful reward some points.
    With regards,
    Suresh.A

  • Need help in returning error condition from web service

    Hi,
    I need one help regarding webservice. Currently my web service is returning "true" value when it works fine without any issues but it returns "false" when any any error is encountered. So my question is, can we return error instead of string "false". I dont know how to return exact error from webservice. If you any idea then please mail me.
    Below is a small code snippet:
    System.out.println("User "+ userFullName + usrKey + " end date has been updated to "+usrEndDate +" in IDM DB");
    result = true;
    catch (tcAPIException e) {
    log.error("Error in finding the user" + e.getMessage());
    result = false;
    } catch (tcUserNotFoundException e) {
    log.error("Error in getting user status" + e.getMessage());
    result = false;
    } catch (tcStaleDataUpdateException e) {
    log.error("Error in updating end date of user" + e.getMessage());
    result = false;
    }catch (Exception e1) {
    e1.printStackTrace();
    result =false;
    return result;
    Here i want to return error instead of false. Can we do that?
    Thanks,
    Kalpana.

    instead of storing false store below
    use result=e1.getMessage();
    Edited by: Nishith Nayan on Feb 23, 2012 8:07 PM

  • SQL Server 2008 R2 - need help in interpreting output of statistics time on

    Hi,
    Could you please help me to understand how to interpres CPU and Elapsed time
    I ran a query that took  1h 23 min 52 sec to complete.
    My statistics time result hows the following:
    CPU time = 17407152 ms, elapsed time = 5018172 ms.
    Both well exceed 1h 23 min 52 sec if I consider ms to be milliseconds.
    Could you please help me to understand why such mismatch?
    Does ms actually mean milliseconds?
    Thanks,
    Andrei
    SSIS question

    Mostly the query is going for parallelism (running on multiple CPU) and that's why CPU time is more.
    5018172 ms
    5018.172 sec 
    83.6362 min
    1.393936667 hours
    1 hr 23 min (matching with wall clock)
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Need help connecting to a PC (running XP) from a MBP

    I know very little about PCs, and I'm trying to help my brother connect to his PC from his new Mac Book.
    I read the "switch" info about using Finder->Go->Connect To Server... but it doesn't seem to be working for him. I had him "share" his "My Documents" folder on his PC. I then told him to use "smb::/ip-address/". This works for me on my iMac (running Tiger), but for him it just times out trying to connect. He also tried using his PC name "smb://FamilyComputer/", but no dice. One thing that is different from mine. I use WORKGROUP as my workgroup name, he uses MSHOME on his PC. Not sure if that matters. For me, it connects to my PC and lets me pick any shared folder, for him it never connects.
    One last thing, I had him use the same userid/password on both PC and Mac (like I do).
    He's trying to get a lot of pictures transferred over. His CD burner on the PC is not working. He was able to get all of his music over from inside of iTunes, so I know there is network connectivity to the PC (iTunes found the PC's iTunes with out a problem).
    Thanks in advance

    In the Mac open System Preferences->Network pane, "Advanced" button and them click the WINS tab. There change the WINS name to the same one that is on the PC (MSHOME).
    Also maybe the guide (even though it's for 10.5 or later) File Sharing With OS X 10.5 - Introduction to File Sharing With Your Mac. It might help.

  • Need help getting people out of a time lapse

    Okay, this is what I want to do. I have a clip of three guys working on a graffiti artwork. Its 30 minutes long. I want to speed it to a time lapse, but I dont want to show the bodies of the three guys. So the final product would look like the graffiti forming by itself.
    The first thing I tried was to draw an animated 16-point garbage matte following the bodies while the layer below is a still frame of the final product. This will take me forever though. So I tried the time warp effect. I thought I could just blur out the bodies enough so that theyd just look like inconspicuous shadows moving around as the artwork forms. But rendering is a *****. I havent mastered the effect either. I couldnt figure out the proper settings so that the three guys would blur out enough so they wouldnt be too recognizable. (Ghosting doesnt really cut it either.)
    What would be a good idea to get this thing done?
    Really appreciate the help. Thanks!

    My suggestion would be to reshoot another project, but in time lapse using OnLocation. Figure out how long you want the clip to be, and from that how often you'll need to catch a frame. Say it works out to one frame every two minutes. So, every two minutes make sure the artists are out of frame.
    That's the only way I know of to really accomplish the desired end result.

  • Need help with pool leased duration or time out

    Hi , all
    i have a radius server with cisco router.
    my users login by vpdn pppoe and they have internet.
    some of the users has an attribute from radius server to get an ips from the pool.
    but the problem is:
    when the radisus server set an attribute for user (x) to get from pool(y)
    the userx will always get the same ip from the pool ??!!!!
    the question is :
    how let the user each time get another ip from the pool ???
    i dont want to be always same ?

    I think you need to rework elements of your workflow.
    For example, you say the export preset creates and sends the email.
    If this is the case, the the logical place to make your change would be to edit that preset action (I don't have Lightroom to know whether this is an option there or not).
    The problem with using a Folder Action is that the Folder Action will trigger when the file is dropped in the folder, but that will be before the email is generated or sent, so you run the risk of deleting the file before it's sent.
    So if you can't edit the export preset to do the deletion I would suggest decoupling the 'send an email' and 'delete file' elements from the Lightroom action - in other word change Lightroom to just export the file, and have a separate folder action that triggers when files are added to that folder. The folder action script can take care of generating the email and sending it out, knowing when the email is sent and therefore when it's safe to delete the file.
    WIthout seeing more of the current workflow it's not easy to be more specific.

  • Need help getting I-tunes to run on XP

    I have tried most all the tricks listed and still I-tunes will not run on relatively new windows XP, Dell machine (also newly purchased I-pod), - I have disabled virus protection, I have loaded most recent versions of i-tunes, I have cleared temp files and reloaded. I tried loading Q-time player as a stand alone. I deleted old folders of I-tunes and Q-time and reloaded.
    I-tunes down-loads without any error message. the I-pod connects to USB and charges - and shows up as an "E" drive. But clicking on i-tunes icon, or loading audio disk or connecting I-pod all fail to visably launch i-tunes (nothing is seen in task manager after attempting to launch I-tunes - but on shut down of the computer I get the message that I-tunes is not responding and must be shut down manually) (also for grins I tried launching newly loaded Q-time -> I get message saying its loading, but this message never clears). Already 10 hours spent on this

    Hello,
    Unfortunantly, I'm not quite good in JavaScript to give you a good response. But I can you give you an advise, that can help you:
    1. Add a simle system.out.println("Init called!"); message in public void init() method of the servlet RefreshInfo.
    2. Try to access servlet by simple browser request "http://localhost:8080/yourApp/RefreshInfo".
    2. If the message "Init called!" appears in the Tomcat console, your servlet code is correct and the serlet is described properly in web.xml . In this case, the possible problem is in the JavaScript code.
    Good day,
    http://www.myjavaserver.com/~voronetskyy/

Maybe you are looking for

  • IndexOutofBoundsException in TTLCache

    Setup is two BEA WLS6.1sp3 servers running against 1 WLS6.1sp3 server (hosting components) After a few hours of stable operation this error pops up in the Weblogic logs. <Sep 20, 2002 5:05:03 PM CEST> <Error> <Kernel> <ExecuteRequest failed java.lang

  • How many objects to deploy at a time

    I am writing a script to deploy all the objects in an environment. We will use this script when setting up a new environment from scratch. Is there a recommended maximum number of objects to deploy at a time? Writing the script to deploy one object a

  • Are GIF, BMP files not supported?

    Are GIF, BMP formats not supported? When I hit the import button, GIF and BMP files are not displayed. If I put a *.* into the File Name box, then those file types appear. If I select a BMP or GIF and attempt to import it, I get the message "no photo

  • Cost Center - Work Center Table

    Hi! How to get Cost Center from Work Center? . Any Table? Thanks in Advance Bekele

  • Change auc from investement internal order

    hi sap experts, my client has created one internal order with investment profile and assign in auc and now he wants to change the respective auc from internal order. for example They created one Internal order as 70000500 with investment profile earl