Unexpected java.util.Scanner behaviour

Is it just me or do others find the following behaviour strange? It seems that in order to break out of the loop in the following, it's necessary to enter some character(s) unparseable as a double. Hitting return won't cause it to break:
     public static void scanInts(String[] args) {
          Scanner scanner = null;
          List<Double> coefficients = new ArrayList<Double>();
          double x = Double.NaN;
          try {
               scanner = new Scanner(System.in);
               while(scanner.hasNextDouble()) {
                    double d = scanner.nextDouble();
                    System.out.println("double=" + d);
                    coefficients.add(d);
               System.out.println("Now out of loop");
          finally {
               System.out.println(coefficients);
               scanner.close();
     }

I don't think it's strange; Scanner is supposed to ignore extra whitespace and line breaks are whitespace. You can change this behaviour by setting the delimiter to something else, like:scanner.useDelimiter("[ ]*");

Similar Messages

  • The import "java.util.scanner" is not vaild

    I am experiment with the java.util.scanner API after compiling the code below I received the following error:
    The import "java.util.Scanner" is not valid, since it does not name a type in a package.
    I declared a string variable should that suffice?
    import java.util.Scanner;
    public class Echo {
    public static void main (String[] args)
    String message;
    Scanner scan = new Scanner (System.in);
    System.out.println ("enter something:");
    message = scan.nextLine();
    System.out.println ("hey you entered: \"" + message + "\"");
    }

    Most IDEs let you select and installed JDK for them to use. Check out that IDE's preferences.
    Otherwise, start here and learn to do it with a simple text editor or programmer's editor, and the command line.
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/

  • Regex & java.util.Scanner

    I am trying to make a simple txt parser using regular expressions but the problem has
    appeared.
    The program's code is too long so I have stated only the part of the code implementing
    the method data_types() which doesn't work properly, it reads only two types (String) and (Boolean). If someone could help me I would be very gratefull.Why method doesn't read the rest of data types in my data_xml.xml file?
    here is the code >
    class SimpleScann{
           enum PARSE{
              TABLE_NAME("(\\w*)"),COLUMN_NAME("(\\w*\\Q(\\E)"),DATA_TYPE("(\\Q(\\E\\w*\\Q)\\E)");
              private String $pattern;
              PARSE(String pattern){
                   $pattern=pattern;
              public String PATTERN(){
                   return $pattern;
         static void data_types() throws Exception{     
              File parse_file= new File("data_type.txt");
              Scanner     scann_input = new Scanner(parse_file);     
              int flag= Pattern.CASE_INSENSITIVE;
              Pattern pattern=Pattern.compile(PARSE.DATA_TYPE.PATTERN(),flag);
              Matcher matcher=null;
              while(scann_input.hasNextLine()){
                   matcher=pattern.matcher(scann_input.nextLine());
                   if(matcher.find()){
                        System.out.printf("%s\n",matcher.group());
         public static void main(String args[])
              try{
                   data_types();
              }catch(Exception e){
                   e.printStackTrace();
    and here is the data_type.txt<table          > Table radi
    ako su zatvoreni tagovi     <>
    <column>
         Ime(String), Prezime(String), JMBG(Integer) ,
         Enabled(Boolean)
    <\column>
    best regards,
    Nikola

    The reason you're only matching two items is because you're reading the file one line at a time and applying the regex once per line. As Tim said, you can fix that by using while instead of if, but the real problem is much deeper: you're trying to write a scanner in the sense of a lexical analyzer, and that isn't what java.util.Scanner is for. I strongly recommend you start over, this time using Pattern and Matcher directly, not Scanner. If you happen to have a copy of MRE 3ed, there's an example of what you're trying to do on page 400. (Unfortunately, Friedl has just moved back to Japan, and hasn't had time to update the book's web site, or I could point you to the code online.) I don't have time to go into this right now, but you should pay particular attention to the find(int) method and the \G anchor.

  • Error when importing java.util.Scanner

    Agh! I'm in an introduction to computer science course, and I am writing a program as an assignment that's due tomorrow.
    I have imported java.util.Scanner before, but I've only run it on the Windows PCs in the lab, whereas I am currently on a Mac. I've updated to the latest version of Java (through the software update), and I'm running Tiger (also fully updated).
    I'm using Dr. Java to write the programs, but I tried using the very same thing in Eclipse and it didn't work. Here's my program:
    import java.util.Random;
    import java.util.Scanner;
    public class Password {
    public static void main(String[] args) {
    //create a Scanner object to read from the keyboard:
    String password;
    Scanner scanner = new Scanner(System.in);
    Random randomizer = new Random();
    System.out.println("Please enter a string containing candidate characters.");
    String input = scanner.next();
    int charLength = length(input);
    System.out.print("Random password: ");
    System.out.print(input.substring(randomizer.nextInt(charLength)));
    System.out.print(input.substring(randomizer.nextInt(charLength)));
    System.out.print(input.substring(randomizer.nextInt(charLength)));
    System.out.println(input.substring(randomizer.nextInt(charLength)));
    And, here's my errors:
    4 errors found:
    File: /Users/brianmoore/Desktop/Password.java [line: 11]
    Error: cannot resolve symbol
    symbol : class Scanner
    location: package util
    File: /Users/brianmoore/Desktop/Password.java [line: 18]
    Error: cannot resolve symbol
    symbol : class Scanner
    location: class Password
    File: /Users/brianmoore/Desktop/Password.java [line: 18]
    Error: cannot resolve symbol
    symbol : class Scanner
    location: class Password
    File: /Users/brianmoore/Desktop/Password.java [line: 22]
    Error: cannot resolve symbol
    symbol : method length (java.lang.String)
    location: class Password
    Any ideas?

    Ok. I figured it out. On the Dr. Java page, this is what helped me:
    Please verify the following:
    - Open "/Applications/Utilities/Java/J2SE 5.0/Java
    Preferences";
    make sure "J2SE 5.0" is at the top of the list under
    "Java
    Application Runtime"
    - Open DrJava; go to Edit->Preferences; make sure
    "Tools.jar
    Location", "JSR-14 Location", and "JSR-14
    Collections Path"
    are all blank
    - Open the Help->About dialog box; make sure the "DrJava
    Version" listed is 20050601-0007 or later (that is, later
    than
    June 1, 2005)
    - Go to the "System Properties" tab in the
    "About" box; make
    sure "java.version" is 1.4.2.
    Let us know what you find out if you're still having
    trouble.
    Thanks for your help!

  • What the HELL with java.util.Scanner

    Hello people...
    Somebody have a pointer that teaches how to work with Scanner, or everybody fells like me, as this API just don't work well!!!?
    At this right moment I have the same JAR file, run something at linux and work well, but when at windows got an exception...

    http://java.sun.com/developer/JDCTechTips/2004/tt1201.html
    http://java.sun.com/docs/books/tutorial/essential/io/scanning.html
    ~Tim

  • Input via java.util.Scanner

    I know it's possible for JDeveoper 10G to take input via BufferedReader, is the same possible using the scanner class as in:
    Scanner input = new Scanner(System.in);
    System.out.println("Enter your age");
    int age = input.nextInt();
    System.out.println("You are " + age);
    JDeveloper can't seem to take imput from the scanner class. Is there a way arround this?
    Andrew.

    I am aware of that Shay, but it does not work for the Scanner Class, at least for me anyway.
    Try the following example code in JDeveloper 10.1.3 I constructed this to put the Scanner though its paces for the Job I need.
    It works very well when used from the command line, but cannot be read with JDeveloper even with those settings you describe turned on.
    Scanner input = new Scanner(System.in);
    System.out.println("Enter your age");
    int age = input.nextInt();
    System.out.println("You are " + age);
    System.out.println("what is your name?");
    String name = input.next();
    System.out.println("Yout name is " + name);
    System.out.println("Please enter your height");
    double height = input.nextDouble();
    System.out.println("So you are " + height + " tall.");
    System.out.println("What sex are you M/F?");
    char sex = input.next().charAt(0);
    if (sex == 'm' || sex == 'M')
    System.out.println("Ahh so your a male");
    else if (sex == 'f' || sex == 'F')
    System.out.println("Ah you your a femaile.");
    System.out.println("You are English right? (True/alse)?");
    boolean eng = input.nextBoolean();
    System.out.println("Right so it's " + eng + " that your English. You are " + age + " years of age, and your name is " + name + ", your sex is " + sex + " and you are " + height + " tall.");
    Message was edited by:
    Scottie_UK

  • Exception: Scanner - java.util.NoSuchElementException: No line found ???

    Hi there,
    I have the following code:
    import java.util.InputMismatchException;
    import java.util.Scanner;
    public class Input {
         public static String readString() {
              return _readString(null, null);
         public static String readString(String title) {
              return _readString(title, null);
         public static String readString(String title, String error) {
              return _readString(title, error);
         private static String _readString(String title, String error) {
              Scanner input = new Scanner(System.in);
              boolean loop = true;
              String str = null;
              while(loop) {
                   try {
                        if(title != null) {
                             System.out.print(title);
                        str = input.nextLine();
                        loop = false;
                   } catch(InputMismatchException e) {
                        if(error != null) {
                             System.out.println(error);
              input.close();
              return str;
    public class Program {
         public static void main(String[] args) {
              String a;
              a = Input.readString("VALUE: ");
              System.out.println(a);
              a = Input.readString("\nVALUE: ");
              System.out.println(a);
    }And the following output:
    VALOR: Hello World!
    Hello World!
    VALUE: Exception in thread "main" java.util.NoSuchElementException: No line found
         at java.util.Scanner.nextLine(Scanner.java:1516)
         at Input._readString(Input.java:29)
         at Input.readString(Input.java:11)
         at Program.main(Program.java:21)The first value is read without any problems but the second throws that exception. Why is this happening? I "fixed" it by removing the input.close(); line but this makes no sense to me. First because I think that I should close the Scanner after using it and second because every time I call the _readString() method, a new Scanner instance will be created, so it doesn't make sense... At least for me, but that's why I'm posting on this forum section, cause I'm new to Java.
    Can someone explain me why exactly does this happen and if possible, a better solution then to remove the input.close()? It just doesn't make any sense to me create a new Scanner instance every time I call the _readString() method and leave it there without closing it...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    First because I think that I should close the Scanner after using it and
    second because every time I call the _readString() method, a new Scanner instance will be createdUmm, NO.
    Let me see if I understand things in the Static world correctly.
    Notice that you have everything declared as "Static" in your Class. A static is only initialized at programs start and everything in your JVM can then us it (well that stuff that has a reference to it). Since it's static, when you close the Scanner, you are closing the only instance that will ever exist in your object.
    For things to work how you think they should, get rid of the Static declarations (excpet in main, where you have to keep them).

  • Static class containing scanner throws java.util.NoSuchElementException

    I use the scanner class pretty often in my coding and recently i have been trying to create a static method i can put in an external class to do the scanning for me and trap any errors.
    I seem to be able to create the class successfully but i have a slight problem in that i cannot use the method twice in the same program without having it throw a java.util.NoSuchElementException
    If anyone could figure out what error i have made and suggest a way to fix it i would be very grateful
    code is as follows:
    Scan.java:
    // name information removed for privacy
      // class info removed for privacy
      Assignment: 4.3,
      File Name: /ASSIGNMENTS/ASSIGNMENT_4/Part3/Scan.java
    import java.util.Scanner;
    public class Scan
      public static double nextDouble (String prompt)
        // variable to hold the result
        double result = 0.0;
        // variable to determine if input was ok
        Boolean inputOK = false;
        // do-while loop to get some input
        do
          // print the prompt. what do you want to ask for?
          System.out.print ( prompt );
          // Try to scan and capture the input and catch the exception
          try
            // create the scanner object
            Scanner scan = new Scanner (System.in);
            // parse the input`
            result = scan.nextDouble();
            // if we reach this step then good. we got good input let's exit the loop
            inputOK = true;
            // close the scanner
            scan.close();
          // oops we got an error!
          catch (java.util.InputMismatchException e)
            // inform the user of the error
            System.out.println ("That is not a number! Try again. \n");
            // input was not ok so we can't exit the loop yet
            inputOK = false;
        // keep looping as long as inputOK is false
        } while (!inputOK);
        // return out result
        return result;
    }Mathematics.java:
    // name information removed for privacy
    // class information removed for privacy
    * Assignment: 4.3
    * File Name: ASSIGNMENTS/ASSIGNMENT_4/Part3/Mathematics.java
    // Import Scanner class
    import java.util.Scanner;
    //Class Body
    public class Mathematics{
    // Main method. AUTO EXECUTE
      public static void main(String[] args)
    // additional variable declarations removed for brevity
        // Create double precision floating point variables
          double  coeff4 = 0.0, coeff3 = 0.0, coeff2 = 0.0, coeff1 = 0.0, cons = 0.0;
        coeff4 = Scan.nextDouble("Enter the coefficient of x^4 (0.0 if none): ");
        coeff3 = Scan.nextDouble("Enter the coefficient of x^3 (0.0 if none): ");
        coeff2 = Scan.nextDouble("Enter the coefficient of x^2 (0.0 if none): ");
        coeff1 = Scan.nextDouble("Enter the coefficient of x (0.0 if none): ");
        cons = Scan.nextDouble("Enter the constant (0.0 if none): ");
    // do fun things with input (code removed for brevity)
    }output looks like this
    dragonfly@Home:~/ASSIGNMENTS/ASSIGNMENT_4/Part3$ java Mathematics
    Enter the coefficient of x^4 (0.0 if none): hello boys!
    That is not a number! Try again.
    Enter the coefficient of x^4 (0.0 if none): 1.2.
    That is not a number! Try again.
    Enter the coefficient of x^4 (0.0 if none): d
    That is not a number! Try again.
    Enter the coefficient of x^4 (0.0 if none): 1
    Enter the coefficient of x^3 (0.0 if none): Exception in thread "main" java.util.NoSuchElementException
            at java.util.Scanner.throwFor(Scanner.java:817)
            at java.util.Scanner.next(Scanner.java:1431)
            at java.util.Scanner.nextDouble(Scanner.java:2335)
            at Scan.nextDouble(Scan.java:23)
            at Mathematics.main(Mathematics.java:34)
    dragonfly@Home:~/ASSIGNMENTS/ASSIGNMENT_4/Part3$

    Through trial and error i seem to have hit upon a solution to my problem. i am stress testing it now but i think it will hold up admirably
    import java.util.Scanner;
    public class Scan
    // scan in a double without a prompt. catch and handle any exceptions
    public static double nextDouble ()
        return nextDouble("");
    // give the user a prompt and then scan in a double. catch and handle any exceptions
    public static double nextDouble (String prompt)
        // variable to hold the result
        double result = 0.0;
        // variable to determine if input was ok
        boolean inputOK = false;
        // do-while loop to get some input
        do
          // print the prompt. what do you want to ask for?
          System.out.print ( prompt );
          // Try to scan and capture the input and catch the exception
          try
          // Call private method to do the actual scanning
            result = scanDouble();
            // if we reach this step then good. we got good input let's exit the loop
            inputOK = true;
          // oops we got an error!
          catch (java.util.InputMismatchException e)
            // inform the user of the error
            System.out.println ("That is not a number! Try again. \n");
            // input was not ok so we can't exit the loop yet
            inputOK = false;
        // keep looping as long as inputOK is false
        } while (!inputOK);
        // return out result
        return result;
    // Helper method to nextDouble
      private static double scanDouble()
      // hold the result
        double result=0.0;
      // create the scanner object
        Scanner scan = new Scanner (System.in);
      // parse the input
          // If input was not of proper type this call will fail with :
          // java.util.InputMismatchException
          // and return control to calling method
        result = scan.nextDouble();
      // Return our findings
        return result  ;
    }

  • Errormessage: "java.util.NoSuchElementException"

    Why can't I compile the following code?
    Im using MAC OSX 10.4.10 with the latest J2SE 5.0 Preferences
    import java.util.Scanner;
         class gumballs {
              public static void main(String args[]) {
                   Scanner myScanner = new Scanner(System.in);
                   int gumballs;
                   int kids;
                   int gumballsPerKid;
                   System.out.print("How many gumballs? How many kids? ");
                   gumballs = myScanner.nextInt();     
                   kids = myScanner.nextInt();
                   gumballsPerKid = gumballs / kids;
                   System.out.print("Each kid gets ");
                   System.out.print(gumballsPerKid);
                   System.out.println(" gumballs.");
    } I get the following error when I try to compile the code
    Exception in thread "main" java.util.NoSuchElementException
         at java.util.Scanner.throwFor(Scanner.java:817)
         at java.util.Scanner.next(Scanner.java:1431)
         at java.util.Scanner.nextInt(Scanner.java:2040)
         at java.util.Scanner.nextInt(Scanner.java:2000)
         at gumballs.main(gumballs.java:14)
    How many gumballs? How many kids?
    Program exited with status 1.Please help me! im just a newbie trying to learn java..
    Thanks

    Im on XP and getting the same error message :(
    It compiles fine but when I run it and I am done inputing it gives me that same error message.
    And yes I am running the latest version of JDK
    Also I am having a strange probleming trying to run my files in the command prompt. I can get it to compile fine javac helloworldapp.java and it creates the class. I know my Universal variables are set correctly but when I try java helloworldapp after I have compiled I get a similar error message. I dont know if this is at all related I just started using Java last night so I am a total newb. I would appreciate if one of you pro's could help me out.
    thank you

  • Please help - Java.util Error! Have no clue! - Please Help

    Hey guys,
    Im very new to java,
    With my code here :
    import.java.util.Scanner;
       public class delta{
       public static void main(String args[]){
            Scanner done = new Scanner(System.in.());
            System.out.println(done.nextLine);
    }I am unable to compile due to a Java.utill error!, can someone please tell me where i am going wrong? or provide me with a guide on how to setup netbeans because i think that is where i am going wrong !
    -thanks!

    815788 wrote:
    its
    package <error>.java.util does not exist.it also doesn't let me compile because of this.And, to fill in the information you didn't yet post, this referred to your "import" line, right? Please don't hoard information. Tell us what the problem is.
    As to the fix, look at your "import" statement and compare it to "import" statements in your textbook or tutorial or notes or whatever you're learning from.

  • Java.util.inputmismatchException

    Exception in thread "main" java.util.InputMismatchException
    at java.util.Scanner.throwFor(Scanner.java:840)
    at java.util.Scanner.next(Scanner.java:1461)
    at java.util.Scanner.nextInt(Scanner.java:2091)
    at java.util.Scanner.nextInt(Scanner.java:2050)
    at Trials.GradeBook.inputGrades(GradeBook.java:48)
    at Trials.GradeBookTest.main(GradeBookTest.java:18)
    could you plz xplain y i get this error message during building process

    import java.util.Scanner;
    public class GradeBook {
        private String courseName;
        private int total;
        private int gradeCounter;
        private int aGrade;
        private int bGrade;
        private int cGrade;
        private int dGrade;
        private int fGrade;
        // constructor of the class GradeBook
        public GradeBook(String name1) {
            courseName=name1;
        // initialize the value of the field courseName
        public void setCourseName(String name){
            courseName=name;
        // get the value of the field and return it to method caller
        public String getCourseName(){
            return courseName;
        // input the grades from user useing sentinel control loop
        public void inputGrades(){
            int grade;
            Scanner input = new Scanner(System.in);
            System.out.printf("%s\n%s\n%s\n",
                    "Enter the integer grades between 0-100:",
                    "Type end-of-file key to terminate the input",
                    "(i.e <Ctrl>z then press Enter on Windows)");
            while(input.hasNext()){
                grade = input.nextInt();
                total += grade;
                ++gradeCounter;
                // call a method to increment appropriate grade counter
                incrementGradeCounter(grade);
        // mehtod incrementGradeCoutner counts using switch-case loop
        public void incrementGradeCounter(int grade){
            switch(grade/10){
                case 10:
                case 9:
                    ++aGrade;
                    break;
                case 8:
                    ++bGrade;
                    break;
                case 7:
                    ++cGrade;
                    break;
                case 6:
                    ++dGrade;
                    break;
                default:
                    ++fGrade;
                    break;
        // create a method that displays welcome message to grade book user
        public void displayMessage(){
            System.out.printf("\nWelcome to the Grade Book for %s\n",
                    getCourseName());
        public void displayReport(){
            if ( gradeCounter != 0 ){
                System.out.printf("The total of %d grade entered is %d\n",
                        gradeCounter,total);
                System.out.printf("The class average is %.2f",
                        (double)total/gradeCounter);
                System.out.printf("%s\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n",
                        "Number of students who recieved each grade",
                        "A: ",aGrade,
                        "B: ",bGrade,
                        "C: ",cGrade,
                        "D: ",dGrade,
                        "F: ",fGrade);
            else
                System.out.println("Sorry! no grade was entered\n" +
                        "THANK YOU FOR USING THE GRADE BOOK");
    public static void main(String args[]) {
            // create an object of Class GradeBook with its own contructor
            GradeBook myGradeBook = new GradeBook("CS101 Java Programming");
            myGradeBook.displayMessage();
            myGradeBook.inputGrades();
            myGradeBook.displayReport();
        }}

  • Doubt on util.Scanner.java

    Hello Everybody,
    I have a doubt about util.Scanner.java. I searched in java API, but there is no such class definition found. BUt, i saw in a program, importing
    this util.Scanner.java to accept commond line arguments. egample:
    import util.java.Scanner;
    public class Accept{
    public void getNumbers()
    Scanner input=new Scanner(System.in)
    ... ... ... ... I don't understand how does this code work s?? Can anyone please explain me??
    Thanks for taking time.
    Regards,
    Ashvini

    It's not included until 5.0. It might theoretically be possible to extract that class from rt.jar and put it into your classpath, but I doubt it would be that simple, if it would even work at all. It probably relies on other 5.0 classes, and may rely on 5.0-only features. Even if it doesn't, the class itself may be marked as 5.0, which would cause them to be rejected by a < 5.0 VM.
    It shouldn't be too difficult to write the most commonly used methods yourself, or maybe you could find something similar at sourceforge or jakarta or someplace.

  • Java.util.zip.ZipException: invalid entry CRC at 11g installation

    Hi,
    yesterday I experienced a very strange Oracle OUI behaviour helping one of my friends to install 32-bit 11g development system on 32-bit OEL-5.2. It literally made and still makes me mad as I never saw the installation error like that before. The OEL-5.2 installation and settings are identical to mine, all required packages installed. The 11g installation starts normally (software only installation), all OUI Prerequisite checks passes, but at about 30% of installation (extracting phase) it hangs unexpectedly - no CPU activity anymore - it's just hanging forever without any OUI message staying at 30% of installation. But the errorlog `/opt/oracle/oraInventory/logs/oraInstall2008-11-21_22-55-12AM.err' shows:
    java.util.zip.ZipException: invalid entry CRC (expected 0x482e3871 but got 0x1d296a66)
            at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:378)
            at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
            at java.io.FilterInputStream.read(FilterInputStream.java:90)
            at oracle.sysman.oii.oiix.OiixFileOps.copyStream(OiixFileOps.java:1470)
            at oracle.sysman.oii.oiij.OiijFastJarExtracter.copyFileFromJar(OiijFastJarExtracter.java:307)
            at oracle.sysman.oii.oiij.OiijFastJarExtracter.copyJarContents(OiijFastJarExtracter.java:227)
            at oracle.sysman.oii.oiij.OiijFastJarExtracter.extract(OiijFastJarExtracter.java:146)
            at oracle.sysman.oii.oiij.OiijJarExtractQueue$OiijJarExtractWorker.run(OiijJarExtractQueue.java:341)Since that smelled like installation media file corruption, I checked cksum of the `linux_11gR1_database_1013.zip' and it was identical to the original on the OTN site, also "unzip -t <file.zip>" passed - no errors. Retrying installation (after deleting $ORACLE_HOME), doesn't help. It always hangs, but not at the same point in time. Sometimes it hangs at 5% of installation, sometimes at 20%, or 40%, but always during extracting phase, without OUI message, with similar errorlog.
    Today I've tried it once again in order to figure out what's happening. It seemed I would have more luck today. The extracting and even linking phases succeeded, but, when it came to about 80% of installation (configuration pending), the installation suddenly aborted, OUI window disappeared from the screen, with error message visible only on console:
    # An unexpected error has been detected by HotSpot Virtual Machine:
    #  SIGSEGV (0xb) at pc=0xb78d9725, pid=5690, tid=2767309712
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
    # Problematic frame:
    # V  [libjvm.so+0x26c725]Segmentation fault occured. No errorlog in /opt/oracle/oraInventoru/logs/, but java core file of 92 MB and java errorlog `hs_err_pid5690.log', showing stack traces, were generated in system's /tmp directory. The errorlog shows:
    ---------------  T H R E A D  ---------------
    Current thread (0x08a03c58):  VMThread [id=5691]
    siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000008
    Registers:
    EAX=0x00000000, EBX=0xb79f816c, ECX=0x000001fa, EDX=0x00000008
    ESP=0xa4f1bbd8, EBP=0xa4f1bbe8, ESI=0xafde61c8, EDI=0xafde502c
    EIP=0xb78d9725, CR2=0x00000008, EFLAGS=0x00210282
    Top of Stack: (sp=0xa4f1bbd8)
    0xa4f1bbd8:   000001fa 000001fa b79f816c afde4f98
    0xa4f1bbe8:   a4f1bc18 b78ed5ce afde4f98 a4f1bf40
    0xa4f1bbf8:   00000001 b78ed581 ae758a48 afde7764
    0xa4f1bc08:   ae6051a4 b79f816c b79eb000 b7a06148
    0xa4f1bc18:   a4f1bc38 b78d9871 ae5f1138 afde4f78
    0xa4f1bc28:   089b7d10 089b7d10 b79f816c b79efc44
    0xa4f1bc38:   a4f1bc58 b78d9b7c b79efc44 a4f1bca0
    0xa4f1bc48:   a4f1bc68 b796b16c a4f1bca0 b79f816c
    Instructions: (pc=0xb78d9725)
    0xb78d9715:   01 00 00 00 85 c9 75 1a 8b 46 04 51 51 8d 50 08
    0xb78d9725:   8b 40 08 56 52 ff 50 5c 83 c4 10 8d 65 f8 5b 5e
    Stack: [0xa4e9c000,0xa4f1d000),  sp=0xa4f1bbd8,  free space=510k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V  [libjvm.so+0x26c725]
    V  [libjvm.so+0x2805ce]
    V  [libjvm.so+0x26c871]
    V  [libjvm.so+0x26cb7c]
    Signal Handlers:
    SIGSEGV: [libjvm.so+0x32a000], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGBUS: [libjvm.so+0x32a000], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGFPE: [libjvm.so+0x28e010], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGPIPE: [libjvm.so+0x28e010], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGILL: [libjvm.so+0x28e010], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: [libjvm.so+0x290460], sa_mask[0]=0x00000000, sa_flags=0x10000004
    SIGHUP: [libjvm.so+0x28fe90], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGINT: [libjvm.so+0x28fe90], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGQUIT: [libjvm.so+0x28fe90], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    SIGTERM: [libjvm.so+0x28fe90], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
    vm_info: Java HotSpot(TM) Client VM (1.5.0_11-b03) for linux-x86, built on Dec 15 2006 02:25:41 by java_re with gcc 3.2.1-7a (J2SE release)These are only selected parts of the errorlog as it is too long to be presented in the whole.
    What specially confuses me here is the fact that this OEL-5.2 installation is identical to mine, with same kernel, same kernel params, shared memory settings, etc. Also, this is obviously a java issue, but it is jdk1.5.0_11-b03 shipped with Oracle 11g. I've never had a problem with it.
    Anyone has a clue what the heck is this and what causes those errors during Oracle 11g installation?
    Thanks.
    NJ

    The cause of errors was a dying Westen Digital drive, specially the 48G partition reserved only for $ORACLE_BASE (/dev/sdb3 mounted on /opt/oracle).
    A simple quick scan of unmounted partition (badblocks -v /dev/sdb3) reported more than thousand new bad blocks (compared to the last scan six months ago). Although I strongly believe, specially in the case of WDC drives, that the best utility to "repair" bad blocks is the one that opens a window and prints the message: "Go to the nearest shop and buy a new drive", I was very curious to prove my suspicion just on this drive. After zero-filling the partition with dd, then formatting it (mke2fs -cc) and mounting again, the 11g installation and database creation (on the same partition) successfully completed, performing fast and smoothly. To make sure it was not a casual event, I repeated the installation once again with full success. The database itself is working fine (by now). Well, the whole procedure took me more than four hours, but I'm pretty satisfied. I learned once again - stay away from Western Digital. As Oracle cannot rely on dying drive, my friend is going tomorrow to spend a 150+ euro on two 250G Seagate Barracudas and replace both WDC drives, even though the first drive seems to be healthy.
    In general there is no difference between loading correct data from good disk into bad memory and loading the incorrect data from dying disk into good memory. In both cases the pattern is damaged. For everyone who runs into the problem similar to this, and the cause cannot be easily determined, the rule of thumb must be:
    1. test memory and, if it shows any error, check sockets and test memory modules individually
    2. check disks for bad blocks regardless of the result of memory testing
    Therefore I consider your answer being generally correct.
    Regards
    NJ

  • Error-java.util.ResourceBundle.throwMissingResourceException

    hi all,
    im implementing a report for reporting empty filder..
    i got an error while running the report in portal.
    i got this error..
    unexpected error accessing report com.sap.km.reporting.SimpleReport@641ffc: java.util.MissingResourceException: Can't find bundle for base name com.sap.km.reporting.SimpleReport, locale en_IE
                at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:839)
                at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:729)
                at java.util.ResourceBundle.getBundle(ResourceBundle.java:579)
                at com.sap.km.reporting.SimpleReport.getDisplayName(SimpleReport.java:68)
                at com.sapportals.wcm.repository.manager.reporting.monitor.ReportComponent$ReportWrapper.getDisplayName(ReportComponent.java:294)
                at com.sapportals.wcm.repository.manager.reporting.types.RPReportHandler$DisplayNameGen.getProperty(RPReportHandler.java:160)
                at com.sapportals.wcm.repository.manager.reporting.types.RPPropHandler.getProperties(RPPropHandler.java:110)
                at com.sapportals.wcm.repository.manager.reporting.types.RPPropHandler.getProperties(RPPropHandler.java:143)
                at com.sapportals.wcm.repository.manager.reporting.RPPropertyManager.getProperties(RPPropertyManager.java:89)
                at com.sapportals.wcm.repository.ResourceImpl.internalGetProperties(ResourceImpl.java:3699)
                at com.sapportals.wcm.repository.ResourceImpl.internalGetPropertiesExtended(ResourceImpl.java:1343)
                at com.sapportals.wcm.repository.ResourceImpl.getProperties(ResourceImpl.java:1308)
                at com.sapportals.wcm.repository.CollectionImpl.getChildren(CollectionImpl.java:383)
                at com.sapportals.wcm.service.resourcelistfilter.cm.ResourceListFilter.getChildren(ResourceListFilter.java:425)
                at com.sapportals.wcm.rendering.collection.cm.InternalTree.getChildren(InternalTree.java:1868)
                at com.sapportals.wcm.rendering.collection.cm.InternalTree.getFirstCallOpenResources(InternalTree.java:1142)
                at com.sapportals.wcm.rendering.collection.cm.InternalTree.getFirstCallOpenResources(InternalTree.java:1172)
                at com.sapportals.wcm.rendering.collection.cm.InternalTree.buildNewTree(InternalTree.java:704)
                at com.sapportals.wcm.rendering.collection.cm.InternalTree.renderTree(InternalTree.java:852)
                at com.sapportals.wcm.rendering.collection.cm.InternalTree.render(InternalTree.java:546)
                at com.sapportals.wcm.rendering.collection.cm.InternalTree.buildContent(InternalTree.java:2295)
                at com.sapportals.wcm.control.util.components.base.BaseCompositeComponent.buildComposition(BaseCompositeComponent.java:196)
                at com.sapportals.htmlb.AbstractCompositeComponent.preRender(AbstractCompositeComponent.java:33)
                at com.sapportals.htmlb.Container.preRender(Container.java:118)
                at com.sapportals.htmlb.Container.preRender(Container.java:118)
                at com.sapportals.htmlb.Container.preRender(Container.java:118)
                at com.sapportals.htmlb.Container.preRender(Container.java:118)
                at com.sapportals.htmlb.AbstractCompositeComponent.preRender(AbstractCompositeComponent.java:34)
                at com.sapportals.htmlb.Container.preRender(Container.java:118)
                at com.sapportals.htmlb.Container.preRender(Container.java:118)
                at com.sapportals.htmlb.Container.preRender(Container.java:118)
                at com.sapportals.portal.htmlb.PrtContext.render(PrtContext.java:413)
                at com.sapportals.htmlb.page.DynPage.doOutput(DynPage.java:237)
                at com.sapportals.wcm.portal.component.base.KMControllerDynPage.doOutput(KMControllerDynPage.java:130)
                at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:129)
                at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
                at com.sapportals.wcm.portal.component.base.ControllerComponent.doContent(ControllerComponent.java:73)
                at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
                at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
                at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
                at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
                at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
                at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
                at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
                at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
                at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
                at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
                at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
                at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
                at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
                at java.security.AccessController.doPrivileged(Native Method)
                at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
                at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
                at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
                at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
                at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
                at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
                at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
                at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
                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:95)
                at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)
    could anyone provide me a solution for this..
    Regards,
    Vinoth

    See Error -Can't find bundle ,locale en_US

  • Java.util.zip.ZipException error in opening zip file

    Hello all,
    We are using Sun Java System web server 6.1 SP2. When I tried to deploy an application, I received this message: "Posted content length of --- exceeds limit of --- " the -dashes are the size of the file actually.
    I then added an init-param to the web.xml specifying the maximum size.
    After doing that, I tried to deploy the war file using administration interface, but received a network tcp/ip error. I then deployed it using command line wdeploy command. It worked but the web server won't start up after the deployment. The following error messages are found in the log file. Any thoughts as to whats wrong here? Is there a bug in SP2?
    [22/Sep/2006:17:30:44] finer ( 5668): ContextConfig[search]: URI='/search', ResourcePath='/WEB-INF/sun-web-search.tld' [22/Sep/2006:17:30:44] finer ( 5668): ContextConfig[search]:
    tldConfigJar(/WEB-INF/sun-web-search.tld): java.util.zip.ZipException: error in opening zip file
    [22/Sep/2006:17:30:44] finer ( 5668): ContextConfig[search]: URI='/jstl-fmt', ResourcePath='/WEB-INF/fmt.tld' [22/Sep/2006:17:30:44] finer ( 5668): ContextConfig[search]: tldConfigJar(/WEB-INF/fmt.tld): java.util.zip.ZipException: error in opening zip file
    [22/Sep/2006:17:30:48] failure ( 5668): CORE4007: Internal error: Unexpected Java exception thrown (java.lang.NoClassDefFoundError: org/xml/sax/ext/Attributes2, org/xml/sax/ext/Attributes2), stack: java.lang.NoClassDefFoundError: org/xml/sax/ext/Attributes2 at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:537) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1717) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:983) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1431) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1301) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at org.apache.xerces.parsers.AbstractSAXParser.<init>(Unknown Source) at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source) at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source) at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source) at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:274) at org.apache.catalina.startup.ContextConfig.defaultConfig(ContextConfig.java:882) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1004) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:257) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3752) at com.iplanet.ias.web.WebModule.start(WebModule.java:257) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardHost.start(StandardHost.java:652) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355) at org.apache.catalina.startup.Embedded.start(Embedded.java:995) at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431) at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500) at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161) [22/Sep/2006:17:30:48] failure ( 5668): CORE3186: Failed to set configuration

    ooks like you are running into bug: 4719677
    When you deploy a web application using the Administration Server from a
    remote machine, the maximum upload size by default is 10 MB. This can be
    changed by editing the
    install-root/bin/https/webapps/instance-app/WEB-INF/web.xml file. In the
    servlet webappdeploy, insert an init param named maxUploadSize with a
    value in bytes specifying the maximum upload size. Example:
    <init-param>
    <param-name>maxUploadSize</param-name>
    <param-value>90000000</param-value>
    </init-param>

Maybe you are looking for

  • Navigating to a website, from a previous one

    Sorry if this question is a bit confusing.... Eitherway, what I'm basically trying to do is send javascript function by using GET to send it through the URL. The problem that I seem to have run into is that the website I need to send the javascript f

  • Define variable in package access from trigger

    i want to accessing a variable that is defined in the package from trigger..how i must define this variable in the package ?

  • Problem with apex_web_service.make_request after Upgrade to 4.1.1.00.23

    Hi, i upgraded the APEX environment from 4.1 to 4.1.1.00.23 via p13331096_112020_Generic.zip. And now i get the error 'ORA-06503: PL/SQL: Function returned without value' when calling the function apex_web_service.make_request. I made no changes to t

  • I want to change the name of my bluetooth device in iOS.

    Attended a meeting yesterday.  Several others in the room had the same Logitech Ultrathin BT keyboard.  So, the connect list was a mile long.  Each attempt to connect failed as others were connecting to each others keyboards......no way to tell who's

  • Mass Storage Error Message

    I have an 8gb msd card in the 8320, mass storage is ON, but when I access the phone through the Roxio media manager, it hgives the message "Please Activate the Mass Stoge Mode on your Device". Have tried it on and off, nothing. I can see the phones m