Input mismatch exception

I have to read a series of strings and ints from a tab delimited text file these will be passed to a constructor where a series of objects will be assigned to an array when I run a test I get an input mismatch exception
this is the constructor
class Player extends Object
     private String surname;          // Player's surname
     private String name;          // Players first name
     private int passing = 0;          // Player's passing ability (0-5)
     private int attacking = 0;     // Player's attacking ability (0-5)
     private int defending = 0;     // Player's defending ability (0-5)
     private int goalkeeping = 0;     // Player's goalkeeping ability (0-5)
     private String team;          // Player's team
     /** Construct a person object using information found in a tab delimited text file.*/
     public Player(Scanner in)
          super();
          this.surname = in.next();
          this.name = in.next();
          this.passing = in.nextInt();
          this.attacking = in.nextInt();
          this.defending = in.nextInt();
          this.goalkeeping = in.nextInt();
          this.team = in.next();
and this is the method for the array
public AvailablePlayers(String fileName)
          super();
          // count the number of Persons in the file
          int count = 0;
          Scanner in = this.openFile(fileName);
          while (in.hasNextLine())
               Player p = new Player(in);
               count++;
          in.close();
          // allocate an array to hold each object we read
          this.players = new Player[count];
          // Read the data, storing a reference to each object in the array
          in = this.openFile(fileName);
          for (int i=0; i<count; i++)
               this.players[i] = new Player(in);
          in.close();
I have been calling the AvailablePlayers method from a test program it does find the file then throw the exception

import java.io.*;
import java.util.Scanner;
import java.lang.*;
//** Model a football player listing various atributes
/* @author Donald Reid */
class Player extends Object
     private String surname;          // Player's surname
     private String name;          // Players first name
     private int passing = 0;          // Player's passing ability (0-5)
     private int attacking = 0;     // Player's attacking ability (0-5)
     private int defending = 0;     // Player's defending ability (0-5)
     private int goalkeeping = 0;     // Player's goalkeeping ability (0-5)
     private String team;          // Player's team
     /** Construct a person object using information found in a tab delimited text file.*/
     public Player(Scanner in)
          super();
          this.surname = in.next();
          this.name = in.next();
          this.passing = in.nextInt();
          this.attacking = in.nextInt();
          this.defending = in.nextInt();
          this.goalkeeping = in.nextInt();
          this.team = in.next();
     /** @return This players's surname */
     public String getSurname()
          return this.surname;
        /** @return This players's name */
        public String getName()
          return this.name;
   /** @return This player's passing */
   public int getPassing()
        return this.passing;
   /** @ return This player's attacking*/
   public int getAttacking()
        return this.attacking;
   /** @return This player's defending */
   public int getDefending()
        return this.defending;
   /** @return This player's goalkeeping */
   public int getGoalkeeping()
        return this.goalkeeping;
   /** @return This player's team */
   public String getTeam()
        return this.team;
[\code]
is the way the first section should be                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Handling an input mismatch exception

    I have written the following code to calculate tax payments based on income and filing status :
    import java.util.Scanner;
    public class computeTax {
        public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
            // prompt for filing status
            System.out.println("enter '0' for single filer,");
            System.out.println("enter '1' for married filing jointly or qualified widow(er),");
            System.out.println("enter '2' for married filing separately,");
            System.out.println("enter '3' for head of household.");
            while (true) {
            System.out.println("what is your filing status?");
             int status = input.nextInt();
                    if (status == 0) {
                    System.out.println("you're a single filer.  What is your income?");
                    double income = input.nextDouble();
                    //double income;
                        if (0 <= income && income <= 8350) {
                            System.out.println("Your tax bill is : $ " + income*0.1);
                        } else if (8351 <= income && income <= 33950) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((income-8350)*0.15)
                        } else if (33951 <= income && income <= 68525) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((33950-8350)*0.15)       
                            + ((income-33950)*0.25)
                        } else if (68526 <= income && income <= 104425) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((33950-8350)*0.15)
                            + ((82250-33950)*0.25)
                            + ((income-82250)*0.28)
                        } else if (104426 <= income && income <= 186475) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((33950-8350)*0.15)
                            + ((82250-33950)*0.25)
                            + ((171550-82250)*0.28)
                            + ((income-171550)*0.33)
                        } else if (186476 <= income) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((33950-8350)*0.15)
                            + ((82250-33950)*0.25)
                            + ((171550-82250)*0.28)
                            + ((372950-171550)*0.33)
                            + ((income-372950)*0.35)
                        break;
                    } else if (status == 1){
                        System.out.println("you're married filing jointly or qualified widow(er). What is your income?");
                        double income = input.nextDouble();
                        //double income;
                        if (0 <= income && income <= 16700) {
                            System.out.println("Your tax bill is : $ " + income*0.1);
                        } else if (16701 <= income && income <= 67900) {
                            System.out.println("Your tax bill is : $ " +
                            ( (16700*0.1)
                            + ((income-16700)*0.15)
                        } else if (67901 <= income && income <= 137050) {
                            System.out.println("Your tax bill is : $ " +
                            ( (16700*0.1)
                            + ((67900-16700)*0.15)       
                            + ((income-67900)*0.25)
                        } else if (137051 <= income && income <= 208850) {
                            System.out.println("Your tax bill is : $ " +
                            ( (16700*0.1)
                            + ((67900-16700)*0.15)
                            + ((137050-67900)*0.25)
                            + ((income-137050)*0.28)
                        } else if (208051 <= income && income <= 372950) {
                            System.out.println("Your tax bill is : $ " +
                            ( (16700*0.1)
                            + ((67900-16700)*0.15)
                            + ((137050-67900)*0.25)
                            + ((208850-137050)*0.28)
                            + ((income-208850)*0.33)
                        } else if (372951 <= income) {
                            System.out.println("Your tax bill is : $ " +
                            ( (16700*0.1)
                            + ((67900-16700)*0.15)
                            + ((137050-67900)*0.25)
                            + ((208850-137050)*0.28)
                            + ((372950-208850)*0.33)
                            + ((income-372950)*0.35)
                        break;
                    } else if (status == 2){
                        System.out.println("you're married filing separately. What is your income?");
                        double income = input.nextDouble();
                        //double income;
                        if (0 <= income && income <= 8350) {
                            System.out.println("Your tax bill is : $ " + income*0.1);
                        } else if (8351 <= income && income <= 33950) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((income-8350)*0.15)
                        } else if (33951 <= income && income <= 68525) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((33950-8350)*0.15)       
                            + ((income-33950)*0.25)
                        } else if (68526 <= income && income <= 104425) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((33950-8350)*0.15)
                            + ((68525-33950)*0.25)
                            + ((income-104425)*0.28)
                        } else if (104426 <= income && income <= 186475) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((33950-8350)*0.15)
                            + ((68525-33950)*0.25)
                            + ((104425-68525)*0.28)
                            + ((income-104425)*0.33)
                        } else if (186476 <= income) {
                            System.out.println("Your tax bill is : $ " +
                            ( (8350*0.1)
                            + ((33950-8350)*0.15)
                            + ((68525-33950)*0.25)
                            + ((104425-68525)*0.28)
                            + ((186475-104425)*0.33)
                            + ((income-186475)*0.35)
                            break;
                } else if (status == 3){
                    System.out.println("you're a head of household. What's your income?");
                    double income = input.nextDouble();
                        if (0 <= income && income <= 11950) {
                            System.out.println("Your tax bill is : $ " + income*0.1);
                        } else if (11951 <= income && income <= 45500) {
                            System.out.println("Your tax bill is : $ " +
                            ( (11950*0.1)
                            + ((income-11950)*0.15)
                        } else if (45501 <= income && income <= 117450) {
                            System.out.println("Your tax bill is : $ " +
                            ( (11950*0.1)
                            + ((45500-11950)*0.15)       
                            + ((income-45500)*0.25)
                        } else if (117451 <= income && income <= 190200) {
                            System.out.println("Your tax bill is : $ " +
                            ( (11950*0.1)
                            + ((45500-11950)*0.15)
                            + ((117450-45500)*0.25)
                            + ((income-117450)*0.28)
                        } else if (190201 <= income && income <= 372950) {
                            System.out.println("Your tax bill is : $ " +
                            ( (11950*0.1)
                            + ((45500-11950)*0.15)
                            + ((117450-45500)*0.25)
                            + ((190200-117450)*0.28)
                            + ((income-190200)*0.33)
                        } else if (372951 <= income) {
                            System.out.println("Your tax bill is : $ " +
                            ( (11950*0.1)
                            + ((45500-11950)*0.15)
                            + ((117450-45500)*0.25)
                            + ((190200-117450)*0.28)
                            + ((372950-190200)*0.33)
                            + ((income-372950)*0.35)
                            break;
                        } else {
                            System.out.println("please type the right answer");
    The while loop initiated on line 21 is there so that in case the wrong input is given at the prompt given in line 24, the program outputs "please type the right answer" with the command on line 254 before looping back to line 24 and prompting the user to enter his status number.  The program works as long as the input at line 28 is an integer.  Not surprisingly if the erroneous input here is not an integer, the program outputs the following error message :
    Exception in thread "main" java.util.InputMismatchException
        at java.util.Scanner.throwFor(Scanner.java:909)
        at java.util.Scanner.next(Scanner.java:1530)
        at java.util.Scanner.nextInt(Scanner.java:2160)
        at java.util.Scanner.nextInt(Scanner.java:2119)
        at computeTax.main(computeTax.java:28
    To try to solve this I used the Try / Catch technique with the following version of the code :
    import java.util.Scanner;
    public class computeTax {
        public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
            // prompt for filing status
            System.out.println("enter '0' for single filer,");
            System.out.println("enter '1' for married filing jointly or qualified widow(er),");
            System.out.println("enter '2' for married filing separately,");
            System.out.println("enter '3' for head of household.");
            while (true) {
                try {
                System.out.println("what is your filing status?");
                 int status = input.nextInt();
                        if (status == 0) {
                        System.out.println("you're a single filer.  What is your income?");
                        double income = input.nextDouble();
                        //double income;
                            if (0 <= income && income <= 8350) {
                                System.out.println("Your tax bill is : $ " + income*0.1);
                            } else if (8351 <= income && income <= 33950) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((income-8350)*0.15)
                            } else if (33951 <= income && income <= 68525) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((33950-8350)*0.15)       
                                + ((income-33950)*0.25)
                            } else if (68526 <= income && income <= 104425) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((33950-8350)*0.15)
                                + ((82250-33950)*0.25)
                                + ((income-82250)*0.28)
                            } else if (104426 <= income && income <= 186475) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((33950-8350)*0.15)
                                + ((82250-33950)*0.25)
                                + ((171550-82250)*0.28)
                                + ((income-171550)*0.33)
                            } else if (186476 <= income) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((33950-8350)*0.15)
                                + ((82250-33950)*0.25)
                                + ((171550-82250)*0.28)
                                + ((372950-171550)*0.33)
                                + ((income-372950)*0.35)
                            break;
                        } else if (status == 1){
                            System.out.println("you're married filing jointly or qualified widow(er). What is your income?");
                            double income = input.nextDouble();
                            //double income;
                            if (0 <= income && income <= 16700) {
                                System.out.println("Your tax bill is : $ " + income*0.1);
                            } else if (16701 <= income && income <= 67900) {
                                System.out.println("Your tax bill is : $ " +
                                ( (16700*0.1)
                                + ((income-16700)*0.15)
                            } else if (67901 <= income && income <= 137050) {
                                System.out.println("Your tax bill is : $ " +
                                ( (16700*0.1)
                                + ((67900-16700)*0.15)       
                                + ((income-67900)*0.25)
                            } else if (137051 <= income && income <= 208850) {
                                System.out.println("Your tax bill is : $ " +
                                ( (16700*0.1)
                                + ((67900-16700)*0.15)
                                + ((137050-67900)*0.25)
                                + ((income-137050)*0.28)
                            } else if (208051 <= income && income <= 372950) {
                                System.out.println("Your tax bill is : $ " +
                                ( (16700*0.1)
                                + ((67900-16700)*0.15)
                                + ((137050-67900)*0.25)
                                + ((208850-137050)*0.28)
                                + ((income-208850)*0.33)
                            } else if (372951 <= income) {
                                System.out.println("Your tax bill is : $ " +
                                ( (16700*0.1)
                                + ((67900-16700)*0.15)
                                + ((137050-67900)*0.25)
                                + ((208850-137050)*0.28)
                                + ((372950-208850)*0.33)
                                + ((income-372950)*0.35)
                            break;
                        } else if (status == 2){
                            System.out.println("you're married filing separately. What is your income?");
                            double income = input.nextDouble();
                            //double income;
                            if (0 <= income && income <= 8350) {
                                System.out.println("Your tax bill is : $ " + income*0.1);
                            } else if (8351 <= income && income <= 33950) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((income-8350)*0.15)
                            } else if (33951 <= income && income <= 68525) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((33950-8350)*0.15)       
                                + ((income-33950)*0.25)
                            } else if (68526 <= income && income <= 104425) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((33950-8350)*0.15)
                                + ((68525-33950)*0.25)
                                + ((income-104425)*0.28)
                            } else if (104426 <= income && income <= 186475) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((33950-8350)*0.15)
                                + ((68525-33950)*0.25)
                                + ((104425-68525)*0.28)
                                + ((income-104425)*0.33)
                            } else if (186476 <= income) {
                                System.out.println("Your tax bill is : $ " +
                                ( (8350*0.1)
                                + ((33950-8350)*0.15)
                                + ((68525-33950)*0.25)
                                + ((104425-68525)*0.28)
                                + ((186475-104425)*0.33)
                                + ((income-186475)*0.35)
                                break;
                    } else if (status == 3){
                        System.out.println("you're a head of household. What's your income?");
                        double income = input.nextDouble();
                            if (0 <= income && income <= 11950) {
                                System.out.println("Your tax bill is : $ " + income*0.1);
                            } else if (11951 <= income && income <= 45500) {
                                System.out.println("Your tax bill is : $ " +
                                ( (11950*0.1)
                                + ((income-11950)*0.15)
                            } else if (45501 <= income && income <= 117450) {
                                System.out.println("Your tax bill is : $ " +
                                ( (11950*0.1)
                                + ((45500-11950)*0.15)       
                                + ((income-45500)*0.25)
                            } else if (117451 <= income && income <= 190200) {
                                System.out.println("Your tax bill is : $ " +
                                ( (11950*0.1)
                                + ((45500-11950)*0.15)
                                + ((117450-45500)*0.25)
                                + ((income-117450)*0.28)
                            } else if (190201 <= income && income <= 372950) {
                                System.out.println("Your tax bill is : $ " +
                                ( (11950*0.1)
                                + ((45500-11950)*0.15)
                                + ((117450-45500)*0.25)
                                + ((190200-117450)*0.28)
                                + ((income-190200)*0.33)
                            } else if (372951 <= income) {
                                System.out.println("Your tax bill is : $ " +
                                ( (11950*0.1)
                                + ((45500-11950)*0.15)
                                + ((117450-45500)*0.25)
                                + ((190200-117450)*0.28)
                                + ((372950-190200)*0.33)
                                + ((income-372950)*0.35)
                                break;
                            } else {
                                System.out.println("please type the right answer");
                        } catch (java.util.InputMismatchException ex){
                            System.out.println("Input Mismatch Exception ");
    I have put the try / catch structure inside the while loop.  The input error is now dealt with but when a non integer input is entered at the status prompt, the program enters an infinite loop like so  :
    Input Mismatch Exception
    what is your filing status?
    Input Mismatch Exception
    what is your filing status?
    Input Mismatch Exception
    what is your filing status?
    Input Mismatch Exception
    etc
    etc
    etc...
    The problem here is that the program no longer stops at the status prompt on line 27.
    Can anyone suggest a way of overriding the input mismatch error thing and looping back to a status prompt that actually stops and waits for the input?
    Thanks

    Thanks for your reply.
    Your idea of compartmentalization sounds a good idea.
    By the way, I found a solution to the infinite loop  Check out :
    http://stackoverflow.com/questions/3572160/infinite-looptry-catch-with-exceptions.
    In particular :
    "......if the next token is not an int, it throws the InputMismatchException, but the token stays there. So on the next iteration of the loop, reader.nextInt() reads the same token again and throws the exception again. What you need is to use it up. Add a reader.next() inside your catch to consume the token, which is invalid and needs to be discarded."
    In the case of my code I substitute "reader.next()" with "input.next()" :
    } catch (java.util.InputMismatchException ex){
    System.out.println("Input Mismatch Exception ");
    input.next();

  • OSB, CSV, MFLBusiness Service, Data Mismatch Exception (OSB 11.1.1.6)

    I am having a problem transforming a big CSV file.
    The situation:
    I am using the following setup: OSB 11.1.1.6, developing with Eclipse OEPE on Windows 7. The behaviour described below is the same on a Linux server running the same version OSB though.
    My CSV source file has 162 columns and is mapped to a CSV file with 52 columns with some logic to exclude rows or transform values.
    Right now my adapter looks like this:
    MFL Proxy Service: FTP Pickup of CSV File
    - 1 stage:
    -- 1 Action: XQuery Transform the source MFL to the target MFL
    - Route to MFL Business Service on SFTP protocol (to write to CSV file)
    Right now the error I am getting is this one:
    <5-dec-2012 16:19:57 uur CET> <Error> <SFTPTransport> <BEA-381801> <Error occured for endpoint <MFLException>
    <ErrorMessage>Data mismatch exception.</ErrorMessage>
    <Details>
    <Detail>
    <Name>ErrorCode</Name>
    <Value>-1</Value>
    </Detail>
    <Detail>
    <Name>DataOffset</Name>
    <Value>0</Value>
    </Detail>
    <Detail>
    <Name>NodeName</Name>
    <Value>CatalogVersion</Value>
    </Detail>
    <Detail>
    <Name>FullyQualifiedName</Name>
    <Value>ProductMasterDataGroup.ProductMasterData.CatalogVersion</Value>
    </Detail>
    <Detail>
    <Name>ExpectedValue</Name>
    <Value>CatalogVersion</Value>
    </Detail>
    <Detail>
    <Name>Reason</Name>
    <Value>CatalogVersion is missing from the input XML, parent node is: ProductMasterData</Value>
    </Detail>
    </Details>
    </MFLException>
    <MFLException>
    <ErrorMessage>Data mismatch exception.</ErrorMessage>
    <Details>
    <Detail>
    <Name>ErrorCode</Name>
    <Value>-1</Value>
    </Detail>
    <Detail>
    <Name>DataOffset</Name>
    <Value>0</Value>
    </Detail>
    <Detail>
    <Name>NodeName</Name>
    <Value>CatalogVersion</Value>
    </Detail>
    <Detail>
    <Name>FullyQualifiedName</Name>
    <Value>ProductMasterDataGroup.ProductMasterData.CatalogVersion</Value>
    </Detail>
    <Detail>
    <Name>ExpectedValue</Name>
    <Value>CatalogVersion</Value>
    </Detail>
    <Detail>
    <Name>Reason</Name>
    <Value>CatalogVersion is missing from the input XML, parent node is: ProductMasterData</Value>
    </Detail>
    </Details>
    </MFLException>
         at com.bea.nonxml.common.MFLException.create(MFLException.java:221)
         at com.bea.nonxml.common.MFLException.create(MFLException.java:329)
         at com.bea.nonxml.writers.NonXMLWriterVisitor.writeEndElement(NonXMLWriterVisitor.java:415)
         at com.bea.nonxml.writers.NonXMLWriterInputStream.getmoredata(NonXMLWriterInputStream.java:199)
         at com.bea.nonxml.writers.NonXMLWriterInputStream.read(NonXMLWriterInputStream.java:96)
         Truncated. see log file for complete stacktrace
    From what I understand, there is a value missing for CatalogVersion. However, this is static content in the XQuery, so it should always be filled. I have written the Body variable to disk during the various steps in the service, the XML which is written is valid and is not missing this node. It appears to me that OSB is discarding this node in the last step when the CSV file is being written.
    The strange thing is that this error only occurs when I use a bigger file (say > 100kB). When using smaller files it works fine.
    Tests done so far:
    - Small file size (say less than 100 rows and smaller than 100kB), this is working fine
    - Conversion of CSV to XML with MFL in the MFL Builder, it works fine (for small filesize)
    - Conversion back to CSV from XML with MFL in the MFL Builder, it works fine (again, also only with smaller files)
    - Change of streaming settings on the proxy service, no change in behaviour
    - Change of Proxy Service and Business service to type File to make sure there is no latency interfering
    The strange thing is that I have seen quite some posts on various blogs which explain a solution like this, appearently they are using bigger files (I've seen 150MB+ mentioned) so I am wondering what I am doing wrong..

    A small addition to the above post;
    I have changed the Business Service from SFTP to File and the adapter is working as it should. The exported CSV has all the rows and is written like it should.
    Perhaps the combination of SFTP Business Service with a MFL type is causing this problem right now.
    As a work around I am following this flow now:
    1.) CSV on SFTP via MFL mapping -> OSB -> CSV to FILE via MFL Mapping
    2.) FILE -> OSB -> SFTP
    The second flow does not contain any logic, only moves the file to the SFTP server.
    When I have time I will investigate further and post the results when I find a better solution..

  • Namespace mismatch exception with Axis2

    Hi folks,
    I am getting the following exception when trying to invoke my axis2 web service,
    org.apache.axis2.AxisFault: namespace mismatch require http://services.sel.com found
         at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
         at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
         at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
         at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
         at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
         at com.sel.services.Invoker.main(Invoker.java:77)My wsdl is as follows,
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ns="http://services.sel.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://services.sel.com">
        <wsdl:types>
            <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.sel.com">
                <xs:element name="echoMessage">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="echoMessageResponse">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element minOccurs="0" name="return" type="xs:boolean"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="sayBye">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="sayByeResponse">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="sayHi">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="sayHiResponse">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:schema>
        </wsdl:types>
        <wsdl:message name="echoMessageRequest">
            <wsdl:part name="parameters" element="ns:echoMessage"/>
        </wsdl:message>
        <wsdl:message name="echoMessageResponse">
            <wsdl:part name="parameters" element="ns:echoMessageResponse"/>
        </wsdl:message>
        <wsdl:message name="sayHiRequest">
            <wsdl:part name="parameters" element="ns:sayHi"/>
        </wsdl:message>
        <wsdl:message name="sayHiResponse">
            <wsdl:part name="parameters" element="ns:sayHiResponse"/>
        </wsdl:message>
        <wsdl:message name="sayByeRequest">
            <wsdl:part name="parameters" element="ns:sayBye"/>
        </wsdl:message>
        <wsdl:message name="sayByeResponse">
            <wsdl:part name="parameters" element="ns:sayByeResponse"/>
        </wsdl:message>
        <wsdl:portType name="GreetPortType">
            <wsdl:operation name="echoMessage">
                <wsdl:input message="ns:echoMessageRequest" wsaw:Action="urn:echoMessage"/>
                <wsdl:output message="ns:echoMessageResponse" wsaw:Action="urn:echoMessageResponse"/>
            </wsdl:operation>
            <wsdl:operation name="sayHi">
                <wsdl:input message="ns:sayHiRequest" wsaw:Action="urn:sayHi"/>
                <wsdl:output message="ns:sayHiResponse" wsaw:Action="urn:sayHiResponse"/>
            </wsdl:operation>
            <wsdl:operation name="sayBye">
                <wsdl:input message="ns:sayByeRequest" wsaw:Action="urn:sayBye"/>
                <wsdl:output message="ns:sayByeResponse" wsaw:Action="urn:sayByeResponse"/>
            </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="GreetSoap11Binding" type="ns:GreetPortType">
            <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
            <wsdl:operation name="echoMessage">
                <soap:operation soapAction="urn:echoMessage" style="document"/>
                <wsdl:input>
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="sayHi">
                <soap:operation soapAction="urn:sayHi" style="document"/>
                <wsdl:input>
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="sayBye">
                <soap:operation soapAction="urn:sayBye" style="document"/>
                <wsdl:input>
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:binding name="GreetSoap12Binding" type="ns:GreetPortType">
            <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
            <wsdl:operation name="echoMessage">
                <soap12:operation soapAction="urn:echoMessage" style="document"/>
                <wsdl:input>
                    <soap12:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap12:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="sayHi">
                <soap12:operation soapAction="urn:sayHi" style="document"/>
                <wsdl:input>
                    <soap12:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap12:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="sayBye">
                <soap12:operation soapAction="urn:sayBye" style="document"/>
                <wsdl:input>
                    <soap12:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap12:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:binding name="GreetHttpBinding" type="ns:GreetPortType">
            <http:binding verb="POST"/>
            <wsdl:operation name="echoMessage">
                <http:operation location="Greet/echoMessage"/>
                <wsdl:input>
                    <mime:content type="text/xml" part="echoMessage"/>
                </wsdl:input>
                <wsdl:output>
                    <mime:content type="text/xml" part="echoMessage"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="sayHi">
                <http:operation location="Greet/sayHi"/>
                <wsdl:input>
                    <mime:content type="text/xml" part="sayHi"/>
                </wsdl:input>
                <wsdl:output>
                    <mime:content type="text/xml" part="sayHi"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="sayBye">
                <http:operation location="Greet/sayBye"/>
                <wsdl:input>
                    <mime:content type="text/xml" part="sayBye"/>
                </wsdl:input>
                <wsdl:output>
                    <mime:content type="text/xml" part="sayBye"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="Greet">
            <wsdl:port name="GreetHttpSoap11Endpoint" binding="ns:GreetSoap11Binding">
                <soap:address location="http://localhost:8080/axis2/services/Greet"/>
            </wsdl:port>
            <wsdl:port name="GreetHttpSoap12Endpoint" binding="ns:GreetSoap12Binding">
                <soap12:address location="http://localhost:8080/axis2/services/Greet"/>
            </wsdl:port>
            <wsdl:port name="GreetHttpEndpoint" binding="ns:GreetHttpBinding">
                <http:address location="http://localhost:8080/axis2/services/Greet"/>
            </wsdl:port>
        </wsdl:service>
    </wsdl:definitions>I have also added the following line in my services.xml,
    <schema schemaNamespace="http://localhost:8080/Fws/services/Greet?xsd" />
    Kindly let me know how to solve this.
    TIA,
    Jade

    Looks like error is clear namespace mismatch...try changing the following url in wsdl and regen the code
    http://example.ws found http://example.ws/xsd

  • Input Processor Exception Checking

    When an Input Processor throws an exception I understand that the InputProcessor
    processor performs checks for exceptions in the following order:
    1/ InstantiationException, ClassNotFoundException, ClassCastException - logged
    at the ERROR level with a stack trace and thrown back to the webflow
    2/ RuntimeException - thrown back to the Webflow. Will be logged with a stack
    trace
    3/ Exception - thrown back to the webflow. Will be logged at the INFO level without
    a stack trace
    What I am unsure about is where in this hierarchy does the checking for the com.bea.p13n.appflow.exception.ProcessingException
    fit?
    Many Thanks
    - Richard Cooper

    tried with the following example
    public static void main(String[] args) throws Exception {
              // TODO Auto-generated method stub
              String sFilePath="C:\\Folder With Space\\test.xml";
              String sResultFilePath="C:\\Folder With Space\\test1.xml";
              File f1  = new File(sFilePath);
              System.out.println("File exists " + f1.exists());
              DocumentBuilderFactoryImpl  factory = (DocumentBuilderFactoryImpl) DocumentBuilderFactory.newInstance();
              DocumentBuilderImpl parser = (DocumentBuilderImpl) factory.newDocumentBuilder();
              Document document =     parser.parse(f1);
              System.out.println(document.getChildNodes().getLength());
              Transformer transformer = TransformerFactory.newInstance().newTransformer();
              DOMSource xmlSource = new DOMSource(document);
              StreamResult result;
              File f = new File(sResultFilePath);
              if (f.exists() == false) {
              result = new StreamResult(f);
              } else {
              result = new StreamResult(sResultFilePath);
              transformer.transform(xmlSource, result);
              System.out.println(result);I couldn't see any error. It seems the error is with the Parsing API Saxon that you have used, is not able to treat the file path with blank spaces. I would suggest to check the API documentation.

  • Input Date Exception Handling

    Hello all.
    I am usinh myfaces 1.1.1 and I have a form with a date input. The problem is when I delete the day or year value from the field I get an NumberFormatException. I�d like to get just an FacesMessage to the user saying that the field is required. Can I do this without modifying the component?
    Thanks in advance
    Vinicius Dantas e Melo
    [email protected]

    If you convert to a date first, then you can use the date functions, in this case the last_day.
    That way you can loop through the month from the first to the last day.
    DECLARE
      l_year      number      not null:=2010;
      l_month     varchar2(3) not null:='Dec';
      l_firstday  varchar2(9);
      l_day       date;
    BEGIN
      l_firstday := '01'||l_month||to_char(l_year);
      l_day := to_date(l_firstday, 'ddMonyyyy', 'NLS_DATE_LANGUAGE=''AMERICAN''');
      loop
        if to_char(l_day, 'DY', 'NLS_DATE_LANGUAGE=''AMERICAN''') in ('MON', 'TUE', 'WED', 'THU', 'FRI')
        then
          dbms_output.put_line(to_char(l_day, 'DY')||' '||to_char(l_day, 'dd-mm-yyyy'));
           --EXECUTE IMMEDIATE 'update od_ebh_shift_schedule SET "' || i || '" = ''CO'' WHERE year = 2010 and "' || i || '" =''W''';
        end if;
        exit when l_day = last_day(l_day);
        l_day := l_day + 1;
      end loop;
    END;BTW: have you defined your table with column-names like " 01 " (space - zero - one - space)? That doesn't seem like a very good idea to me.
    Edited by: theoa on 24-jan-2011 9:00

  • File uploading & Another question

    So basically, I'm trying to write a program that downloads a remote text file, changes it, and then uploads it to the remote server again. I've accomplished the first, but I can't figure out how to upload it. I have complete access to the server, but I can only do this through port 80, since it's a school project and my school blocks almost every port. Suggestions?
    Edited by: Res on Jun 4, 2011 3:12 PM

    Ah, thanks, that looks like it's exactly what I needed. Now, after doing a little more work on the class, two more questions have popped up. The first is this. when I create the scanner to read the file, it throws an Input Mismatch Exception at me (line 97). I have absolutely no idea what's causing that, or even what it really means. You'll notice that the file is specified by its path due to a weird thing with how my files are set up on my comp, but I don't think that's got anything to do with it. The next question is, when I turn it into a jar, will the HTTPClient libraries be packaged with it, or will I need to pull some fancy footwork with that?
    Link to my code: http://pastebin.com/pkUu5Eg3

  • Read file Exception

    Hi, everyone. I am new to java, and now taking Java Programming class.
    Here's a program that I have been doing for a long time. I am required to read a file, skip all the words afer "#" in each line. The file is like
    # This is a comment. Everything from '#' to the end of the line must be ignored
    # Any empty line like the following one must be ignored.
    0
    1
    3
    I tried to use a scanner to read each token in the file. whenever the scanner reads a "#", I use the nextLine() method to forward the scanner to next line.
    The code I wrote is this
    Scanner input = new Scanner("filename.txt");
    while (input.next().equals("#") ) //skip comments starting with "#"
    input.nextLine();
    int num = input.nextInt(); //read scheduling algorithm
    System.out.print(num);
    I kept getting a Mismatch exception in "int num = input.nextInt();"
    Can anyone help me figure out what the problem is with this piece of code? Thanks in advance.

    jverd wrote:
    morgalr wrote:
    The very most important tool you can learn to use well is your debugger. As a matter of fact, if you don't know how to use your debugger: stop, don't cut another line of code. Get the manual out to the debugger and start studying it, don't make any new code until you know how to enguage that debugger and step throgh your project and see what's wrong. You cannot code, nor ever hope to become a programmer without knowing how to debug code. So quit wasting your time, and if you're here other's time as well, learn to debug. Now. Yes, right now, don't even look at the new project... debugger first.
    Incase you have any questions: Now... right now, quit reading this and get out that debugger and learn how to use it... RIGHT NOW!I wouldn't go quite that far. For beginners writing small 1-5 class programs, println should be fine, and, while most debuggers are pretty straightforward to use, just like I advise against an IDE for beginners because it's yet one more brand new concept to learn, so it goes for debuggers. If they're comfortable with it, fine, but if not, then for a first-year programming student, println is fine.
    But, specific mechanism aside, I agree 100% that having and using something to let you actually see what's happening at each step (as opposed to guessing, and then whining about what it "should" be doing when it goes sideways) is absolutely crucial at all levels of programming.I'd go as far as to say, that debugging (including use of a debugger) should be a formal part of a well rounded coriculum at any university. I have had the pleasure or misfortune, depending on how you look at it, of having to fix undergraduate, graduate, new programmers', and well established programmers' code because they could not figure out what's wrong. In every case the solution was to fire up the debugger and step though their mess of a project and actually see what was going on. If you have the luxury of fixing your own code, a debugger is not so important, but when you're called in to fix someone else's mess, a debugger is one of the best tools at your desposal.
    I think you should start using a debugger with your first "Hello world!" program.

  • How can I display error if the input is not a number?

    I thought I knew how, but I am not sure on what is what in the ASCII character list.
    I need check for errors if the user inputs anything except a positive integer. How could I do that? I had something like this:
    int number;     
    if ((number<0)||(number>80))
              System.out.println(Error please enter a new value
         }But that only filters out negatives, I have tried a few different ways but I cant get it. I dont know why I cant figure it out, its easy, but either way what would I put on the if () line?

    http://asciitable.com
    Wait so I would do
    if ((number<=48)||(number>=57)
          statements......
    }I thought I tried that and it didnt work, but I will try again. Since number is an int, will it still work? And do I need to do '48' with the ' around it?
    Thanks

  • My old Intel-Based iMac is no longer recognizing USB wired input devices; it only recognizes Bluetooth.  What happened?

    My friend's old Intel-Based iMac is no longer recognizing USB-wired input devices (Kensington TrackBall, Logitech Mouse) plugged into any USB slot at the back of the computer.
    They were working before and for many years.
    All of a sudden, A pop up window came up. IT said no Bluetooth mice could be found.  We don't know what set off that window to pop up and look for a WL mouse. It never has before in the 5 or more years my friend has been using this computer.
    I supplied a wireless Apple mouse and his is back running again.
    But want to know why his USB-input devices (Except his keyboard) are not being recognized. He would prefer to use his  Trackpad (Wired), but can't find anything in SYstem PReferences to allow that.  The computer only seems to want a Bluetooth input device.
    Anyone have an idea what happened and if this can be reversed?
    I think he is still running Mac OS X 10.5.8.

    Hi Carol, lets try this...
    reset FW bus, same goes for USB reset...
    Reset the Firewire bus
    If your Firewire or USB isn't recognizing any device.  A solution which has worked for some whose hard drive became invisible in 10.4 was simply to follow these four steps to reset the Firewire/USB bus:
    1. Shut the machine down.
    2. UNPLUG the power lead to the computer and any firewire/USB drive/devices.
    3. leave it for 10 minutes.
    4. Connect back up and reboot.
    http://www.macmaps.com/firewirebug2.html

  • File Attachments are blank - PDF IO Exception

    Hi Everyone,
    I have a Web Dynpro Java Application form that when submitted generates an Adobe Interactive form along with any attachments and starts a guided procedure. Today I'm experiencing a random error (see below), if I preview the Adobe form before the workflow starts then the attachments seems fine (correct size) but once submitted the first approver will get a null pointer exception and the file attachments appear blank. I've used the same data over and over again but it only happens randomly. I can't replicate it in my DEV or  TEST to be able to debug nor can I find the cause.  Anyone know what this error is?
    Processing exception during a "GetAttachments" operation.
    Request start time: Tue Jul 27 10:54:35 CDT 2010
    com.adobe.ProcessingException: com.adobe.ProcessingException: PDF IO exception occurred while retrieving attachments  from PDF: C:\usr\sap\EPP\tmp\adobewa_EPP_14530150\DM7282322298662574320.dir\DM6780062554593568486.tmpjava.io.EOFException: Unexpected end of ZLIB input stream
    Exception Stack Trace:
    com.adobe.ProcessingException: com.adobe.ProcessingException: PDF IO exception occurred while retrieving attachments  from PDF: C:\usr\sap\EPP\tmp\adobewa_EPP_14530150\DM7282322298662574320.dir\DM6780062554593568486.tmpjava.io.EOFException: Unexpected end of ZLIB input stream
         at com.adobe.ads.request.ADSRequest.processOperations(Unknown Source)
         at com.adobe.ads.request.ADSRequest.process(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
         at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
         at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:331)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    Caused by: com.adobe.ProcessingException: PDF IO exception occurred while retrieving attachments  from PDF: C:\usr\sap\EPP\tmp\adobewa_EPP_14530150\DM7282322298662574320.dir\DM6780062554593568486.tmpjava.io.EOFException: Unexpected end of ZLIB input stream
         at com.adobe.ads.operation.GetAttachments.processAllAttachments(Unknown Source)
         at com.adobe.ads.operation.GetAttachments.execute(Unknown Source)
         at com.adobe.ads.operation.ADSOperation.doWork(Unknown Source)
         ... 30 more
    Thanks,
    Wael

    Hi namtrag,
    Please refer the doc: https://forums.adobe.com/docs/DOC-4621
    Regards,
    Rave

  • Inserting to MS-Access -Data mismatch

    I am trying to insert records in to a MS-Access table. However i got a data mismatch exception and on figuring it out i realized there was a date field and i was populating it with string. hence i converted it in to a date and run the query again, however now, i am neither getting an exception nor is the table getting updated.
    The following is the code snippet where i get the data
    List <org.cuashi.wof.ws.nwis.ValueSingleVariable > ValueList = result.getTimeSeries().getValues().getValue();
    for (org.cuashi.wof.ws.nwis.ValueSingleVariable value : ValueList)
    System.out.format("%20s%10.4f",value.getDateTime().toString(),value.getValue());
    System.out.println();
    System.out.println("obtaining time series data");
    String dateTime = value.getDateTime().toString().replace('T',' ');
    //to convert string in to date
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    java.util.Date dt = sdf.parse(dateTime);
    sdf.applyPattern("yyyy-MM-dd HH:mm:ss");
    java.util.Date dt2 = sdf.parse(dateTime);
    updateTable(siteCode,variableCode,dt2,timvalue,varCode,qualifierCode,qualityControlLevel,conn,rs);
    }catch(Exception e)
    public void updateTable(String siteCode,String variableCode,java.util.Date dt2,double tmvalue,String varCode,String qualifierCode,int qualityControlLevel,Connection con,ResultSet rs)
    try{
    System.out.println("inside update");
    // con.setAutoCommit(false);
    PreparedStatement pstmt = con.prepareStatement("INSERT INTO DataValues(ValueID,DataValue,ValueAccuracy,LocalDateTime,UTCOffset,DateTimeUTC,SiteID,VariableID,OffsetValue,OffsetTypeID,CensorCode,QualifierID,MethodID,SourceID,SampleID,DerivedFromID,QualityControlLevelID) VALUES(?,?,?,?,?,?.?,?,?,?,?,?,?,?,?,?,?)");
    pstmt.setString(1,"1");
    pstmt.setDouble(2,tmvalue);
    pstmt.setInt(3,0);
    pstmt.setDate(4,(java.sql.Date) dt2);
    pstmt.setInt(5,0);
    pstmt.setString(6,"0");
    pstmt.setString(7,siteCode);
    pstmt.setString(8,varCode);
    pstmt.setInt(9,0);
    pstmt.setInt(10,0);
    pstmt.setInt(11,0);
    pstmt.setString(12,qualifierCode);
    pstmt.setInt(13,0);
    pstmt.setInt(14,1);
    pstmt.setInt(15,0);
    pstmt.setInt(16,0);
    pstmt.setInt(17,qualityControlLevel);
    System.out.println("Statement prepared");
    pstmt.execute();
    //commit the transaction
    con.commit();
    pstmt.close();
    }catch(SQLException e)
    System.out.println("The Exception is " +e);
    I found out that after field 4 the control does not go to the remaining fields at all.
    Please let me know what i am missing.

    System.out.format("%20s%10.4f",value.getDateTime().toString(),value.getValue());
    System.out.println();
    System.out.println("obtaining time series data");
    String dateTime = value.getDateTime().toString().replace('T',' ');
    //to convert string in to date
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");I'd recommend that you setLenient(false) on your sdf.
    This pattern is what you've got? Sure?
    java.util.Date dt = sdf.parse(dateTime);
    sdf.applyPattern("yyyy-MM-dd HH:mm:ss");
    java.util.Date dt2 = sdf.parse(dateTime);
    updateTable(siteCode,variableCode,dt2,timvalue,varCode,qualifierCode,qualityControlLevel,conn,rs);
    }catch(Exception e)
    {Empty catch block? Not a smart idea. Print the stack trace.
    public void updateTable(String siteCode,String variableCode,java.util.Date dt2,double tmvalue,String varCode,String qualifierCode,int qualityControlLevel,Connection con,ResultSet rs)
    try{
    System.out.println("inside update");
    // con.setAutoCommit(false);
    PreparedStatement pstmt = con.prepareStatement("INSERT INTO DataValues(ValueID,DataValue,ValueAccuracy,LocalDateTime,UTCOffset,DateTimeUTC,SiteID,VariableID,OffsetValue,OffsetTypeID,CensorCode,QualifierID,MethodID,SourceID,SampleID,DerivedFromID,QualityControlLevelID) VALUES(?,?,?,?,?,?.?,?,?,?,?,?,?,?,?,?,?)");
    pstmt.setString(1,"1");
    pstmt.setDouble(2,tmvalue);
    pstmt.setInt(3,0);
    pstmt.setDate(4,(java.sql.Date) dt2);I'd recommend this:
        pstmt.setDate(4,new java.sql.Date(dt2.getTime()));>
    pstmt.setInt(5,0);
    pstmt.setString(6,"0");
    pstmt.setString(7,siteCode);
    pstmt.setString(8,varCode);
    pstmt.setInt(9,0);
    pstmt.setInt(10,0);
    pstmt.setInt(11,0);
    pstmt.setString(12,qualifierCode);
    pstmt.setInt(13,0);
    pstmt.setInt(14,1);
    pstmt.setInt(15,0);
    pstmt.setInt(16,0);
    pstmt.setInt(17,qualityControlLevel);
    System.out.println("Statement prepared");
    pstmt.execute();
    //commit the transaction
    con.commit();
    pstmt.close();You should be closing your statement and connection in a finally block, in indivdual try/catch blocks.
    Set autoCommit back to true.
    >
    }catch(SQLException e)
    {So you don't roll back if there's an exception? Bad idea.
    System.out.println("The Exception is " +e);
    I found out that after field 4 the control does not go to the remaining fields at all.
    Please let me know what i am missing.Lots of stuff. See above.
    %

  • MD04 - exception message 26

    Hi All,
    In MD04 output for a material, i see an exception message 26 & in the MRP element column i see Projct. I would like to know what is this exception message & what might be the reason i am seeing it? For this material i see a order reservation done in 29.3.2006 & a purchase reqn on the same date with exception message 07. But the p-req was not converted to PO. But i see the exception message dated 26.7.2007. Hope my question is clear, await inputs
    Vivek

    Hi,
      Exception Message 26 -
    >  Excess in individual segment
      In the individual segment ( Make to order Planning , individual planning ,direct production , direct proucrement ) the total of the stock and receipts is greater than the reqmts.
      Reason :  the sales order qty has been reduced.
      The exception message is set by the system as follows.
      If stock alone is greater than the reqmts in the individual segment the exception message is displayed in the stock line.
      If receipts are scheduled the exception message is displayed for the receipts that lie in the future.Here  an exception message is given to all receipts whose quantities exceed the reqmts qty.
      on the details screen the system also displays the reqd qty not needed to cover the reqmt qty.
    Regards,
    nandha

  • Retry whole procedure on exception

    Hi everyone,
    I have a process which calls several OBPM procedures.
    Within these OBPM procedures there are several automatics which translate bpm variables (mostly strings / group of strings) to introspected xml variables and the response back to a bpm variable. Sometimes the WS callout won't give the desired result (technical OK, functional NOK; e.g.: customer not found) and I'm throwing an funtional exception when this is the case.
    The problem that I'm having right now, is that when I set the correct BPM variables (e.g. customer number, which is the procedure's input) the exception is sent back to the automatic where the exception occurred and will still fail because the WS response is still incorrect.
    I would like to retry the whole procedure and not just the automatic within the procedure where the exception was thrown.
    I've tried Action = repeat (which saved the instance variables in the screenflow) / retry (throws back to the automatic where the exception occurred) but I'm a bit stuck right now.
    How could I solve this?
    Thanks in advance,
    Joris.

    To anyone having the same problem;
    I didn't get this to work as intended.
    A workaround for me is to create an in- and outgoing instance variable which contains a success/failure status and to have an conditional transition (procresult != "success") from the procedure which would lead to functional exception handling.
    The exception handling screenflow would be able to abort and retry so the only unconditional transition is going back to the failed procedure.

  • [SOLVED] X Server becomes unresponsive to input after a while

    Hello,
    I'm using XFCE 4 without a display manager (just startx) and this is what happens: I launch the terminal and after a few keystrokes the window doesn't accept any more input. Except for an occasional key repeat. After that when I try to drag the window the motherboard just beeps and nothing happens. Although I can drag around the icons in the dock. The window buttons work too.
    I had a similar behavior when I tested the X Server with xterm (I just followed the excellent beginner's guide).
    I'm using xf86-input-evdev with no X configuration for the keyboard except for the layout.
    There are no errors in the Xorg.0.log...
    I never experienced such behavior. Maybe someone of you knows what the cause might be and what other info I could provide. Thanks.
    Last edited by donfabio (2013-06-30 12:53:28)

    I used the computer for a bit longer now and the issue occured again with the new user. I finally replaced the keyboard and it works now. I think the issue was that the old keyboard was faulty (some modifier keys got stuck or something)...
    The only way this showed in the tty was that I couldn't type a backslash while holding the modifier key but just hitting 'ß' (german layout) worked.
    Anyways thanks for your help and sorry for bothering you because of a stupid hardware fault.

Maybe you are looking for