Problem concerning parsing int from .dat input

The following program takes information form a ".dat" file, stores it and manipulates it. However, I am having a weird problem. Whenever I try to parse a n int from a certain point in the file (the end of a line) I keep getting thrown a java.lang.NumberFormatException. I understand why this would be thrown if I was sending it a wrong number, but, I am not. In fact the token before the last one sends it the same number and it parses fine. Here is the problem code;
public void getPrice(Scanner scanner)
while(scanner.hasNextLine())
//puts into string the next scan token
String s = scanner.next();
//takes the scan toke above and puts it into an editable enviroment
stringToken = new StringTokenizer(s, " ", false);
while(stringToken.hasMoreTokens())
//moves position within string in file by one
position++;
/*Starts data orignazation by reading from each perspective field
* 1 = day
* 2 = day of month
* 3 = month
* 4 = year
if(position == 1)
String dayFromFile = stringToken.nextToken();
int dayNum = Integer.parseInt(dayFromFile);
System.out.print(days[dayNum-1] +" ");
else if(position == 2)
System.out.print(stringToken.nextToken() + "/");
else if(position == 3)
System.out.print(stringToken.nextToken() + "/");
else if(position == 4)
System.out.print(stringToken.nextToken() +"\n");
//if it is in [buy] area, it prints
else if(position == 8)
String buy = stringToken.nextToken();
System.out.println("Buy: " +buy );
currentBuyPrice = Integer.parseInt(buy);
if(currentBuyPrice < 0)
currentBuyPrice = 0;
if(currentBuyPrice > buyPrice)
buyPrice += currentBuyPrice;
if(currentBuyPrice == buyPrice)
buyPrice +=0;
else
buyPrice -= currentBuyPrice;
//if it is in [sell] area, it prints, and resets the position to zero because line is over
else if(position == 9)
String sell = stringToken.nextToken();
System.out.println("Sell: " +sell);
**currentSellPrice = Integer.valueOf(sell).intValue();;
if(currentSellPrice < 0)
currentSellPrice = 0;
else if(currentSellPrice > sellPrice)
sellPrice += currentSellPrice;
else if(currentSellPrice == sellPrice)
sellPrice +=0;
else
sellPrice -= currentSellPrice;
scanner.nextLine();
position = 0;
if(scanner.hasNextLine() == false)
System.out.println("Net change of buy price: " buyPrice "\n Net change of sell price: " +sellPrice);
//discards all other string areas
else
stringToken.nextToken();
**The problem is here. The string prints as a perfect number, no spaces or anything. I thought it could be because the number was "-1" but I tried it without the "-" and it still threw the same thing. The really weird thing is that the buy code works fine, and it parses all ints I send it fine.
EDIT:
Here is how the .dat looks;
1 5 15 2006 18 26 12 -1 -1
1 5 15 2006 18 32 20 -1 -1
1 5 15 2006 18 38 29 -1 -1
It is the last "-1" that can not be parsed. I tried putting an excape character at the end so it looked;
1 5 15 2006 18 26 12 -1 -1 &
1 5 15 2006 18 32 20 -1 -1 &
1 5 15 2006 18 38 29 -1 -1 &
That did nothing.

import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;
public class CSE extends JFrame implements ActionListener
//GUI COMPONENTS
JTextField input = new JTextField(20);
JButton submit = new JButton("submit");
//COMPONENTS FOR DATE; OBTAINING CORRECT FOLDER
String days[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
Calendar calSource = Calendar.getInstance();
int day = calSource.get(Calendar.DAY_OF_MONTH);
int month = calSource.get(Calendar.MONTH);
int year = calSource.get(Calendar.YEAR);
int monthCheck [] = {Calendar.JANUARY, Calendar.FEBRUARY, Calendar.MARCH, Calendar.APRIL, Calendar.MAY, Calendar.JUNE, Calendar.JULY, Calendar.AUGUST, Calendar.SEPTEMBER, Calendar.OCTOBER, Calendar.NOVEMBER, Calendar.DECEMBER};
int dayS;
int monthS;
int yearS;
//if there is file found
boolean proceed = false;
//int data for analysis
int buyPrice;
int currentBuyPrice;
int sellPrice;
int currentSellPrice;
//toold for parsing and decoding input
String inputS = null;
String s = null;
StringTokenizer stringToken = null;
Scanner scanner;
int position = 0;
                    public CSE()
                                super("Test CSE");
                                setDefaultCloseOperation(EXIT_ON_CLOSE);
                                input.setBackground(new Color(0, 80, 250));
                                submit.addActionListener(this);
                                getContentPane().add(input, BorderLayout.SOUTH);
                                getContentPane().add(submit, BorderLayout.NORTH);
                                setSize(500, 500);
                                setVisible(true);
                                    public void actionPerformed(ActionEvent e)
                                        getMonth();
                                        inputS = input.getText();
                                        FileReader newRead = null;
                                                try {
                                                       newRead = new FileReader(monthS +"-" +day +"-" +year +"/" +inputS +".dat");
                                                       proceed = true;
                                                    catch(FileNotFoundException f)
                                                       System.out.println("File not found");
                                                       proceed = false;
                                      if(proceed)
                                      BufferedReader bufferedReader = new BufferedReader(newRead);
                                      scanner  = new Scanner(bufferedReader);
                                      scanner.useDelimiter("\n");
                                      getPrice(scanner);
                                public void getPrice(Scanner scanner)
                                    while(scanner.hasNextLine())
                                        //puts into string the next scan token
                                        String s = scanner.next();
                                        //takes the scan toke above and puts it into an editable enviroment
                                        stringToken = new StringTokenizer(s, " ", false);
                                        while(stringToken.hasMoreTokens())
                                                         //moves position within string in file by one
                                                           position++;
                                                       /*Starts data orignazation by reading from each perspective field
                                                        * 1 = day
                                                        * 2 = day of month
                                                        * 3 = month
                                                        * 4 = year
                                                       if(position == 1)
                                                           String dayFromFile = stringToken.nextToken();
                                                            int dayNum = Integer.parseInt(dayFromFile);
                                                          System.out.print(days[dayNum-1] +" ");
                                                       else if(position == 2)
                                                           System.out.print(stringToken.nextToken() + "/");
                                                       else if(position == 3)
                                                           System.out.print(stringToken.nextToken() + "/");
                                                        else if(position == 4)
                                                            System.out.print(stringToken.nextToken() +"\n");
                                                       //if it is in [buy] area, it prints
                                                        else if(position == 8)
                                                            String buy = stringToken.nextToken();
                                                        System.out.println("Buy: " +buy );
                                                        currentBuyPrice = Integer.parseInt(buy);
                                                        if(currentBuyPrice < 0)
                                                            currentBuyPrice = 0;
                                                        if(currentBuyPrice > buyPrice)
                                                                 buyPrice += currentBuyPrice;
                                                        if(currentBuyPrice == buyPrice)
                                                            buyPrice +=0;
                                                           else
                                                               buyPrice -= currentBuyPrice;
                                                        //if it is in [sell] area, it prints, and resets the position to zero because line is over
                                                        else if(position == 9)
                                                            String sell = stringToken.nextToken();
                                                          System.out.println("Sell: " + sell);
                                                          currentSellPrice = Integer.valueOf(sell).intValue();;
                                                           if(currentSellPrice < 0)
                                                               currentSellPrice = 0;
                                                           else if(currentSellPrice > sellPrice)
                                                           sellPrice += currentSellPrice;
                                                            else if(currentSellPrice == sellPrice)
                                                            sellPrice +=0;
                                                           else
                                                           sellPrice -= currentSellPrice;
                                                            scanner.nextLine();
                                                            position = 0;
                                                           if(scanner.hasNextLine() == false)
                                                            System.out.println("Net change of buy price: " +buyPrice +"\n Net change of sell price: " +sellPrice);
                                                        //discards all other string areas
                                                        else
                                                        stringToken.nextToken();
                            public void getMonth()
                                for(int x=0; x < monthCheck.length; x++)
                                    if(month == monthCheck[x])
                                          monthS = (x+1);
                                          x = monthCheck.length;
public static void main(String [] args)
CSE cs = new CSE();
}Make a folder named whatever the current date is, and put a .dat file in there with this;
1 5 15 2006 0 3  52 -1 -1
1 5 15 2006 0 29 52 -1 -1
1 5 15 2006 0 36  1 -1 -1
1 5 15 2006 0 42  9 -1 -1
1 5 15 2006 0 48 18 -1 -1
1 5 15 2006 0 54 29 -1 -1
1 5 15 2006 1 0  37 -1 -1
1 5 15 2006 1 6 44 -1 -1
1 5 15 2006 1 12 53 -1 -1
1 5 15 2006 1 19 1 -1 -1
1 5 15 2006 1 25 9 -1 -1
1 5 15 2006 1 31 18 -1 -1
1 5 15 2006 1 37 27 -1 -1
1 5 15 2006 1 43 37 -1 -1
1 5 15 2006 1 49 46 -1 -1
1 5 15 2006 1 55 53 -1 -1
1 5 15 2006 2 2 1 -1 -1
1 5 15 2006 2 8 10 -1 -1
1 5 15 2006 2 14 27 -1 -1
1 5 15 2006 2 20 37 -1 -1
1 5 15 2006 14 12 45 -1 -1
1 5 15 2006 14 20 36 -1 -1
1 5 15 2006 14 26 44 -1 -1
1 5 15 2006 14 32 52 -1 -1
1 5 15 2006 14 39 0 -1 -1
1 5 15 2006 14 45 8 -1 -1
1 5 15 2006 14 51 17 -1 -1
1 5 15 2006 14 57 26 -1 -1
1 5 15 2006 15 3 35 -1 -1
1 5 15 2006 15 9 43 -1 -1
1 5 15 2006 15 15 51 -1 -1
1 5 15 2006 15 21 59 -1 -1
1 5 15 2006 15 28 6 -1 -1
1 5 15 2006 15 34 15 -1 -1
1 5 15 2006 15 40 24 -1 -1
1 5 15 2006 15 46 33 -1 -1
1 5 15 2006 15 52 40 -1 -1
1 5 15 2006 15 58 48 -1 -1
1 5 15 2006 16 4 56 -1 -1
1 5 15 2006 16 11 5 -1 -1
1 5 15 2006 16 17 14 -1 -1
1 5 15 2006 16 23 24 -1 -1
1 5 15 2006 16 29 32 -1 -1
1 5 15 2006 16 35 39 -1 -1
1 5 15 2006 16 41 47 -1 -1
1 5 15 2006 16 47 55 -1 -1
1 5 15 2006 16 54 4 -1 -1
1 5 15 2006 17 0 13 -1 -1
1 5 15 2006 17 6 23 -1 -1
1 5 15 2006 17 12 31 -1 -1
1 5 15 2006 17 18 39 -1 -1
1 5 15 2006 17 24 46 -1 -1
1 5 15 2006 17 30 55 -1 -1
1 5 15 2006 17 37 3 -1 -1
1 5 15 2006 17 43 12 -1 -1
1 5 15 2006 17 49 20 -1 -1
1 5 15 2006 17 55 29 -1 -1
1 5 15 2006 18 1 36 -1 -1
1 5 15 2006 18 7 44 -1 -1
1 5 15 2006 18 13 53 -1 -1
1 5 15 2006 18 20 2 -1 -1
1 5 15 2006 18 26 12 -1 -1
1 5 15 2006 18 32 20 -1 -1
1 5 15 2006 18 38 29 -1 -1
1 5 15 2006 18 44 36 -1 -1
1 5 15 2006 18 50 45 -1 -1
1 5 15 2006 18 56 54 -1 -1
1 5 15 2006 19 3 3 -1 -1
1 5 15 2006 19 9 10 -1 -1
1 5 15 2006 19 15 18 -1 -1
1 5 15 2006 19 21 26 -1 -1
1 5 15 2006 19 27 34 -1 -1
1 5 15 2006 19 33 44 -1 -1
1 5 15 2006 19 39 53 -1 -1
1 5 15 2006 19 46 3 -1 -1
1 5 15 2006 19 52 12 -1 -1
1 5 15 2006 19 58 20 -1 -1
1 5 15 2006 20 4 30 -1 -1
1 5 15 2006 20 10 38 -1 -1
1 5 15 2006 20 16 50 -1 -1
1 5 15 2006 20 23 0 -1 -1
1 5 15 2006 20 29 9 -1 -1
1 5 15 2006 20 35 17 -1 -1
1 5 15 2006 20 41 24 -1 -1
1 5 15 2006 20 47 32 -1 -1
1 5 15 2006 20 53 40 -1 -1
1 5 15 2006 20 59 49 -1 -1
1 5 15 2006 21 5 59 -1 -1
1 5 15 2006 21 12 8 -1 -1
1 5 15 2006 21 18 16 -1 -1
1 5 15 2006 21 24 23 -1 -1
1 5 15 2006 21 30 31 -1 -1
1 5 15 2006 21 36 40 -1 -1
1 5 15 2006 21 42 49 -1 -1
1 5 15 2006 21 48 57 -1 -1
1 5 15 2006 21 55 5 -1 -1
1 5 15 2006 22 1 12 -1 -1
1 5 15 2006 22 7 20 -1 -1
1 5 15 2006 22 13 28 -1 -1
1 5 15 2006 22 19 38 -1 -1
1 5 15 2006 22 25 48 -1 -1

Similar Messages

  • Problems While Extracting Hours From Date Field

    Hi Guys,
    Hope you are doing well.
    I am facing some problems while extracting hours from date field. Below is an example of my orders table:-
    select * from orders;
    Order_NO     Arrival Time               Product Name
    1          20-NOV-10 10:10:00 AM          Desktop
    2          21-NOV-10 17:26:34 PM          Laptop
    3          22-JAN-11 08:10:00 AM          Printer
    Earlier there was a requirement that daily how many orders are taking place in the order's table, In that I used to write a query
    arrival_time>=trunc((sysdate-1),'DD')
    and arrival_time<trunc((sysdate),'DD')
    The above query gives me yesterday how many orders have been taken place.
    Now I have new requirement to generate a report on every 4 hours how many orders will take place. For an example if current time is 8.00 AM IST then the query should fetch from 4.00 AM till 8 AM how many orders taken place. The report will run next at 12.00 PM IST which will give me order took place from 8.00 AM till 12.00 PM.
    The report will run at every 4 hours a day and generate report of orders taken place of last 4 hours. I have a scheduler which will run this query every hours, but how to make the query understand to fetch order details which arrived last 4 hours. I am not able to achieve this using trunc.
    Can you please assist me how to make this happen. I have checked "Extract" also but I am not satisfied.
    Please help.
    Thanks In Advance
    Arijit

    you may try something like
    with testdata as (
      select sysdate - level/24 t from dual
      connect by level <11
    select
      to_char(sysdate, 'DD-MM-YYYY HH24:MI:SS') s
    , to_char(t, 'DD-MM-YYYY HH24:MI:SS') t from testdata
    where
    t >= trunc(sysdate, 'HH') - numtodsinterval(4, 'HOUR')
    S     T
    19-06-2012 16:08:21     19-06-2012 15:08:21
    19-06-2012 16:08:21     19-06-2012 14:08:21
    19-06-2012 16:08:21     19-06-2012 13:08:21
    19-06-2012 16:08:21     19-06-2012 12:08:21trunc ( ,'HH') truncates the minutes and seconds from the date.
    Extract hour works only on timestamps
    regards
    Edited by: chris227 on 19.06.2012 14:13

  • Parsing XML from Socket input stream

    I create a sax parser to which I send the InputStream from the socket
    But my HandlerBase never gets the events. I get startDocument
    but that is it, I never get any other event.
    The code I have works just like expected when I make the InputStream
    come from a file. The only differeence I see is that when I file is used the
    InputStream is fully consumed while with the socket the InputStream
    is kept open (I MUST KEEP THE SOCKET OPEN ALL THE TIME). If the parser
    does not generate the events unless the InputStream is fully consumed,
    isn't that against the whole idea of SAX (sax event driven) .
    Has anyone been succesfull parsing XML from the InputStream of a socket?
    if yes how?
    I am using JAXP 1.0.1 but I can upgrade to JAXP 1.1.0
    which uses SAX 2.0
    Does anybody know if my needs can be met by JAXP 1.1.0?
    Thanks

    I did the same with client/server model.
    I have client program with SAX parser. Please try if you can make the server side. I was be able to write the program with help from this forum. Please search to see if you can get the forum from which I got help for this program.
    // JAXP packages
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    // JAVA packages
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class XMLSocketClient {
    final private static int buffSize = 1024*10;
    final private static int PORTNUM = 8888;
         final private static int threadSleepValue = 1000;
    private static void usage() {
    System.err.println("Usage: XMLSocketClient [-v] serverAddr");
    System.err.println(" -v = validation");
    System.exit(1);
    public static void main(String[] args) {
    String address = null;
    boolean validation = false;
    Socket socket = null;
    InputStreamReader isr_socket = null;
    BufferedReader br_socket = null;
    CharArrayReader car = null;
    BufferedReader br_car = null;
    char[] charBuff = new char[buffSize];
    int in_buff = 0;
    * Parse arguments of command options
    for (int i = 0; i < args.length; i++) {
    if (args.equals("-v")) {
    validation = true;
    } else {
    address = args[i];
    // Must be last arg
    if (i != args.length - 1) {
    usage();
    // Initialize the socket and streams
    try {
    socket = new Socket(address, PORTNUM);
    isr_socket = new InputStreamReader(socket.getInputStream());
    br_socket = new BufferedReader(isr_socket, buffSize);
    catch (IOException e) {
    System.err.println("Exception: couldn't create stream socket "
    + e.getMessage());
    System.exit(1);
    * Check whether the buffer has input.
    try {
    while (br_socket.ready() != true) {
                   try {
                        Thread.currentThread().sleep(threadSleepValue);     
                   catch (InterruptedException ie) {
              System.err.println("Interrupted error for sleep: "+ ie.getMessage());
                   System.exit(1);
    catch (IOException e) {
    System.err.println("I/O error for in.read(): "+ e.getMessage());
    System.exit(1);
    try {
    in_buff = br_socket.read(charBuff, 0, buffSize);
    System.out.println("in_buff = " + in_buff);
    System.out.println("charBuff length: " + charBuff.length);
    if (in_buff != -1) {
    System.out.println("End of file");
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    System.exit(1);
    System.out.println("reading XML file:");
    StringBuffer display = new StringBuffer();
    display.append(charBuff, 0, in_buff);
    System.out.println(display.toString());
    * Create BufferedReader from the charBuff
    * in order to put into XML parser.
    car = new CharArrayReader(charBuff, 0, in_buff); // these two lines have to be here.
    br_car = new BufferedReader(car);
    * Create a JAXP SAXParserFactory and configure it
    * This section is standard handling of XML document by SAX XML parser.
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setValidating(validation);
    XMLReader xmlReader = null;
    try {
    // Create a JAXP SAXParser
    SAXParser saxParser = spf.newSAXParser();
    // Get the encapsulated SAX XMLReader
    xmlReader = saxParser.getXMLReader();
    } catch (Exception ex) {
    System.err.println(ex);
    System.exit(1);
    // Set the ContentHandler of the XMLReader
    xmlReader.setContentHandler(new MyXMLHandler());
    // Set an ErrorHandler before parsing
    xmlReader.setErrorHandler(new MyErrorHandler(System.err));
    try {
    * Tell the XMLReader to parse the XML document
    xmlReader.parse(new InputSource(br_car));
    } catch (SAXException se) {
    System.err.println(se.getMessage());
    System.exit(1);
    } catch (IOException ioe) {
    System.err.println(ioe);
    System.exit(1);
    * Clearance of i/o functions after parsing.
    try {
    br_socket.close();
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    try {
    socket.close();
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    try {
    br_car.close();
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    * The XML handler used by this program
    class MyXMLHandler extends DefaultHandler {
    // A Hashtable with tag names as keys and Integers as values
    private Hashtable tags;
    // Parser calls this once at the beginning of a document
    public void startDocument() throws SAXException {
    System.out.println("startDocument()");
    tags = new Hashtable();
    // Parser calls this for each element in a document
    public void startElement(String namespaceURI, String localName,
    String rawName, Attributes atts)
    throws SAXException
    String key = localName;
    Object value = tags.get(key);
    System.out.println("startElement()");
    System.out.println("namespaceURI: " + namespaceURI);
    System.out.println("localName: " + localName);
    System.out.println("rawName: " + rawName);
    if (value == null) {
    // Add a new entry
    tags.put(key, new Integer(1));
    } else {
    // Get the current count and increment it
    int count = ((Integer)value).intValue();
    count++;
    tags.put(key, new Integer(count));
    // Parser calls this once after parsing a document
    public void endDocument() throws SAXException {
    Enumeration e = tags.keys();
    System.out.println("endDocument()");
    while (e.hasMoreElements()) {
    String tag = (String)e.nextElement();
    int count = ((Integer)tags.get(tag)).intValue();
    System.out.println("Tag <" + tag + "> occurs " + count
    + " times");
    * Error handler of XML parser to report errors and warnings
    * This is standard handling.
    class MyErrorHandler implements ErrorHandler {
    /** Error handler output goes here */
    private PrintStream out;
    MyErrorHandler(PrintStream out) {
    this.out = out;
    * Returns a string describing parse exception details
    private String getParseExceptionInfo(SAXParseException spe) {
    String systemId = spe.getSystemId();
    if (systemId == null) {
    systemId = "null";
    String info = "URI=" + systemId +
    " Line=" + spe.getLineNumber() +
    ": " + spe.getMessage();
    return info;
    * The following methods are standard SAX ErrorHandler methods.
    * See SAX documentation for more info.
    public void warning(SAXParseException spe) throws SAXException {
    out.println("Warning: " + getParseExceptionInfo(spe));
    public void error(SAXParseException spe) throws SAXException {
    String message = "Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    public void fatalError(SAXParseException spe) throws SAXException {
    String message = "Fatal Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);

  • Inbox preview problem - cannot see subject, from, date etc but can read emails..

    Hello All
    I am using Thunderbird on a Mac, this problem began yesterday.
    The preview section of my inbox is not showing that is things like subject, from, date etc all I am seeing is blank rows but I can still click on these rows to see my messages.
    I have attached a screenshot to show the problem, I am quite baffled by this.
    I am running 4 inboxes but only this one has the problem, it is through imap, (screenshot attached of the inbox properties)
    Any help would be greatly appreciated.
    Thanks

    I found another thread that had userChrome code in it that I was able to modify how I wanted it. :)

  • Problem converting to INT from an XML file

    Hi folks, I hope you can help with this one, as it's been driving me nuts...
    Basically (and I'll try to keep this brief!) my project takes in an extremely basic XML file. I've never really done this before, but I seem to have got most of it working apart from taking in attribute values which I want to use as integers.
    Essentially, each element relates to objects of a basic class I have set up, while each attribute relates to the variables for the object. When the XML file is read, a new object is set up for each element and is stored in a linked list. That was supposed to be the difficult bit, but it turns out it hasn't been...
    The XML file looks a little bit like this (only the elements are shown to save space):
    <Object name="My object" description = "blah" x_axis = "96" y_axis="23" />
    <Object name="Another one" description = "blah, again" x_axis = "83" y_axis="40"/>
    etc. etc. The problem relates to the x_axis and y_axis attributes. While the description and name attributes are assigned correctly, for some reason the x_axis and y_axis attributes are both given values of zero when I convert them from Strings to Ints. After much printing to the console, kicking and screaming, I think I've narrowed the problem down to the following code:
    if (attrib.getName() == "x_axis")
    int myX = Integer.parseInt(attrib.getValue()); // converting a string to an int
    myObject.setSoundX_Axis(myX);
    // And, of course, I do the same sort of thing for the Y axis.Anyone know why I'm getting zero values? Is it something to do with the way I'm converting the string to an int in Java?
    Cheers for any help.

    int myX = Integer.parseInt(attrib.getValue());I don't see anything wrong. Try printing out the value of attrib.getValue() to see if it is what you expect. You may want to try:
    String s = "" + myX;
    if ( s.compareTo(attrib.getValue() != 0 ) {
        System.out.println("Don't compare: myX=" + myX + " getValue=" + attrib.getValue());
    }

  • BPEL problem after upgrading Jdeveloper from 10.1.3.1.0 to 10.1.3.3.0

    The problem concerns upgrading JDev from 10.1.3.1.0 to 10.1.3.3.0. At the moment I’ve got both versions installed side by side, and when I fire up version 10.1.3.1.0 everything is fine. However when I try and rebuild any of the existing BPEL’s in 10.1.3.3.0, I’m getting errors such as this:
    Error:
    [Error ORABPEL-10903]: failed to read wsdl
    [Description]: in "bpel.xml", Failed to read wsdl.
    Error happened when reading wsdl at "http://trips-services:8888/trips-services/TaxpayerAccountingService?WSDL", because "Failed to read WSDL from http://trips-services:8888/trips-services/TaxpayerAccountingService?WSDL: HTTP connection error code is 407".
    Make sure wsdl exists at that URL and is valid.
    [Potential fix]: If your site has a proxy server, then you may need to configure your BPEL Server, designer and browser with your proxy server configuration settings (see tech note on http://otn.oracle.com/bpel for instructions).
    If I put the URL http://trips-services:8888/trips-services/TaxpayerAccountingService?WSDL into my browser, it retrieves the file correctly; my settings in Tools -> Settings -> Web Browser and Proxy are identical in both versions.
    The same or similar errors occur in just about every BPEL I have looked at.
    Does anybody have an idea what the problem might be here?

    Hi Ken,
    Could you tell us how you've defined your proxy exception list ?
    I'm havind the same problems in a 10.1.3.3 environment where I'm not able to deploy a bpel process with an external webservice because of http 407-error.
    Kind regards,
    Nathalie

  • Compound date (dd.MM.yyyy HH:mm) from two input fields

    Hi,
    I need to compound a date field in format dd.MM.yyyy HH:mm from two input fields(date and time field). I was trying a lot but could not get it to work. So right now I'm trying to start it simple but still have a couple of problems.
    1.) To start easy I wanted to fill a hardcoded date into my field.
    setAttribute(MYDATE, "01.01.2005 12:10");
    brings (java.lang.IllegalArgumentException) Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
    2.) setAttributeInternal(MYDATE, "01.01.2005 12:10");
    brings JBO-27018: AttrSetValException Cause: The type of attribute value provided as an argument to the set() method for this attribute is not an instance of the Java type that this attribute expects.
    3.) The thing that I reall need is something like:
    DateFormat sim = new SimpleDateFormat("dd.MM.yyyy HH:mm");
    java.util.Date datum = new java.util.Date();
    try
    datum = sim.parse("01.01.2005 12:30");
    } catch (ParseException e)
    setAttributeInternal(MYDATE, datum);
    but right now this also ends with the JBO-27018
    I also did try different types (timestamp and date) in my entity object and different format masks. Not working at all. All the threads I found are pointing to articles from Steve, which are not available anymore (the links don't work). So any help is appreciated.
    Regards, Peter

    Thankyou for the hint. I get it to work with
    public void whatever
    DateFormat simple = new SimpleDateFormat("dd.MM.yyyy HH:mm");
    java.util.Date javaDate = new java.util.Date();
    try
    javaDate = simple.parse("01.01.2005 12:30");
    } catch (ParseException e)
    java.sql.Timestamp sqlDate = new java.sql.Timestamp(javaDate.getTime());
    oracle.jbo.domain.Date nowDate = new oracle.jbo.domain.Date(sqlDate);
    setAttributeInternal(MYDATE, nowDate);
    but is there an easier and more 'beautiful' way to do this? Like using a date formatter on oracle.jbo.domain.Date instead using the SimpleDateFormat? btw. did I mention that I'm a Forms and PL/SQL programmer ;-)
    Regards, Peter

  • How to submit data from multiple Input Ports in single SUBMIT button  click

    Hi,
    I am in SPS8.
    What exactly steps I need to perform to submit data from multiple Input Ports.
    I couldn't able to submit One input Form and one Input Table to BAPI data service in single SUBMIT button click.
    I debugged the VC application in SPS8.
    While debugging, I found that when I click the SUBMIT button in the Input Form, Only data in that Input
    form are being passed to the BAPI, But not the Table Form data.
    If I click on the SUBMIT button in another Input Table, Only data from that table is being passed to the BAPI, but not the Input form data.
    Essentially I need to submit both of them in one SUBMIT button.
    Thanks,
    Ramakrishna

    Ramakrishna,
    From the word document that you sent to me the steps you are missing to map the appropriate information into the BAPI is first you are not mapping all data rows into the table input port. To do this double click on the input table view and change your selection mode from single to multiple. Then when you click on your link between the BAPI and your input table you will see a new option appears under data mapping "Mapping Scope" select All Data Rows.
    That's the first part of the problem to get the BAPI to recognize both the inputs coming from the form and the table eliminate the submit button from the form. Drag and drop a link from the output port of the table view to the Input port of the BAPI. Double click on the link between the BAPI and the table view and open the expressions editor for the two fields:
    1/ Automatic Source
    2/ SKIP_ITEMS_WITH_ERROR
    On the hierarchical folder structure on the right expand expand the Data Fields node to find the fields from the form and map them accordingly.
    Now when you hit the submit button on your table it should pass the BAPI all the parameters from both the form and the table.
    Hope this helps,
    Cheers,
    Scott

  • Problem parsing the path data - error on jpgs

    Photoshop CS2 v9.0.2 Windows XP SP2
    Received the following error message in CS2: "Could not complete your request because of a problem parsing the path data"
    I began getting the message above after adding ITPC data to three .jpg files. The message appears when I try to open the files from either Bridge or Windows Explorer. Other files are not affected. The .psd master file with the same metadata opens ok. I tried clearing the ITPC data, but this had no affect. I also tried moving the file to a different folder and renamed the file with no success. The files open ok in Windows Paint and appear ok in Bridge.
    I created the ITPC data on one file in Photoshop and saved a metadata template. Then, in Bridge 1.0.4.6 I used the "replace metadata" command on the other two files.
    I searched the knowledge base and this forum. I found only one hit in the forum from 2007, but there were no responses.
    Can anyone describe what triggers this message, and how to avoid it or fix it?
    Thanks

    Foward / backward slashes should not cause issues, as they are part of the standard character set on any system for obvious reasons, but I would more assume that this is an issue in how Windows translates the file info to native paths and tries to access those paths for verification. I seem to recall having read something along those lines recently in relation to some security issues, but I'm not really sure. anyway, does "escaping" the characters improve the matter (\\ or \/)?
    Mylenium

  • How to pass the data from a input table to RFC data service?

    Hi,
    I am doing a prototype with VC, I'm wondering how VC pass the data from a table view to a backend data service? For example, I have one RFC in the backend system with a tabel type importing parameter, now I want to pass all the data from an input table view to the RFC, I guess it's possible but I don't know how to do it.
    I try to create some events between the input table and data service, but seems there is no a system event can export the whole table to the backend data service.
    Thanks for your answer.

    Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to  be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
    Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
    Thanks.

  • How to combine data from different input forms outside a nested iView

    Hi,
    i try to combine data from different input forms in a single one.
    Because of space reasons in Flex compiling i already use nested iViews. Within these nested iViews its possible to use the 'combine' function to do this.
    But in the main iView I cant compose these function with other elements. I need to do this because of using these model in Guided Procedures with output parameters. These parameters I only get with a 'endPoint'. Unfortunatly its not possible to combine data from different input forms into the 'endPoint'.
    Is there any solution?
    Thanx
    Mathias

    Hi Scott,
    i tried this already and i also tried to map all parameters in the endpoint by drawing lines from the other forms and assign the 'empty parameters' by a formula.
    And when i create a collable object in GP and assign the VC iView, only the parameters of the parent-form (the form who trigger the event) are shown as output-parameters.
    Maybe any other ideas? I cant believe that such a simple thing is not possible?!?!
    In my opinion, thats a bug, that I'am not able to use the combine-operator in the main VC-iView. Whats your mind?
    greets
    mathias

  • Hi, I have a Power Book G4 Tiger 10.4.11 and my problem concerns iTunes 9.2.1(5). I have changed my Apple ID and password recently. Since that, I am told when I try to buy something in iTunes Store that my "session has expired". Where does this come from?

    Hi, I have a Power Book G4 Tiger 10.4.11 and my problem concerns iTunes 9.2.1(5). I have changed my Apple ID and password recently. Since that, I am told, only when I try to buy something in iTunes Store, that my "session has expired". Where does this come from? What should I do to solve this problem ? I would greatly appreciate your help. Thank you in advance.

    Hi, I am khonthaï. I solved the problem thanks to JHdeVilliers's post on 4 Dec. 2011: I removed all cookies in Safari and it worked immediately !!!

  • I recently lost my MacBook pro which was synched with my apple tv.Now I'm having a problem to bring back my data from my apple tv to my new MacBook

    I recently lost my MacBook pro which was synched with my apple tv.Now I'm having a problem to bring back my data from my apple tv to my new MacBook

    Welcome to the Apple community.
    If you are referring to the first generation Apple TV, then you cannot sync content which is stored on its hard drive back to iTunes.

  • Facing Problem in parsing a string to date

    Hi,
    I was trying to change a string into date with date format ("EEEE,MMM,d,h:mm") but I always get the year as 1970.
    here is my code
    String strDate="Saturday,Jan 19 7:31";
    String dateFormat3="EEEE,MMM,d,h:mm";
         try {
         DateFormat myDateFormat = new SimpleDateFormat(dateFormat3);
         result1=myDateFormat.parse(strDate);
    catch(ParseException pe) {
                System.out.println("ERROR: could not parse date in string \"" +
            }any solution for it.

    This is my actual code
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.Locale;
    public class TestingDate {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              String dateFormat="EEEE, MMM d h:mm a";
              Date test=new Date(2007,0,19, 19, 31);
              System.out.println(" original date is "+test);
              String stringResult=DateToString(test,dateFormat);
              System.out.println("Date to string is "+stringResult);
              Date dateResult=stringToDate(stringResult,dateFormat);
              System.out.println(" String to date is "+dateResult);
              String stringResult2=DateToString(dateResult,dateFormat);
              System.out.println(" Date to string  is "+stringResult2);
    public static String DateToString(Date test, String dateFormat) {
             String result = null;
             try {
                  DateFormat myDateFormat = new SimpleDateFormat(dateFormat);
                     result = myDateFormat.format(test);
                     //System.out.println(" reslut date is "+result);
              } catch (Exception e) {
                   System.out.println(" Exception is "+e);
              return result;
    public static Date stringToDate(String strDate,String dateFormat1){
         Date result1=null;
         try {
              DateFormat myDateFormat = new SimpleDateFormat(dateFormat1);
              result1=myDateFormat.parse(strDate);
         catch(Exception e){
              System.out.println(" exception is "+e);
         return result1;
    }I am facing problem in getting the actual date. Please suggest the solution.

  • Problem in parsing date having Chinese character when dateformat is 'MMM'

    I m calling jsp page using following code:
    var ratewin = window.showModalDialog("Details.jsp?startDate="+startDate,window, dlgSettings );
    In my javascript when checked by adding alerts I m getting correct values before passing to jsp,
    alert("startDate:"+startDate);
    In jsp page my code is like below:
    String startDate = request.getParameter("startDate");     
    but here I m getting garbage values in month when the dateformat is 'MMM', because of which date parsing is failing.
    This happens only Chinese character.
    following 2 encoding are already in my jsp page,can anyone help to find solution?
         <%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
         <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"/>
    I have even tried to read it as UTF-8 but still that's failing.

    This is my actual code
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.Locale;
    public class TestingDate {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              String dateFormat="EEEE, MMM d h:mm a";
              Date test=new Date(2007,0,19, 19, 31);
              System.out.println(" original date is "+test);
              String stringResult=DateToString(test,dateFormat);
              System.out.println("Date to string is "+stringResult);
              Date dateResult=stringToDate(stringResult,dateFormat);
              System.out.println(" String to date is "+dateResult);
              String stringResult2=DateToString(dateResult,dateFormat);
              System.out.println(" Date to string  is "+stringResult2);
    public static String DateToString(Date test, String dateFormat) {
             String result = null;
             try {
                  DateFormat myDateFormat = new SimpleDateFormat(dateFormat);
                     result = myDateFormat.format(test);
                     //System.out.println(" reslut date is "+result);
              } catch (Exception e) {
                   System.out.println(" Exception is "+e);
              return result;
    public static Date stringToDate(String strDate,String dateFormat1){
         Date result1=null;
         try {
              DateFormat myDateFormat = new SimpleDateFormat(dateFormat1);
              result1=myDateFormat.parse(strDate);
         catch(Exception e){
              System.out.println(" exception is "+e);
         return result1;
    }I am facing problem in getting the actual date. Please suggest the solution.

Maybe you are looking for

  • HOW THE **** DO I DELETE A DOWNLOADING APP ON MY IPOD TOUCH?!?!?

    Recently my friend's son went on my ipod touch, he played a few games then saw an advertisment for Tap Pet Shop and Tap Zoo and he wanted to play them so he downloaded the apps. This morning i found these 2 grayed out apps on my ipod touch, i've trie

  • Spontaneous black screen with Zen V Plus. / Where do I send it

    Dear Creative, I purchased a 2GB Zen V Plus roughly four months ago. It was a present to myself and a tool to accompany me on my long flight. (You see, I was about to spend 9 hours on a plane as I moved to the United Kingdom.) Before I purchased this

  • I cannot edit/navigate the number on dialer

    hi everyone, this is very annoying thing in the iphone. Even a simple basic mobile has this feature. Once you dial a number and if you want to edit it like you want to add the 0 or the country code at the beginning then apple won't allow user to do i

  • Cant install iunes 9 unknown publisher error

    new laptop and pc wont install itunes 9 running windows 7 keeps coming up with unknown pulisher for the certificate so it will not install. how do I get round this?

  • Cancellation of background job

    HI ALL, I have executed one program in backgroubd , it updates one of the database table . It now second day and still ACTIVE , i want to do some changes in the program and see its effect now . How can i cancel this job , so that whatever chnages hav