1. Explore
  2. »
  3. Java Runtime
  4. »
  5. java.util

java.util errorsJava Runtime

Top patterns

  1. JVM ran out of heap space while trying to create a copy of an existing array

    In Eclipse : go to Run --> Run Configurations --> then select the project under maven build --> then select the tab "JRE" --> then enter -Xmx1024m.

    This should increase the memory heap for all the builds/projects. The above memory size is 1 GB.

    Check the source of this solution for more info

  2. Index provided to the ArrayList method is either greater or equal to size of the list or less than 0
    No solution
  3. ArrayList.get() has thrown an IndexOutOfBoundsException
    No solution
Error patternsClassesMethodsExceptions
DescriptionException TypeEntry MethodWeb pages

JVM ran out of heap space while trying to create a copy of an existing array

java.lang.OutOfMemoryError
java.util.Arrays.copyOf
1435Web pages
1Solution
OutOfMemoryErrorArrays.copyOf()1435

Index provided to the ArrayList method is either greater or equal to size of the list or less than 0

java.lang.IndexOutOfBoundsException
java.util.ArrayList.RangeCheck
1177Web pages
IndexOutOfBoundsExceptionArrayList.RangeCheck()1177

ArrayList.get() has thrown an IndexOutOfBoundsException

java.lang.IndexOutOfBoundsException
1 frames hidden
java.util.ArrayList.get
1075Web pages
IndexOutOfBoundsExceptionArrayList.get()1075

Multiple threads trying to modify ArrayList at the same time or trying to modify ArrayList while iterating over it

java.util.ConcurrentModificationException
java.util.ArrayList$Itr.checkForComodification
1045Web pages
1Solution
ConcurrentModificationExceptionArrayList$Itr.checkForComodification()1045

Trying to modify a HashMap directly while iterating over it

java.util.ConcurrentModificationException
java.util.HashMap$HashIterator.nextEntry
964Web pages
1Solution
ConcurrentModificationExceptionHashMap$HashIterator.nextEntry()964

ArrayList$Itr.next() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
1 frames hidden
java.util.ArrayList$Itr.next
943Web pages
ConcurrentModificationExceptionArrayList$Itr.next()943

Trying to put null to a HashTable

java.lang.NullPointerException
java.util.Hashtable.put
713Web pages
1Solution
NullPointerExceptionHashtable.put()713

Vector.elementAt() has thrown an ArrayIndexOutOfBoundsException

java.lang.ArrayIndexOutOfBoundsException
java.util.Vector.elementAt
617Web pages
ArrayIndexOutOfBoundsExceptionVector.elementAt()617

ResourceBundle.getBundleImpl() has thrown a MissingResourceException

java.util.MissingResourceException
1 frames hidden
java.util.ResourceBundle.getBundleImpl
617Web pages
MissingResourceExceptionResourceBundle.getBundleImpl()617

ResourceBundle.getBundle() has thrown a MissingResourceException

java.util.MissingResourceException
2 frames hidden
java.util.ResourceBundle.getBundle
609Web pages
MissingResourceExceptionResourceBundle.getBundle()609

HashMap$KeyIterator.next() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
1 frames hidden
java.util.HashMap$KeyIterator.next
561Web pages
ConcurrentModificationExceptionHashMap$KeyIterator.next()561

AbstractList$Itr.checkForComodification() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
java.util.AbstractList$Itr.checkForComodification
560Web pages
ConcurrentModificationExceptionAbstractList$Itr.checkForComodification()560

Scanner.throwFor() has thrown an InputMismatchException

java.util.InputMismatchException
java.util.Scanner.throwFor
558Web pages
InputMismatchExceptionScanner.throwFor()558

Scanner.next() has thrown an InputMismatchException

java.util.InputMismatchException
1 frames hidden
java.util.Scanner.next
552Web pages
InputMismatchExceptionScanner.next()552

AbstractList$Itr.next() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
1 frames hidden
java.util.AbstractList$Itr.next
546Web pages
ConcurrentModificationExceptionAbstractList$Itr.next()546

Scanner.throwFor() has thrown a NoSuchElementException

java.util.NoSuchElementException
java.util.Scanner.throwFor
518Web pages
NoSuchElementExceptionScanner.throwFor()518

Scanner.next() has thrown a NoSuchElementException

java.util.NoSuchElementException
1 frames hidden
java.util.Scanner.next
517Web pages
NoSuchElementExceptionScanner.next()517

HashMap$HashIterator.nextNode() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
java.util.HashMap$HashIterator.nextNode
473Web pages
ConcurrentModificationExceptionHashMap$HashIterator.nextNode()473

ArrayList.elementData() has thrown an ArrayIndexOutOfBoundsException

java.lang.ArrayIndexOutOfBoundsException
java.util.ArrayList.elementData
398Web pages
1Solution
ArrayIndexOutOfBoundsExceptionArrayList.elementData()398

ResourceBundle.getObject() has thrown a MissingResourceException

java.util.MissingResourceException
java.util.ResourceBundle.getObject
395Web pages
MissingResourceExceptionResourceBundle.getObject()395

Arrays.copyOfRange() has thrown an OutOfMemoryError

java.lang.OutOfMemoryError
java.util.Arrays.copyOfRange
367Web pages
OutOfMemoryErrorArrays.copyOfRange()367

Scanner.nextInt() has thrown an InputMismatchException

java.util.InputMismatchException
2 frames hidden
java.util.Scanner.nextInt
361Web pages
InputMismatchExceptionScanner.nextInt()361

Scanner.nextInt() has thrown an InputMismatchException

java.util.InputMismatchException
3 frames hidden
java.util.Scanner.nextInt
358Web pages
InputMismatchExceptionScanner.nextInt()358

ArrayList.get() has thrown an ArrayIndexOutOfBoundsException

java.lang.ArrayIndexOutOfBoundsException
1 frames hidden
java.util.ArrayList.get
348Web pages
ArrayIndexOutOfBoundsExceptionArrayList.get()348

Objects.requireNonNull() has thrown a NullPointerException

java.lang.NullPointerException
java.util.Objects.requireNonNull
319Web pages
NullPointerExceptionObjects.requireNonNull()319

ResourceBundle.getString() has thrown a MissingResourceException

java.util.MissingResourceException
1 frames hidden
java.util.ResourceBundle.getString
304Web pages
MissingResourceExceptionResourceBundle.getString()304

ServiceLoader.fail() has thrown a ServiceConfigurationError

java.util.ServiceConfigurationError
java.util.ServiceLoader.fail
278Web pages
ServiceConfigurationErrorServiceLoader.fail()278

Scanner.nextLine() has thrown a NoSuchElementException

java.util.NoSuchElementException
java.util.Scanner.nextLine
271Web pages
NoSuchElementExceptionScanner.nextLine()271

Random.nextInt() has thrown an IllegalArgumentException

java.lang.IllegalArgumentException
java.util.Random.nextInt
271Web pages
IllegalArgumentExceptionRandom.nextInt()271

Properties$LineReader.readLine() has thrown a NullPointerException

java.lang.NullPointerException
java.util.Properties$LineReader.readLine
265Web pages
NullPointerExceptionProperties$LineReader.readLine()265

Trying to access element at index outside the bounds of the ArrayList

java.lang.IndexOutOfBoundsException
java.util.ArrayList.get
264Web pages
1Solution
IndexOutOfBoundsExceptionArrayList.get()264

Trying to modify a HashMap while iterating over it's entry set

java.util.ConcurrentModificationException
1 frames hidden
java.util.HashMap$KeyIterator.next
261Web pages
1Solution
ConcurrentModificationExceptionHashMap$KeyIterator.next()261

StringTokenizer.nextToken() has thrown a NoSuchElementException

java.util.NoSuchElementException
java.util.StringTokenizer.nextToken
259Web pages
NoSuchElementExceptionStringTokenizer.nextToken()259

Stack.peek() has thrown an EmptyStackException

java.util.EmptyStackException
java.util.Stack.peek
245Web pages
EmptyStackExceptionStack.peek()245

Scanner.nextInt() has thrown a NoSuchElementException

java.util.NoSuchElementException
2 frames hidden
java.util.Scanner.nextInt
237Web pages
NoSuchElementExceptionScanner.nextInt()237

Scanner.nextInt() has thrown a NoSuchElementException

java.util.NoSuchElementException
3 frames hidden
java.util.Scanner.nextInt
232Web pages
NoSuchElementExceptionScanner.nextInt()232

Properties.load0() has thrown a NullPointerException

java.lang.NullPointerException
1 frames hidden
java.util.Properties.load0
228Web pages
NullPointerExceptionProperties.load0()228

Properties.load() has thrown a NullPointerException

java.lang.NullPointerException
2 frames hidden
java.util.Properties.load
226Web pages
NullPointerExceptionProperties.load()226

HashMap$EntryIterator.next() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
1 frames hidden
java.util.HashMap$EntryIterator.next
223Web pages
ConcurrentModificationExceptionHashMap$EntryIterator.next()223

TimSort.mergeLo() has thrown an IllegalArgumentException

java.lang.IllegalArgumentException
java.util.TimSort.mergeLo
200Web pages
IllegalArgumentExceptionTimSort.mergeLo()200

HashMap$EntryIterator.next() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
2 frames hidden
java.util.HashMap$EntryIterator.next
200Web pages
ConcurrentModificationExceptionHashMap$EntryIterator.next()200

ServiceLoader.access$300() has thrown a ServiceConfigurationError

java.util.ServiceConfigurationError
1 frames hidden
java.util.ServiceLoader.access$300
200Web pages
ServiceConfigurationErrorServiceLoader.access$300()200

TimSort.mergeAt() has thrown an IllegalArgumentException

java.lang.IllegalArgumentException
1 frames hidden
java.util.TimSort.mergeAt
198Web pages
IllegalArgumentExceptionTimSort.mergeAt()198

LinkedList$ListItr.checkForComodification() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
java.util.LinkedList$ListItr.checkForComodification
197Web pages
ConcurrentModificationExceptionLinkedList$ListItr.checkForComodification()197

Calling get() method on an empty Optional object

java.util.NoSuchElementException
java.util.Optional.get
188Web pages
1Solution
NoSuchElementExceptionOptional.get()188

LinkedList$ListItr.next() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
1 frames hidden
java.util.LinkedList$ListItr.next
187Web pages
ConcurrentModificationExceptionLinkedList$ListItr.next()187

AbstractList.add() has thrown an UnsupportedOperationException

java.lang.UnsupportedOperationException
java.util.AbstractList.add
183Web pages
UnsupportedOperationExceptionAbstractList.add()183

HashMap$ValueIterator.next() has thrown a ConcurrentModificationException

java.util.ConcurrentModificationException
1 frames hidden
java.util.HashMap$ValueIterator.next
181Web pages
ConcurrentModificationExceptionHashMap$ValueIterator.next()181

Hashtable.get() has thrown a NullPointerException

java.lang.NullPointerException
java.util.Hashtable.get
176Web pages
NullPointerExceptionHashtable.get()176

Properties.setProperty() has thrown a NullPointerException

java.lang.NullPointerException
1 frames hidden
java.util.Properties.setProperty
175Web pages
NullPointerExceptionProperties.setProperty()175
Nothing to list here.
Nothing to list here.
Nothing to list here.