Throwing NumberFormat exception

iam using this code but it is throwing NumberFormatException can anybody help thanks in advance.
int p_in_size=Integer.parseInt(request.getParameter("p_init_size"));

"p_init_size" is either the wrong name or it contains non-numeric data.
Try printing out request.getParameter("p_init_size") before the parseInt to see what data it is actually getting.

Similar Messages

  • Handling Consecutive NumberFormat Exceptions

    I have written a Binary Search Program for which I am asking the user to enter the size and the elements of the array.
    If the user enters the size say 5
    Now he can enter up to a max of 5 max numbers to populate the array.
    If the user enters an alphabet it should not be accepted and it would throw an exception and its caught properly for the first time and the user is asked to enter the number again. Now again if the user enters an alphabet my program is not robust enuf to throw an error to the user and continue the user to enter a number from that point. How do i handle such exceptional conditions.
    import java.util.Arrays;
    import javax.swing.JOptionPane;
    public class BinarySearch {
         public static void main(String[] args) {
              String n = JOptionPane.showInputDialog(null, "Enter the size of the array");
              int size = Integer.parseInt(n);
              int a[] = new int[size];
              int i = 0;
              while(i < size){
                   String arrayn = JOptionPane.showInputDialog(null, "Enter the "+(i+1)+" th element of the array");
                   try{
                        a[i] = Integer.parseInt(arrayn);
                   }catch (Exception e){
                        arrayn = JOptionPane.showInputDialog(null, "Enter the "+(i+1)+" th element of the array");
                        a[i] = Integer.parseInt(arrayn);
                   i++;
              System.out.print("The elements of the array are : ");
              for(int j = 0; j < size; j++){
                   System.out.print(a[j]+"  ");     
              Arrays.sort(a);               //Sorting the numbers for Binary Search
              System.out.println();
              System.out.print("The Sorted elements of the array are : ");
              for(int j = 0; j < a.length; j++){
                   System.out.print(a[j]+"  ");     
              String key = JOptionPane.showInputDialog(null, "Enter the element to search for from the array");
              int searchKey = Integer.parseInt(key);
              int position = binarySearch(a, searchKey);
              System.out.println();
              if(position == -1){
                   System.out.println("The element could not be found");
              }else{
                   System.out.println("The element found at "+position+"th position of the array");
         public static int binarySearch(int a[], int searchKey){
              int low, high, middle;
              int index = -1;
              low = 0;
              high = a.length - 1;
              middle = (low + high + 1) / 2;
              do{
                   if(searchKey == a[middle]){
                        return middle;
                   }else if(searchKey < a[middle]){
                        high = middle -1;
                   }else{
                        low = middle + 1;
                   middle = (low + high + 1) / 2;
              }while(low <=high && (index == -1));
              return index;
    }Message was edited by:
    hemanthjava

    Hi,
    I made the changes. I am getting NumberFormat Error for the size even after making a change.
    int k = 0;
              while(k < 1){
                   try{
                        n = JOptionPane.showInputDialog(null, "Enter the size of the array");
                        k++;
                   }catch (Exception e) {
                        System.out.println("Please enter a number for size");
                        continue;
    Exception in thread "main" java.lang.NumberFormatException: For input string: "j"
         at java.lang.NumberFormatException.forInputString(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
         at BinarySearch.main(BinarySearch.java:19)
    Message was edited by:
    hemanthjava

  • Help with New NumberFormat Exception

    Hello. I'm new to java and I can't figure this out. I'm trying to prevent customers from entering a negative value for the quantity or price with a (quantity <= 0)New NumberFormat Exception but it's not working. The negative values are being calculated in the grand total giving impossible results. -$4.50 can't be. How can I fix this problem?
    Is this the right forum for my question? If its not, please move this away.
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Date;
    import java.text.*;
    import java.text.DecimalFormat;
    public class BookOrderApplet extends Applet implements ActionListener
         //Declare variables.
         String Title, Author, answer;
         int quantity, numBooks, numTrans;
         double price, lastTot, subTotal, shipping, salesTax, total;
         //Create Date.
         Date currentDate = new Date();
         //Create Labels.
         Label dateLabel = new Label("" + currentDate);
         Label lblBookTitle = new Label("Book Title: ");
         Label lblAuthor = new Label("Author:");
         Label lblPrice = new Label("Price");
         Label lblQuantity = new Label("Quantity:");
         Label lblNumberOfLastTransactions = new Label("Number of Tansactions: 0");
         Label lblLastItemTotal = new Label("Last Item Total: 0");
         Label lblNumberOfBooks = new Label("Number of Books: 0");
         Label lblSubTotal = new Label("Subtotal: 0");
         Label lblSalesTax = new Label("Sales Tax: 0");
         Label lblShipping = new Label("Shipping: 0");
         Label lblOrderTotal = new Label("Order Total: 0");
         //Create TextFields.
         TextField txtTitle = new TextField(13);
         TextField txtAuthor = new TextField(13);
         TextField txtPrice = new TextField(20);
         TextField txtQuantity = new TextField(20);
         TextArea statusArea = new TextArea();
         //Create Buttons.
         Button calcButton = new Button("Calculate Total");
         Button resetButton = new Button("Reset Form");
         //Constructing the interface.
         public void init()
              //Add Labels.
              add(dateLabel);
              add(lblBookTitle);
              add(lblAuthor);
              add(lblQuantity);
              add(lblPrice);
              add(lblNumberOfLastTransactions);
              add(lblLastItemTotal);
              add(lblNumberOfBooks);
              add(lblSubTotal);
              add(lblSalesTax);
              add(lblShipping);
              add(lblOrderTotal);
              //Add Fields.
              add(txtTitle);
              add(txtAuthor);
              add(txtQuantity);
              add(txtPrice);
              //Add buttons.
              add(calcButton);
              add(resetButton);
              add(statusArea);
              setBackground(Color.white);
              statusArea.getPreferredSize();
              calcButton.addActionListener(this);
              resetButton.addActionListener(this);
         public void actionPerformed(ActionEvent e)
              if(e.getSource() == calcButton)
                   Title = txtTitle.getText();
                   Author = txtAuthor.getText();
                   quantity = getQuant();
                   price = getPrice();
                   transCount();
                   lastTot();
                   numBooks();
                   subTotal();
                   salesTax = salesTax();
                   shipping = shipping();
                   total = total();
                   answer = outFormat();
              else
              //resetButton should clear all the fields.
                        txtTitle.setText("");
                        txtAuthor.setText("");
                        txtQuantity.setText("");
                        txtPrice.setText("");
                        lblNumberOfLastTransactions.setText("Number of Tansactions: 0");
                        lblLastItemTotal.setText("Last Item Total: 0");
                        lblNumberOfBooks.setText("Number of Books: 0");
                        lblSubTotal.setText("Subtotal: 0");
                        lblSalesTax.setText("Sales Tax: 0");
                        lblShipping.setText("Shipping: 0");
                        lblOrderTotal.setText("Order Total: 0");
                        statusArea.setText("");
         //Prevent user from entering invalid quanity numbers.
         public int getQuant()
              try
                   quantity = Integer.parseInt(txtQuantity.getText());
                   if (quantity <= 0) throw new NumberFormatException();
              catch (NumberFormatException g)
                   statusArea.setText("Please enter a valid number for quantity.");
              return quantity;
         //Prevent user from entering invalid price numbers.
         public double getPrice()
              try
                    price = Double.parseDouble(txtPrice.getText());
                    if(price <= 0) throw new NumberFormatException();
              catch (NumberFormatException h)
                   statusArea.setText("Please enter a valid number for price.");
              return price;
         //Add up the number of transactions.
         public void transCount()
              numTrans = numTrans + 1;
              lblNumberOfLastTransactions.setText ("Number of Transactions: " + numTrans);
         //Previous Item Total.
         public void lastTot()
              DecimalFormat twoDigits = new DecimalFormat("#0.00");
              lblLastItemTotal.setText ("Last Item Total: $" + twoDigits.format(subTotal));
         //Add up the number of books.
         public void numBooks()
              numBooks = Integer.parseInt(txtQuantity.getText()) + numBooks;
              lblNumberOfBooks.setText ("Number of Books: " + numBooks);
         //Multiply price * quanity to get SubTotal.
         public void subTotal()
              DecimalFormat twoDigits = new DecimalFormat("#0.00");
              subTotal = price * quantity;
              lblSubTotal.setText("Subtotal: $" + twoDigits.format(subTotal));
         //Need to put a Sales Tax value later.
         public double salesTax()
              lblSalesTax.setText("Sales Tax: " + salesTax);
              return 0;
         //Shipping Total
         public double shipping()
              if (subTotal >= 50)
                   lblShipping.setText("Shipping: FREE!");
                   return 0;
              else
                   shipping = numBooks * 2;
                   lblShipping.setText("Shipping: " + shipping);
              return shipping;
         //GrandTotal
         public double total()
              DecimalFormat twoDigits = new DecimalFormat("#0.00");
              total = subTotal + shipping + salesTax;
              lblOrderTotal.setText("Order Total: $" + twoDigits.format(total));
              return total;
         //Put everything together.
         public String outFormat()
              DecimalFormat twoDigits = new DecimalFormat("#0.00");
              String answer = "You ordered: " + Title + " by " +  Author + "." + "     You purchased: " + quantity + " copies for $" + twoDigits.format(price) + " per item." + "    The Grand Total comes to: $" + twoDigits.format(total) ;
              statusArea.append("\n");
              statusArea.append(answer);
              return answer;
    }

    I suggest changing your code slightly. In the actionPerformed() method when you are calling other methods to parse the input, use a try/catch block around those methods. Something like thispublic void actionPerformed(ActionEvent e) {
              if(e.getSource() == calcButton) {
                   try {
                        Title = txtTitle.getText();
                        Author = txtAuthor.getText();
                        quantity = getQuant();
                        price = getPrice();
                        transCount();
                        lastTot();
                        numBooks();
                        subTotal();
                        salesTax = salesTax();
                        shipping = shipping();
                        total = total();
                        answer = outFormat();
                   } catch(NumberFormatException ne) {
              } else {
                   //resetButton should clear all the fields.
         }Then, inside the methods that parse the data, change the code so the exception is thrown to the caller, something like this     //Prevent user from entering invalid quanity numbers.
         public int getQuant() {
              boolean error = false;
              try {
                   quantity = Integer.parseInt(txtQuantity.getText());
              } catch(NumberFormatException ne) {
                   error = true;
              error = error | quantity <= 0;
              if (error) {
                   statusArea.setText("Please enter a valid number for quantity.");
                   throw new NumberFormatException();
              return quantity;
         }This allows the error to cause the program to skip calculating.
    I also think you have a logic problem with how you are calculating shipping.

  • Office 365 Sandbox Solution EventReceiver throwing Remote Exception in ItemAdding

    Hi,
    I created a sandbox webpart for O365 with EventReceivers with ItemAdding for Document Library and while i upload a document to library in O365  sharepoint site application throws below exception:-
    System.Runtime.Remoting.RemotingException: Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
    Server stack trace: 
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type us
    Same code works perfectly on my Development machine, Please help. Below is the Code
    base.EventFiringEnabled = false;
    bool isFile = (properties.AfterProperties["vti_filesize"] != null);
    if (isFile == true)                   
    SPWeb currentWeb = properties.OpenWeb();
    // Get foldername from url like Document/EC10001/filename.txt                       
    string folderName = properties.AfterUrl.Split(new char[] { '/' })[1];
    SPList spList = currentWeb.Lists[properties.List.ID];                       
    SPQuery spQuery = new SPQuery();                       
    spQuery.Query = "<OrderBy><FieldRef Name='Modified' Ascending='FALSE'/></OrderBy>";
    //Getting the folder object from the list                       
    SPFolder folder = spList.RootFolder.SubFolders[folderName];
    //Set the Folder property                       
    spQuery.Folder = folder;
    int fileSequenceId = 0;                      
    SPListItemCollection items = spList.GetItems(spQuery);
    if (items.Count > 0)                       
    string documentID = items[0]["DocumentID"] != null ? items[0]["DocumentID"].ToString() : string.Empty;
    if (!string.IsNullOrEmpty(documentID))                           
    string splitNumber = documentID.Split(new char[] { '-' })[1];                               
    fileSequenceId = Convert.ToInt32(splitNumber) + 1;                           
    else                           
    properties.ErrorMessage = "Unable to generate Document Id";                               
    properties.Cancel = true;                           
    else                       
    fileSequenceId = 1;                       
    // Set DocumentID like EC10001-001                       
    properties.AfterProperties["DocumentID"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));      
    // Retrive "EEC000" string from Constant List               
    properties.AfterProperties["vti_title"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));   
    // Retrive "EEC000" string from Constant List                
    base.EventFiringEnabled = true;
    Thanks,
    Pranay Chandra Sapa

    Hi,
    According to your description, my understanding is that when you upload document in Office 365 site, the event receiver in sandbox solution throws error.
    Per my knowledge, if you want to use event receiver in Office 365 environment, you need to use remote event receiver instead the normal event receiver in an app.
    Here are some detailed articles for your reference:
    Create a remote event receiver in apps for SharePoint
    Handle events in apps for SharePoint
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Throwing an exception from XSLT

    Just wanted to share a finding with the Oracle XDB community and possibly suggest an enhancement to the xdb product development team (care of MDRAKE).
    I had a scenario where I wanted to throw an exception from the XSLT.
    A little Googling revealed this helpful post:
    http://weblogs.asp.net/george_v_reilly/archive/2006/03/01/439402.aspx
    ...so I gave it a shot.
    In my XSLT, I have a <xsl:choose> block with the following <xsl:otherwise> block:
    <xsl:otherwise>
        <xsl:message terminate="yes">Unknown Document Type</xsl:message>                          
    </xsl:otherwise>I used a stub test to run this through, giving it a file which would exercise the exception:
    select xmltype(bfilename('XML_RESOURCES', 'data.xml'),0).transform(xmltype(bfilename('XML_RESOURCES', 'sanitize_xml.dev.xsl'),0))
    from dual;..and to my 'joy', I did get an exception:
    ORA-30998: transformation error: execution of compiled XSLT on XML DOM failedHmm...would of been nicer to get something like what Eclipse/Xalan pops out:
    file:/H:/eclipse_indigo_workspace/XSLT/sanitize_xml.xsl; Line #28; Column #59; Unknown Document Type
    (Location of error unknown)Stylesheet directed termination...i.e. my custom error message "Unknown Document Type" isn't output by Oracle.
    Just to be safe, I tried a file which would NOT exercise this xsl:otherwise block and it did run through OK.
    So, could XDB report a better error?
    Thoughts?

    SQL> VAR XSL VARCHAR2(4000)
    SQL> --
    SQL> begin
      2    :XSL :=
      3  '<?xml version="1.0" encoding="UTF-8"?>
      4  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      5     <xsl:output method="xml" indent="yes"/>
      6     <xsl:template match="/">
      7             <Result>
      8                     <xsl:choose>
      9                             <xsl:when test="Input=''1''">
    10                                     <Output>1</Output>
    11                             </xsl:when>
    12                             <xsl:when test="Input=''2''">
    13                                     <xsl:message>The value is 2</xsl:message>
    14                                     <Output>2</Output>
    15                             </xsl:when>
    16                             <xsl:when test="Input=''3''">
    17                                     <xsl:message terminate="no">The value is 3</xsl:message>
    18                                     <Output>3</Output>
    19                             </xsl:when>
    20                             <xsl:otherwise>
    21                                     <xsl:message terminate="yes">Invalid value</xsl:message>
    22                                     <Output>Bad Input</Output>
    23                             </xsl:otherwise>
    24                     </xsl:choose>
    25             </Result>
    26     </xsl:template>
    27  </xsl:stylesheet>';
    28  end;
    29  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>1</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <Result>
      <Output>1</Output>
    </Re
    Elapsed: 00:00:00.01
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>2</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <Result>
      <Output>2</Output>
    </Re
    Elapsed: 00:00:00.00
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>3</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <Result>
      <Output>3</Output>
    </Re
    Elapsed: 00:00:00.01
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>4</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    ERROR:
    ORA-30998: transformation error: execution of compiled XSLT on XML DOM failed
    no rows selected
    Elapsed: 00:00:00.01
    SQL>
    SQL>The actuall error is not unreasonalbe. The Execution did fail beacuse you terminated it.. Contacting Oralce Support may be a little excessive...
    Now with respect to message the question is where...
    We 'could' output into the same buffer as is used by DBMS_OUTPUT, but that has limits in terms of the amount of output that can be generated.
    We could write it to the trace file, but that may be difficulat for a developer to get to
    We could write it to a log file in the XDB repository, but where and how to name it...
    We could another parameter to XMLTransform, which would be a Message Buffer
    All of these are in effect enhancements..
    BTW I checked with XML Spy and they seem to ignore message too, so I'm wondering how widely used this is...
    We cannot add it to the output of the XSL since XMLTransform defines the output of the XML to be well formed XML, and adding a random set of text nodes would viloate that rule..

  • Ant throws the exception when builds B2B

    Hi,
    Ant throws the exception:
    default.application.xml:
        [style] Processing D:B2B_DEVsap_earmeta-inf.b2bapplication.xml to D:B2B
    _DEVproject_earmeta-inf.b2b_devMETA-INFapplication.xml
        [style] Loading stylesheet D:B2B_DEVbintemplatesapplication.xsl
        [style] Failed to process D:B2B_DEVsap_earmeta-inf.b2bapplication.xml
    BUILD FAILED
    D:B2B_DEVbinbuild.xml:113: The following error occurred while executing this
    line:
    D:B2B_DEVprojectbuildmodification.xml:102: The following error occurred while
    executing this line:
    D:B2B_DEVbinearbuilder.xml:78: The following error occurred while executing t
    his line:
    D:B2B_DEVbinearbuilder.xml:16: javax.xml.transform.TransformerConfigurationEx
    ception: Could not load stylesheet. org.w3c.dom.DOMException: Prefix is 'xmlns',
    but URI is not 'http://www.w3.org/2000/xmlns/' in the qualified name, 'xmlns:xs
    l'
    How to fix it?
    The configuration is MS Windows XP SP2, MS SQL Server 2000 Developer Edition SP4, SAP Web AS 6.40 SP18, Apache Ant 1.6.5, Build Tool, j2sdk1.4.2_07.
    Any help will be appreciated.
    Regards,
    Roman Babkin

    Hi,
    have you tried to urlencode the hash char?
    Might be interesting as well if the problem also occours when you point to a local script in your url. The script should then contain a static link to your xml file.
    cheers,
    jossif

  • Ant throws the exception when builds B2B (E-selling of CRM-ISA)

    Hi,
    Ant throws the exception:
    default.application.xml:
        [style] Processing D:B2B_DEVsap_earmeta-inf.b2bapplication.xml to D:B2B
    _DEVproject_earmeta-inf.b2b_devMETA-INFapplication.xml
        [style] Loading stylesheet D:B2B_DEVbintemplatesapplication.xsl
        [style] Failed to process D:B2B_DEVsap_earmeta-inf.b2bapplication.xml
    BUILD FAILED
    D:B2B_DEVbinbuild.xml:113: The following error occurred while executing this
    line:
    D:B2B_DEVprojectbuildmodification.xml:102: The following error occurred while
    executing this line:
    D:B2B_DEVbinearbuilder.xml:78: The following error occurred while executing t
    his line:
    D:B2B_DEVbinearbuilder.xml:16: javax.xml.transform.TransformerConfigurationEx
    ception: Could not load stylesheet. org.w3c.dom.DOMException: Prefix is 'xmlns',
    but URI is not 'http://www.w3.org/2000/xmlns/' in the qualified name, 'xmlns:xs
    l'
    How to fix it?
    The configuration is MS Windows XP SP2, MS SQL Server 2000 Developer Edition SP2, SAP Web AS 6.40 SP18, Apache Ant 1.6.5, Build Tool.
    Any help will be appreciated.
    Regards,
    Roman Babkin

    Hi,
    Ant throws the exception:
    default.application.xml:
        [style] Processing D:B2B_DEVsap_earmeta-inf.b2bapplication.xml to D:B2B
    _DEVproject_earmeta-inf.b2b_devMETA-INFapplication.xml
        [style] Loading stylesheet D:B2B_DEVbintemplatesapplication.xsl
        [style] Failed to process D:B2B_DEVsap_earmeta-inf.b2bapplication.xml
    BUILD FAILED
    D:B2B_DEVbinbuild.xml:113: The following error occurred while executing this
    line:
    D:B2B_DEVprojectbuildmodification.xml:102: The following error occurred while
    executing this line:
    D:B2B_DEVbinearbuilder.xml:78: The following error occurred while executing t
    his line:
    D:B2B_DEVbinearbuilder.xml:16: javax.xml.transform.TransformerConfigurationEx
    ception: Could not load stylesheet. org.w3c.dom.DOMException: Prefix is 'xmlns',
    but URI is not 'http://www.w3.org/2000/xmlns/' in the qualified name, 'xmlns:xs
    l'
    How to fix it?
    The configuration is MS Windows XP SP2, MS SQL Server 2000 Developer Edition SP2, SAP Web AS 6.40 SP18, Apache Ant 1.6.5, Build Tool.
    Any help will be appreciated.
    Regards,
    Roman Babkin

  • Throw Soap Exception in BPM.

    Hi All,
    My scenario is Soap->XI->BPM->RFC. I get a soap request in synchronous way with Request and Response messages I Map my request to a RFC and If there's any application error or mapping error I have to send SOAP fault exception to my Soap Sending system. But I don't see any option in BPM to throw soap exception only thing I can do is to map my errors in the soap response and send it to soap sender.
    But my Soap sending system needs soap fault not a response message when any errors happen.
    Please let me know if anybody has this same situation and how to handle it.
    Thanks in Advance,
    SP.

    Hi VJ,
    I have to use BPM as I am doing other stuff in my BPM. In my BPM I am catching mapping exception and then I have to send this to Soap Sender in SOAP fault message and in abstract interfaces we don't have option to give fault message types. Also, I am using S/A bridge and I have to close the brige in order to send some response to Soap Sender.
    Is it possible to send soap fault when we close the S/A brige by send step.
    Thanks,
    SP.

  • How to Throw/Catch Exceptions in BPM

    Hi All,
    I've seen a couple articles that talk about how to Throw/Catch an execption in a BPM. My question has two parts:
    1) RFC Call: I was able to catch an Fault Message in an exception step when calling an RFC (Synchronous Interface). What I wanted to do is use the fault message (exception) and store it in a DB for later review.
    2) IDOC: I'm sending an IDOC to R3 from a BPM. The send step is enclosed in a block w/ an exception. The send step is throwing an error (IDOC adpater system error), but the exception is never thrown. My question is: when the error occurrs at the adapter level does it still throw an exception in a BPM?
    Thanks for any tip/advice/anything!
    Fernando.

    Hi Fernando,
    1) Define a send step in the exception branch.
    2) If u send a IDoc from R/3 to XI and the IDoc adapter is running to an error of course there cant be an exception in ur business process. Usually the IDoc adapter sends back status back up via ALEAUD. In case of success IDoc should have then '03', if the adapter cannot send anything the IDoc should remain at '39'. U should send a ALEAUD in case of exception of BPM switching to status '40', in case of success to '41'.
    Regards, Udo

  • Throwing Runtime Exceptions from BPM. How?

    Hi !
    I want to make appear a red flag in the SXMB_MONI as a result of a custom condition inside a BPM. I tried with the control step, but it makes no "red flag".
    Should I make a transform step between 2 dummy message types with a UDF that throws the runtime exception there?? is there another way ?? We want a red flag as a result of a expired deadline while waiting a file adapter transport acknowledgement.
    Thanks !!
    Matias.

    Matias,
    As you said before you want the BPM to be errored out if it reach the deadline, am I right. In control step if u say cancel process it equivalent to logically deleting the work items, so obviously you will get an succesfull message. What I suggest you to do is in  Deadline branch - control branch select throw exception. The exception name has to be defined in Block level. So if you throw an exception it will look for the exception branch in the same block level if not the higher(super)block level, if it couldn't find the exception branch it will run out to error. Actually the exception branch is used to catch that exception and continue the rest of the process, so i think there is no need for defining the exception branch itself.
    Hope it helps you!!!
    Best regards,
    raj.

  • Class.forName() throws null exception in servlet

    Hi, just wondering if anyone having this similar problem:
    when i try to load a class using Class.forName() method inside a servlet, it throws null exception.
    1) The exception thrown is neither ClassNotFoundException nor any other Error, it's "null" exception.
    2) There's nothing wrong with the code, in fact, the same code has been testing in swing before, works perfectly.
    3) I have include all necessary jars/classes into the path, even if i haven't, it should throw ClassNotFoundException instead, not "null" exception.

    I have tried to detect any possible nullable variable, and it is able to run until line 15. The exception thrown is actually null only... not NullPointerException... which is why i have confused...
    the message i received is "PlugInException: null".
    The code is at follow:
    * Load plugin
    * @return ArrayList of plugins
    * @exception PlugInException PlugInException
    01 public ArrayList loadPlugin()
    02 throws PlugInException
    03 {
    04 PlugIn plugin;
    05 ArrayList plugins = new ArrayList();
    06
    07 for (int i = 0; i < configLoader.getPluginTotal(); i++)
    08 {
    09 try
    10 {
    11 if (debugger > 0)
    12 {
    13 System.out.print("Loading " configLoader.getPluginClass(i) "...");
    14 }
    15 if (Class.forName(configLoader.getPluginClass(i)) == null)
    16 {
    17 if (debugger > 0)
    18 {
    19 System.out.print(" not found");
    20 }
    21 }
    22 else
    23 {
    24 if (debugger > 0)
    25 {
    26 System.out.println(" done");
    27 }
    28 plugin = (PlugIn)(Class.forName(configLoader.getPluginClass(i)).newInstance());
    29 plugin.setContainer(container);
    30 plugins.add(plugin);
    31 }
    32 }
    33 catch (Exception e)
    34 {
    35 throw new PlugInException("PlugIn Exception: " + e.toString());
    36 }
    37 }
    38
    39 return plugins;
    40 }

  • How to throw bundled exceptions thrown by checkErrors()

    Hi,
    I call pl/sql to do update, and call checkErrors() , the code looks like following, but it doesn't display read friendly message on the screen. What is the right way to throw bundled exception from checkErrors() method?
    try{
    xxg2cGoalPk.startWf (conn,
    new BigDecimal(srpGoalHeaderId),
    new BigDecimal(userId),
    returnStatus,
    msgCount,
    msgData);
    int msgCount1 = 0;
    if(msgCount[0] != null){
    msgCount1 = Integer.parseInt(msgCount[0].toString());
    String returnStatus1 = returnStatus[0];
    String msgData1 = msgData[0];
    OAExceptionUtils.checkErrors(tx,msgCount1, returnStatus1, msgData1);
    catch(OAException e) {
    e.printStackTrace();
    throw new OAException(e.getDetailMessage(),OAException.ERROR);
    thanks
    Lei

    What Shiv said is only an alternative, but what you are using is correct.I haven't tested but as per javadoc of
    OAExceptionUtils.checkErrors(tx,msgCount1, returnStatus1, msgData1);
    will itself raise bundled exceptions. You need to write this line outside try/catch block.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Export with BiarEngine.jar works, using the API it throws an exception

    Hello,
    I'm using BiarEngine.jar to export from my CMS. it works fine.
    Now I want to use the API to get someting more handy, but I receive an exception (NoSuchFieldError) as if I had a mismatch between versions.
    I'm stuck with it, if somebody has an idea...
    Thanks a lot.
    Alain
    Here is the java code:
    IExportOptions oExportOptions = BIARFactory.getFactory().createExportOptions();
    oExportOptions.setIncludeSecurity(false);
    oExportOptions.setIncludeDependencies(true);
    oExportOptions.setCallback(
         new IExportCallback()
              public void onSuccess(int id)      {...}
              public void onFailure(int id, BIARException biarException) {...};
    BIAROutput oBIAROutput = new BIAROutput( oEntrepriseSession, "c:\myFile.biar", exportOptions );
    At this point it throws the exception:
    Exception in thread "main" java.lang.NoSuchFieldError: SI_MODELCUID_SET
         at com.businessobjects.sdk.plugin.desktop.deltastore.internal.DeltaStore.setupProperties(DeltaStore.java:188)
         at com.businessobjects.sdk.plugin.desktop.deltastore.internal.DeltaStore.unpack(DeltaStore.java:37)
         at com.crystaldecisions.sdk.occa.infostore.internal.al.continueUnpack(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.al.startUnpack(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.queryHelper(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.query(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.at.query(Unknown Source)
         at com.businessobjects.sdk.biar.internal.XSDManager$RepositoryXSD.retrieveXSDVersions(XSDManager.java:204)
         at com.businessobjects.sdk.biar.internal.XSDManager$RepositoryXSD.<init>(XSDManager.java:194)
         at com.businessobjects.sdk.biar.internal.XSDManager$XSDCache.getXSD(XSDManager.java:365)
         at com.businessobjects.sdk.biar.internal.XSDManager.<init>(XSDManager.java:55)
         at com.businessobjects.sdk.biar.BIAROutput.<init>(BIAROutput.java:73)

    >
    Just need to confirm if the ANT script can be run against individual OSB project than OSB configuration project?
    >
    It is possible. I'm going the same way here. However, I remember I needed to contact support because it was not a standard feature of the Ant task. They provided me with the patch that allowed me to use -configSubProjects parameter in export.
    >
    Can we have multiple OSB configuration projects on the OSB server ?
    >
    I don't think so.

  • JNI Application running in ms-dos but throws an exception in applet

    Hi! I have a java application which calls a DLL using the JNI. This works perfect if I execute the java program from my command line (in ms-dos) But when I try to do it in an applet, it indeed runs and do everything ok, but at the end of the execution I get a EXECUTION_EXCEPTION.
    This is how is working:
    1.- jnidllmyclass, this is where I call the native method of my DLL
    2.- intermediate DLL which writes to files to c:\temporal and it calls several functions from other DLL
    3.- other DLL which writes more files (among other things)
    4.- applet class with a call to jnidllmyclass
    Now the DLL what does is to open a connection to a usb scanner, then send commands to it to scann somethings, save front and back images to c:\temporal (obviously, all of this is done in the user system, using certificates) and write other file and close the connection. This works! it write the images well and write everything... but after that the exception arises... I have doubt of what is it, because if it does all, what is causing the exception?
    Thanks for your help!

    Hi! Applet can access the DLL. The scanners works, but the C DLL throws an exception. Nevertheless, I've managed to see what was going on. When you click a JButton in a GUI, it enters only one to the actionlistener, but if this is done in an Applet, enters twice, so... the first time worked fine, but the second no because there was nothing to scann.
    This theme is a bit creepy, if you want help just ask! I give snippets, not just advices... I hate those people, so fell free to ask.
    Greetings!

  • FM used in background job throws an Exception-NO_BATCH

    Hi,
    I have one normal ABAP report with selection screen, where selection parameters are file names and they are used for uploading data from excel to internal table and then internal table to excel respectively.
    Now I want to put this as a background job. So I saved the variant and now while running the job there is an exception.
    Reason for the same as I could find out is:
    while uploading function module (KCD_EXCEL_OLE_TO_INT_CONVERT or ALSM_EXCEL_TO_INTERNAL_TABLE) is called, it has some front-end  services called.
    That is in case of first function module, it is CLPB_IMPORT which in turn calls WS_QUERY where GUI_EXIST is checked and there it throws an exception.
    And in the later case it is cl_gui_frontend_services class and its some method is called.
    So basically, frontend services are called in any case and I still want this as a background job.
    Can Anyone clear it conceptually?

    Hello Krupa,
    The rule is pretty much simple: <i>Anything that you do in batch / background, cannot have anything to do with the front-end / desktop.</i>
    The Excel sheet you use is an application that runs on the Frontend, right? So you cannot do it in batch. The reason, to put it crudely, is that a background job is run by a different workprocess altogether and that work process is not capable of accessing the front-end. Ideally, a background job should be run-able even without a GUI!!
    SO what you can do in a background job, is to operate on the files present on the application server (that is where the job runs).
    Hope that is clear. If not, get back.
    Regards,
    Anand Mandalika.
    Regards,
    Anand Mandalika.

Maybe you are looking for

  • Garritan 64 bit

    I just made the changeover from 32 to 64 bit after going from 4 to 12 GB of RAM. There seem to be some significant advantages. Both the Spectrasonics and Native Instruments VIs show up and work well in 64 bit mode. However, the Garritan Personal Orch

  • I preordered a abulm and it gave me two songs when they came out but now it wants me to buy it again what do i do

    Please help me get the rest of the ablum so i can listen to some new music

  • Intercompany sales process

    Dear ALL SD Guru, I am doing the intercompany sales process . For the same task i have created the sales order , delivery and finally create the invoice for the customer . After that when i am trying to create the intercompany invoice , system is sho

  • Finding pics in iPhoto!

    When I attempt to find a photo in iPhoto, Finder defaults to the Apple name of the file, including breaking the files down by modified and original, and year. Is there a way to browse by Album (not roll) and the name I called the photo? This is so si

  • Oracle 10g Drivers is

    Hi support, Are Oracle 10G database server drivers compatible with Oracle 11G database server . As we have updated our Database Server from Oracle 10g to Oracle 11g DB Server. Please confirm that do we need to update all our clients machine from Orac