Problem with cl_gui_frontend_services execute method

Halo experts ,
I am facing a peculiar problem with  cl_gui_frontend_services execute  .
I am trying to open documents using the method execute of  cl_gui_frontend_services
. But the problem is it is not opening file with space in its name .
ie it is able to open 'for_example.pdf' but not 'for example.pdf'
Any one has idea why it is happening?
Regards
Arshad

HI Arshad...
This does not seems to be a problem of GUI...
bad parameter  exceptions is coming ...  mean you are passing an incorrect parameter ...mean incorrect file name ...or the filename you are passing does not exits in you my documents folder ...
I have executed the same code  ... and it is perfectly working fine ... you have to pass the file name exactly ... that means  if
you are passing L11527110.pdf then the file name should be L11527110.pdf...
if you are passing the parameter as L 11527110.pdf (* with space )   then the file name has to be exactly same ...  other wise ...
the application ACRORD32.EXE  opens  but gives as error ...
please check the file name in my docs and passing parameter value ....
I am giving my code which i did .....
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application ='ACRORD32.EXE'
parameter = 'B CDWBDIC.pdf'
default_directory = 'C:\Documents and Settings\Ritamadmin\My Documents\'
maximized = 'X'
operation = 'OPEN'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
OTHERS = 10.

Similar Messages

  • Problem with the renameTO method in the Linux environment

    Hi
    I got a problem with the renameTO method in the Linux environment. The file is not moving.
    This method is returning false. the same code executed successfully in Windows environment.
    Can anyone give some fix to this one or an alternate solution to move the files in both windows and Linux.
    boolean success;
    File root = new File(tempPath);
                   File f = new File(root, phyFileName);
                   File dest = new File(targetPath);
    success = f.renameTo(new File(dest, actualFileName));actualFileName = 400.doc
    dest = /home/jboss-4.0.3/axsscm_1.0/axsscmDocuments/xchange/fileup/fshare/PO/1786

    JITHENDRA wrote:
    Thanks for the prompt replyNo problem.
    >
    Can u solve the below doubt.
    Will renameTo method wont work in Linux? If so why?Did you not read what I said? I suspect you are trying to rename a file so that it actually has to be moved to a different volume (partition or hard disk) so it won't work. One would have the same problem on Windows trying to rename a file on the c: drive to a name on the d: drive.
    >
    >
    Can u give a sample or good link to do the above work which works fine in all environments.?Just follow the pseudo code I gave. 15 minutes work.

  • TS3297 Why I can't download a free game I get a message that there's a problem with my payment method but not what it is this is a free app I tried support and got nowhere help

    Why can't I down load a free app  I get a message that there is a problem with my payment method but I gave all information correctly , I did recently change my card no because I lost my old one .i did change the no. On my account      HOPE YOU HAVE SOME SUGGESTIONS  I DON'T SEE WHY THEY HAVE TO CHECKMY PAYMENT METHOD FOR A FREE GAME

    Contact iTunes customer support.
    We're all users like yourself and as such have no access to your account.

  • Getting problem with DOMImplementation classes method getFeature() method

    hi
    getting problem with DOMImplementation classes method getFeature() method
    Error is cannot find symbol getFeature()
    code snippet is like...
    private void saveXml(Document document, String path) throws IOException {
    DOMImplementation implementation = document.getImplementation();
    DOMImplementationLS implementationLS = (DOMImplementationLS) (implementation.getFeature("LS", "3.0"));
    LSSerializer serializer = implementationLS.createLSSerializer();
    LSOutput output = implementationLS.createLSOutput();
    FileOutputStream stream = new FileOutputStream(path);
    output.setByteStream(stream);
    serializer.write(document, output);
    stream.close();
    problem with getFeature() method

    You are probably using an implementation of DOM which does not implement DOM level-3.

  • Problems with the dispatchEvent-Methode

    Hallo,
    I have a strange problem with above mentioned methode
    I have a JTextField, and I want that only numeric inputs are
    accepted, so I used a KeyListener -Interface in the following way
    public void keyTyped(KeyEvent e)
    JTextField field =(JTextField)e.getSource();
    char c =e.getKeyChar();
    if(c>57 | c<46 |c==47 &&c >31)
    field.dispatchEvent(e);
    the other methodes keyPressed and keyReleased are implemented in the same way.
    So if I type in now in my JTextField an 'a' or whatsoever
    then the following Exception occurs:
    java.lang.StackOverflowError
    at java.awt.Toolkit.getEventQueue(Toolkit.java:1483)
    at java.awt.EventQueue.setCurrentEventAndMostRecentTime(EventQueue.java:731)
    at java.awt.Component.dispatchEventImpl(Component.java:3448)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    Mmh, and this is not the whole Exception message.
    There are missing a couple of lines.
    But may be one of you knows what my mistake is.
    Thanks advance.

    This is not the best way to validate for numerics. Check out the "Creating a Validated Text Field" section from the Swing tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html#validation

  • Problem with a template method in JDialog

    Hi friends,
    I'm experiencing a problem with JDialog. I have a base abstract class ChooseLocationDialog<E> to let a client choose a location for database. This is an abstract class with two abstract methods:
    protected abstract E prepareLocation();
    protected abstract JPanel prepareForm();Method prepareForm is used in the constructor of ChooseLocationDialog to get a JPanel and add it to content pane.
    Method prepareLocation is used to prepare location of a database. I have to options - local file and networking.
    There are two subclasses ChooseRemoteLocationDialog and ChooseLocalFileDialog.
    When I start a local version, ChooseLocalFileDialog with one input field for local file, everything works fine and my local client version starts execution.
    The problem arises when I start a network version of my client. Dialog appears and I can enter host and port into the input fields. But when I click Select, I get NullPointerException. During debugging I noticed that the values I entered into these fields ("localhost" for host and "10999" for port) were not set for corresponding JTextFields and when my code executes getText() method for these input fields it returns empty strings. This happens only for one of these dialogs - for the ChooseRemoteLocationDialog.
    The code for ChooseLocationDialog class:
    public abstract class ChooseLocationDialog<E> extends JDialog {
         private E databaseLocation;
         private static final long serialVersionUID = -1630416811077468527L;
         public ChooseLocationDialog() {
              setTitle("Choose database location");
              setAlwaysOnTop(true);
              setModal(true);
              Container container = getContentPane();
              JPanel mainPanel = new JPanel();
              //retrieving a form of a concrete implementation
              JPanel formPanel = prepareForm();
              mainPanel.add(formPanel, BorderLayout.CENTER);
              JPanel buttonPanel = new JPanel(new GridLayout(1, 2));
              JButton okButton = new JButton(new SelectLocationAction());
              JButton cancelButton = new JButton(new CancelSelectAction());
              buttonPanel.add(okButton);
              buttonPanel.add(cancelButton);
              mainPanel.add(buttonPanel, BorderLayout.SOUTH);
              container.add(mainPanel);
              pack();
              Toolkit toolkit = Toolkit.getDefaultToolkit();
              Dimension screenSize = toolkit.getScreenSize();
              int x = (screenSize.width - getWidth()) / 2;
              int y = (screenSize.height - getHeight()) / 2;
              setLocation(x, y);
              addWindowListener(new WindowAdapter() {
                   @Override
                   public void windowClosing(WindowEvent e) {
                        super.windowClosing(e);
                        System.exit(0);
         public E getDatabaseLocation() {
                return databaseLocation;
         protected abstract E prepareLocation();
         protected abstract JPanel prepareForm();
          * Action for selecting location.
          * @author spyboost
         private class SelectLocationAction extends AbstractAction {
              private static final long serialVersionUID = 6242940810223013690L;
              public SelectLocationAction() {
                   putValue(Action.NAME, "Select");
              @Override
              public void actionPerformed(ActionEvent e) {
                   databaseLocation = prepareLocation();
                   setVisible(false);
         private class CancelSelectAction extends AbstractAction {
              private static final long serialVersionUID = -1025433106273231228L;
              public CancelSelectAction() {
                   putValue(Action.NAME, "Cancel");
              @Override
              public void actionPerformed(ActionEvent e) {
                   System.exit(0);
    }Code for ChooseLocalFileDialog
    public class ChooseLocalFileDialog extends ChooseLocationDialog<String> {
         private JTextField fileTextField;
         private static final long serialVersionUID = 2232230394481975840L;
         @Override
         protected JPanel prepareForm() {
              JPanel panel = new JPanel();
              panel.add(new JLabel("File"));
              fileTextField = new JTextField(15);
              panel.add(fileTextField);
              return panel;
         @Override
         protected String prepareLocation() {
              String location = fileTextField.getText();
              return location;
    }Code for ChooseRemoteLocationDialog
    public class ChooseRemoteLocationDialog extends
              ChooseLocationDialog<RemoteLocation> {
         private JTextField hostField;
         private JTextField portField;
         private static final long serialVersionUID = -2282249521568378092L;
         @Override
         protected JPanel prepareForm() {
              JPanel panel = new JPanel(new GridLayout(2, 2));
              panel.add(new JLabel("Host"));
              hostField = new JTextField(15);
              panel.add(hostField);
              panel.add(new JLabel("Port"));
              portField = new JTextField(15);
              panel.add(portField);
              return panel;
         @Override
         protected RemoteLocation prepareLocation() {
              String host = hostField.getText();
              int port = 0;
              try {
                   String portText = portField.getText();
                   port = Integer.getInteger(portText);
              } catch (NumberFormatException e) {
                   e.printStackTrace();
              RemoteLocation location = new RemoteLocation(host, port);
              return location;
    }Code for RemoteLocation:
    public class RemoteLocation {
         private String host;
         private int port;
         public RemoteLocation() {
              super();
         public RemoteLocation(String host, int port) {
              super();
              this.host = host;
              this.port = port;
         public String getHost() {
              return host;
         public void setHost(String host) {
              this.host = host;
         public int getPort() {
              return port;
         public void setPort(int port) {
              this.port = port;
    }Code snippet for dialog usage in local client implementation:
    final ChooseLocationDialog<String> dialog = new ChooseLocalFileDialog();
    dialog.setVisible(true);
    location = dialog.getDatabaseLocation();
    String filePath = location;Code snippet for dialog usage in network client implementation:
    final ChooseLocationDialog<RemoteLocation> dialog = new ChooseRemoteLocationDialog();
    dialog.setVisible(true);
    RemoteLocation location = dialog.getDatabaseLocation();Exception that I'm getting:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at suncertify.client.gui.dialog.ChooseRemoteLocationDialog.prepareLocation(ChooseRemoteLocationDialog.java:42)
         at suncertify.client.gui.dialog.ChooseRemoteLocationDialog.prepareLocation(ChooseRemoteLocationDialog.java:1)
         at suncertify.client.gui.dialog.ChooseLocationDialog$SelectLocationAction.actionPerformed(ChooseLocationDialog.java:87)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:6134)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
         at java.awt.Component.processEvent(Component.java:5899)
         at java.awt.Container.processEvent(Container.java:2023)
         at java.awt.Component.dispatchEventImpl(Component.java:4501)
         at java.awt.Container.dispatchEventImpl(Container.java:2081)
         at java.awt.Component.dispatchEvent(Component.java:4331)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
         at java.awt.Container.dispatchEventImpl(Container.java:2067)
         at java.awt.Window.dispatchEventImpl(Window.java:2458)
         at java.awt.Component.dispatchEvent(Component.java:4331)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
         at java.awt.Dialog$1.run(Dialog.java:1046)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)java version "1.6.0"
    OpenJDK Runtime Environment (build 1.6.0-b09)
    OpenJDK Client VM (build 1.6.0-b09, mixed mode, sharing)
    OS: Ubuntu 8.04
    Appreciate any help.
    Thanks.
    Edited by: spyboost on Jul 24, 2008 5:38 PM

    What a silly error! I have to call Integer.parseInt instead of getInt. Integer.getInt tries to find a system property. A small misprint, but a huge amount of time to debug. I always use parseInt method and couldn't even notice that silly misprint. Sometimes it's useful to see the trees instead of whole forest :)
    It works perfectly. Sorry for disturbing.

  • Problem with calling onApplicationStart() method

    Hi all,
         I have a problem with calling application.cfc's methods from coldfusion template. The problem is like when i am calling "onapplicationstart" method inside a cfml template i getting the error shown below
    The onApplicationStart method was not found.
    Either there are no methods with the specified method name and argument types or the onApplicationStart method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
    My code is like below.
    Application.cfc
    <cfcomponent hint="control application" output="false">
    <cfscript>
    this.name="startest";
    this.applicationtimeout = createtimespan(0,2,0,0);
    this.sessionmanagement = True;
    this.sessionTimeout = createtimespan(0,0,5,0);
    </cfscript>
    <cffunction name="onApplicationStart" returnType="boolean">
        <cfset application.myvar = "saurav">
    <cfset application.newvar ="saurav2">
        <cfreturn true>
    </cffunction>
    </cfcomponent>
    testpage.cfm
    <cfset variables.onApplicationStart()>
    I have tried to call the above method in different way also like
    1--- <cfset onApplicationStart()>
    i got error like this
    Variable ONAPPLICATIONSTART is undefined.
    2---<cfset Application.onApplicationStart()>
    The onApplicationStart method was not found.
    Either there are no methods with the specified method name and argument types or the onApplicationStart method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity
    Please help me out.
    Thanks
    Saurav

    You can't just call methods in a CFC without a reference to that CFC. This includes methods in Application.cfc.
    What are you trying to do, exactly, anyway? You'd probably be better served by placing a call to onApplicationStart within onRequestStart in Application.cfc, if your goal is to refresh the application based on some condition:
    <cffunction name="onRequestStart">
         <cfif someCondition>
              <cfset onApplicationStart()>
         </cfif>
    </cffunction>
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • Problem with a string method

    Hello, I am working on a program that converts Roman numerals to Arabic numbers and the opposite. I have the Arabic to Roman part down, yet Roman to Arabic part is causing troubles for me.
    I know that there are many solutions out there, yet I would like just solutions within my code that would fix the problem it has.
    Instead of the whole code, here's the method that changes Roman to Arabic.
         //method to convert Roman numerals to Arabic numbers
         public static int toArabic (String x)
              int arabica=0;
              char chars;
              for (int y=0; y<=(x.length()-1); y++)
                   chars=x.charAt(y);
                   switch (chars)
                        case 'C':
                             if( x.length() == 1)
                                  arabica+=100;
                                  y++;
                             else if (x.charAt(y+1)=='M')
                                  arabica+=900;
                                  y++;
                             else if (x.charAt(y+1)=='D')
                                  arabica+=400;
                                  y++;
                             else
                                  arabica+=100;
                             break;
                        case 'X':
                             if(x.length() == 1)
                                  arabica+=10;
                                  y++;
                             else if (x.charAt(y+1)=='C')
                                  arabica+=90;
                                  y++;
                             else if (x.charAt(y+1)=='L')
                                  arabica+=40;
                                  y++;
                             else
                                  arabica+=10;
                             break;
                        case 'I':
                             if(x.length() == 1)
                                  arabica+=1;
                                  y++;
                             else if (x.charAt(y+1)=='X')
                                  arabica+=9;
                                  y++;
                             else if (x.charAt(y+1)=='V')
                                  arabica+=4;
                                  y++;
                             else
                                  arabica++;
                             break;
                        case 'M':
                             arabica+=1000;
                             break;
                        case 'D':
                             arabica+=500;
                             break;
                        case 'L':
                             arabica+=50;
                             break;
                        case 'V':
                             arabica+=5;
                             break;
    There's a problem with this, however, is that whenever I put something in like XX, CC, XXX, or II, the program says
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
    at java.lang.String.charAt(String.java:687)
    at RomanNumerals.toArabic(RomanNumerals.java:172)
    at RomanNumerals.main(RomanNumerals.java:33)
    I think this problem is caused by the if-else and else-if statements in my method for cases C, X, and I, as this problem doesn't come up when I do similar things to cases without the if statements. Could you perhaps find out what is causing this problem? I've been working on it for days after finishing the rest and I can't figure it out.
    Thanks

    import java.io.*;
    public class RomanNumerals{
              public static void main (String [] args)
              DataInput keyboard=new DataInputStream (System.in);
              String input;
              try
                   //options
                   System.out.println("1. Roman numerals to Arabic numbers");
                   System.out.println("2. Arabic numbers to Roman numerals");
                   System.out.println("3. Exit");
                   System.out.print("Enter your option: ");
                   input=keyboard.readLine();
                   int choice=Integer.parseInt(input);
                   switch (choice)
                        //Roman numerals to Arabic numbers
                        case 1:
                             String romanInput, ro;
                             int answer1;
                             System.out.print("Enter a Roman numeral: ");
                             romanInput=keyboard.readLine();
                             ro=romanInput.toUpperCase();
                             answer1=toArabic(ro); //line 33 where the error occurs
                             System.out.println("The Arabic number is: "+answer1);
                             break;
                        //Arabic numbers to Roman numerals
                        case 2:
                             String arabicInput, answer;
                             System.out.print("Enter an Arabic number: ");
                             arabicInput=keyboard.readLine();
                             int arabic=Integer.parseInt(arabicInput);
                             answer=toRomans(arabic);
                             System.out.println("The Roman numeral is: "+answer);
                             break;
                        case 3:
                             break;
                        default:
                             System.out.println("Invalid option.");
              catch(IOException e)
                   System.out.println("Error");
                   //method to convert Arabic numbers to Roman numerals
         public static String toRomans (int N)
              String roman="";
              while (N>=1000)
                   roman+="M";
                   N-=1000;
              while (N>=900)
                   roman+="CM";
                   N-=900;
              while (N>=500)
                   roman+="D";
                   N-=500;
              while (N>=400)
                   roman+="CD";
                   N-=400;
              while (N>=100)
                   roman+="C";
                   N-=100;
              while (N>=90)
                   roman+="XC";
                   N-=90;
              while (N>=50)
                   roman+="L";
                   N-=50;
              while (N>=40)
                   roman+="XL";
                   N-=40;
              while (N>=10)
                   roman+="X";
                   N-=10;
              while (N>=9)
                   roman+="IX";
                   N-=9;
              while (N>=5)
                   roman+="V";
                   N-=5;
              while (N>=4)
                   roman+="IV";
                   N-=4;
              while (N>=1)
                   roman+="I";
                   N-=1;
              return(roman);
         //method to convert Roman numerals to Arabic numbers
         public static int toArabic (String x)
              int arabica=0;
              char chars;
              for (int y=0; y<=(x.length()-1); y++)
                   chars=x.charAt(y);
                   switch (chars)
                        case 'C':
                             if( x.length() == 1)
                                  arabica+=100;
                                  y++;
                             else if (x.charAt(y+1)=='M')
                                  arabica+=900;
                                  y++;
                             else if (x.charAt(y+1)=='D')
                                  arabica+=400;
                                  y++;
                             else
                                  arabica+=100;
                             break;
                        case 'X':
                             if(x.length() == 1)
                                  arabica+=10;
                                  y++;
                             else if (x.charAt(y+1)=='C')   //the line 172 where error occurs
                                  arabica+=90;
                                  y++;
                             else if (x.charAt(y+1)=='L')
                                  arabica+=40;
                                  y++;
                             else
                                  arabica+=10;
                             break;
                        case 'I':
                             if(x.length() == 1)
                                  arabica+=1;
                                  y++;
                             else if (x.charAt(y+1)=='X')
                                  arabica+=9;
                                  y++;
                             else if (x.charAt(y+1)=='V')
                                  arabica+=4;
                                  y++;
                             else
                                  arabica++;
                             break;
                        case 'M':
                             arabica+=1000;
                             break;
                        case 'D':
                             arabica+=500;
                             break;
                        case 'L':
                             arabica+=50;
                             break;
                        case 'V':
                             arabica+=5;
                             break;
              return(arabica);
         }When I put in XX as the input, this is what the error comes out as:
    Enter a Roman numeral: XX
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
        at java.lang.String.charAt(String.java:687)
        at RomanNumerals.toArabic(RomanNumerals.java:172)
        at RomanNumerals.main(RomanNumerals.java:33)

  • [SOLVED][GRUB]Install problem with the new method

    Hi,
    it is not my first install of Arch Linux but I have a problem with this new kind of installation method, especially with GRUB.
    Here is my hard drives configuration :
    /dev/sda1 -> SSD 120 GB ntfs (windows)
    /dev/sdb1 -> HD 1 TB ext4 (data)
    /dev/sdc :
    /dev/sdc1 -> ext2 /boot
    /dev/sdc2 -> swap
    /dev/sdc3 -> ext4 /
    /dev/sdc5 -> ext4 /home
    During the installation, I installed grub (with grub-install) in /dev/sdc. I assumed it was the correct drive to install it but apparently not, Windows starts automatically and I don't have the grub menu.
    Should I install my system again or is there a way to boot on the livecd and install it ?
    Should I :
    1) mount /dev/sdc3 in /mnt then /dev/sdc1 in /mnt/boot and finally /dev/sdc5 in /mnt/home
    2) pacstrap /mnt grub-bios
    3) arch-chroot
    4) grub-install
    Thank you.
    Last edited by hiveNzin0 (2012-09-12 06:15:15)

    DSpider wrote:
    If you set whatever drive "/dev/sdc" is (brand and model) to boot first in the BIOS, all you need to do is install a bootloader on Arch. You don't even need a separate boot partition. It will use the /boot folder on root partition. Then install os-prober (if you don't already have this installed) and re-generate the .cfg.
    https://wiki.archlinux.org/index.php/Be … bootloader
    The problem is that I cannot select another hard drive. The only one available for the boot order is the Samsung 830 series (/dev/sda with Windows).
    The other options are the CD drive and removable disk.
    I checked that this morning, maybe I was too tired. I will check again this evening.
    But if I am right and I cannot select my intel SSD (containing my arch setup) for the boot order, would the solution I described work ? I don't see why not but my knowledge are basic in Linux.
    Thank you again for your help.

  • Problems with installer/executable files

    I created an installer with an executable file so I can run my program on another computer that does not have labview. I went ahead and installed all the drivers on the target computer and I installed 8.2.1 Runtime Engine as well as NI-VISA Runtime engine. My program tests circuit boards which are connected to the the various modules and the target computer will be used on the manufacturing floor allowing employees to test circuit boards but not being able to mess up my program which is why I figured the stand alone is the way to go. The main problem I am coming across right now is that when the DAQ modules arent even connected to the usb port of the computer the executable is still running and saying the test passed which is very bad in the case on the manufacturing floor because boards could be sent out that have failures. I dont understand why when the DAQ isnt hooked to the computer the exe still runs when I feel like it shouldnt. Is there some function I can put in my program to make sure there is a signal being sent to the computer whether it is connected or not?? The actual program wont run if its not connected because it does not detect the modules which is good. What also confuses me is that when the DAQ modules are connected to the developer computer and the executable runs the circuit board test fails, BUT if the DAQ modules are connected to the target computer and the executable runs the circuit board test passes like before when the modules arent even connected...it makes me think there is something else I need to install on the target computer...

    What you have set up only detects unit under test errors. There could be logic/programming errors or external hardware errors. The subVIs are not working if there is no hardware. They are returning an error and the Boolean state of the read should be ignored. The subVIs will always return something, even if it's a default value.
    Shown below is some of simple optiopns you have for error handling. Look through the shipping examples. You will see a lot in them as well.
    Message Edited by Dennis Knutson on 04-08-2009 12:38 PM
    Attachments:
    Error Handling Options.PNG ‏6 KB

  • Problem with not executed include

    Hi all,
    I've a problem with my include in production system. Whole story looks like this. We have product from 3rd company so this is not z-namespace. There are some places in which we can add our own code - function module with not existing z-include. This FM is called with CALL FUNCTION statement, not CALL CUSTOMER-FUNCTION, so there are no CMOD entries to modify. I've created this include and implemented my functionality. Unfortunatelly my code in production is sometimes executed and sometimes not. What I've observed is that when include is not executed debugger steps over it (it goes in to FM but ignores include) and what is more funny I'm not able to set breakpoint in this include (I'm getting a message that ithis is not possible). 2 Minutes later everything works (I can set break point and include is executed) although I didn't do anything (no activation). I've transported once more all transports from development to production without any change. I didn't observe this behavior in development or test systems, but to be honest I didn't do so many tests to be sure that problem is only in production.
    I suspect that there is something wrong with 3rd party product, but I'm not 100% sure. Did anyone has this kind of problem?
    Best Regards
    Marcin Cholewczuk

    hi,
    I've transported once more all transports from development to production without any change.
    you could not  activate debugger because  . during transporting object from dev to prd  all the object where not transported correctly  .  and some times  the include  which gets created has there namespace registered in repository objects , so when you re transported that request  it corrected those entries  .
    regards
    Deepak.

  • FileWriter problem with my toptenScores method!!!

    Hey ya'll -- i'm STILLLLLL writing this dumb trivia program. I'm now having a problem with the FileWriter - that writes the final scores BACK to the toptenFile.
    I'm hoping all these troubles are just growing pains of my first "big" program (big for me) - BUT I WORKED on this honker all night last night and into this afternoon and I am at my wits end!
    I am posting the writing portion below hoping I am just missing something, but if you guys need the whole code let me know -- and below this code I will show the error I am getting as it trys to write to the file. ---
    if (questionsMissed == 3 )
    if (score > topScoresInt[0])
    String name = JOptionPane.showInputDialog(null,
    "GAME OVER. Your score is " + score + "\n Please enter you initials - no spaces", // Message to display
    "You got a High Score!", JOptionPane.INFORMATION_MESSAGE);
    try {
    BufferedWriter bw=new BufferedWriter(new FileWriter(toptenFile)); String[] scorestoFile = new String[10];
    scoreToFile[0] = (score + " " + name);
    bw.write(scoreToFile[0] + "\n");
    for (i=1; i<=9; i++)
    bw.write(scoreToFile[i] + "\n");
    bw.close();
    System.exit(0);
    } catch (IOException ex) {
    ex.printStackTrace();
    HERE IS THE ERROR WHEN IT TRIES TO WRITE TO THE FILE
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at java.io.Writer.write(Writer.java:126)
    at TriviaGame$answerButtonHandler.actionPerformed(TriviaGame.java:299)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener$Actions.actionPerformed(BasicButtonListener.java:285)
    at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1571)
    at javax.swing.JComponent.processKeyBinding(JComponent.java:2763)
    at javax.swing.JComponent.processKeyBindings(JComponent.java:2798)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2726)
    at java.awt.Component.processEvent(Component.java:5265)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636)
    at java.awt.Component.dispatchEventImpl(Component.java:3841)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Window.dispatchEventImpl(Window.java:1774)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    OK - that helped me!
    I was making the string because I had to stringify the sorting class that I had made earlier -- BUT I FORGOT to stringify -- this is the code I had left out.
    for (i=1; i<=9; i++)
    scoreToFile = top{i}.toString();
    bw.write(scoreToFile[i] + "\n");
    NOW THAT SOLVED EVERYTHING BUT ONE MORE THING!!!!
    IT now writes to the file just fine but I CANT get it to give me a new line -- it is writing everything on one line.... (see how I tried an line break above? -- didnt work) -- any help on getting a line break?
    ** BTW - I just found out and BEFORE you jump on this -- I HAD to change the Arrays above to {i} from the bracket i because it was making it ITALICS and not showing it -- so disregard the curly brace syntax issue above please.
    Message was edited by:
    tvance929

  • Problem with seting action method to a Hyperlink object

    Hi there,
    as the subject says, I have a problem wih setting the action method of a Hyperlink object. Here is how the program is organized:
    I have an external bean which generates an ArrayList of Hyperlink objects. In the backing bean of my web page I call a method from the above mentioned external bean to generate the list of hyperlink objects. After that in the page bean I insert the hyperlink objects in GridPanel component. So far everything works fine, but the action method of the Hyperlink objects is not called and I can't understant why.
    Here is how I add the objects to the GridPanel component:
    private void populateGridPanel()
            Hyperlink hyper;
            for(int i=0; i< checkboxList.size(); i++)
                    hyper = (Hyperlink) hyperlinkList.get(i);
                    vehicleGridPanel.getChildren().add(hyper);
        }All properties of the Hyperlink objects are set in the external bean not in the page bean, here is how:
    //action method executed when the hyperlink is clicked
    MethodBinding mb = (MethodBinding) FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{Page1.hyperlink_action}", null);
    veHyperlink.setAction(mb);The populateGridPanel() method is called in the init() method of the page bean, after the initialization of all other components.
    An interesting fact is that if I manually drag-n-drop a hyperlink object to my page and programatically set its action method with the code above everything works fine. But using the same code for the dynamically generated hyperlink objects inserted in the grid panel doesn't work.
    Any kind of help is highly appreciated.
    Thanks!
    Message was edited by:
    panayot

    I got this use case to work as follows:
    1. Drag a Grid Panel and set its columns property to 1.
    2. Drag a Message Group.
    3. Use the following code in Page1:
    public void prerender() {
    populateGridPanel();
    private void populateGridPanel() {
    if (gridPanel1.getChildren().size() > 0) {return;}
    for (int i = 0; i < 3; i++) {
    Hyperlink veHyperlink = new Hyperlink();
    //action method executed when the hyperlink is clicked
    MethodBinding mb = (MethodBinding) FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{Page1.hyperlink_action}", null);
    veHyperlink.setAction(mb);
    veHyperlink.setText("dynamic hyperlink " + i);
    veHyperlink.setId("dynamicHyperlink" + i);
    gridPanel1.getChildren().add(veHyperlink);
    public void hyperlink_action() {
    info("Yup it worked at: " + new java.util.Date());
    4. Fix imports, Run, and then click on the hyperlinks.

  • Problem with JSObject.getWindow() method - Please Help

    I have a small Apllet that has a button that calls a Javascript function in the opening window, to close the window in which it is loaded.
    The Applet window is a PopUp window from one of my application's window. First time I start my application and load that Applet the button works fine. It calls the Javascript method and the Method closes the window using the window.close() method.
    But now if I open the applet window again and click on the button to close the windows, it hangs. I put in trace statements and saw that it hangs on JSObject.getWindow() window.
    I am using JDK Plugin 1.2.2, testing in IE 6.0 with no microsoft JVM.
    Please, if somebody could give me some clue about why this would happen, I will really appreciate that. I have been stuck into this problem for last three days.

    Hello,
    I have the same problem as you have had. I am using a Flash GUI to control a Java 1.4.2_04 applet via JavaScript. The Java applet appears on 50 html pages within a web-based training. It works fine on IE 6.0 and NS 7.1 when I view only one of the applet pages. But when I turn e.g. from the 10th to the 11th page, the browser crashes due to a fatal exeption in vbscript.dll (IE) or xpconnect.dll (NS). Sometimes I can view 50 or more pages without problems, but the browser crashes far too often. (When I use the applet's own GUI to control it, I can view it on as many pages as I want without any problems).
    5 times per second Flash calls a JavaScript function, which calls a Java function, which returns a value (indicating the state of the applet), which JavaScript uses to set a Flash variable. Java never calls a JavaScript function. On IE I used VB Script to enable Flash to JavaScript communication.
    Is liveconnect buggy? Have you found a solution of the problem?

  • Problem with Linux executable in solaris

    Hello
    I have a problem. We have sunblade workstation with OS solaris 2.8 version. I have downloaded a program which is developed under RedHat 5.1 and complied with Egcs-1.0.2. when i execute this program i am getting the message like bash: ./Al: cannot execute binary file
    I would be thankfull if someone tell me how to solve the problem.
    Thanks Raji

    You need lxrun do be able to run Linux binaries on Solaris x86. You can get it at
    http://soldc.sun.com/freeware/details/detail_lxrun_0.9.6.1_8_Intel.html
    I've never used it, so please post your results here.

Maybe you are looking for

  • Color difference in web gallery

    I am having trouble matching color from my images in Bridge or PS (CS4) to the photos that appear when I make a web gallery using CS4.   The photos have been converted to sRGB and look vivid in Bridge or Photoshop.  However when they are converted in

  • Problem in French translation while writing a file on application server

    I am writing some text symbols to a file on application server using Transfer statement. But for some french characters the data is not transleted correctly. I have maintained the french translation for these text symbols.

  • Not able to execute DBMS_AUTO_TASK_ADMIN.ENABLE

    Hi, I am getting following error, when I tried to enable the DBMS_AUTO_TASK_ADMIN package for 'auto optimizer stats collection'. My user account has DBA, IMP_FULL_DATABASE, DATAPUMP_IMP_FULL_DATABASE roles. I am not a SYS user. There was a grants and

  • Problem calling function inside a procedure

    I have a procedure that simply calls a function, but I'm not sure how to declare it. When I run my script oracle returns an error: CREATE OR REPLACE PROCEDURE pr_entrada_close(      var_id_entrada int) AS BEGIN      fn_criaJobAnalise(var_id_entrada);

  • Very weird ORA-06502 error while creating procedure

    Hi All, i try to create the following procedure (on a 10.2 database): create or replace procedure audit_report as cursor c_audit_user (b_start_date date, b_end_date date) is select user_id , os_user , session_id , host , last_program , last_action ,