Search This Blog

Showing posts with label JAVA. Show all posts
Showing posts with label JAVA. Show all posts

Java Exceptions Catalog Part 5: Reflection, JavaBeans, XML & Desktop Exceptions

Java Exceptions Catalog - Part 5: Reflection, JavaBeans, XML & Desktop Exceptions

Java Exceptions Catalog - Part 5: Reflection, XML & Desktop

Comprehensive guide to dynamic metaprogramming (java.lang.reflect & java.lang.invoke), JavaBeans introspection (java.beans), XML/SAX parsing (javax.xml), and desktop GUI faults (java.awt).

1. Reflection & Dynamic Invocation (java.lang.reflect & java.lang.invoke)

REFLECTION

java.lang.reflect.InvocationTargetException

A wrapper exception thrown by reflective method calls (`Method.invoke()`) when the underlying target method throws an unhandled exception.

Resolution
Inspect the encapsulated root exception by calling exception.getCause() or getTargetException().
REFLECTION

java.lang.reflect.UndeclaredThrowableException

Thrown by a Dynamic Proxy instance if the invocation handler's invoke method attempts to throw a checked exception not declared in the proxy interface signature.

Resolution
Declare the checked exception on the interface method or catch and wrap it in an unchecked runtime exception inside the `InvocationHandler`.
REFLECTION

java.lang.reflect.MalformedParameterizedTypeException

Thrown when a reflective method encounters a parameterized type that cannot be instantiated or instantiated incorrectly.

REFLECTION

java.lang.reflect.MalformedParametersException

Indicates that the reflective parameters metadata stored in a class file is corrupt or malformed.

METHOD HANDLE

java.lang.invoke.WrongMethodTypeException

Thrown to indicate that a MethodHandle call was made with an incompatible or mismatched method type signature.

Resolution
Ensure arguments passed match the target MethodType descriptor exactly or use MethodHandle.asType() to adapt parameters.

2. JavaBeans & Introspection (java.beans Package)

JAVABEANS

java.beans.IntrospectionException

Occurs during JavaBean analysis if an exception occurs while matching getter/setter accessor methods or analyzing property descriptors.

Resolution
Ensure target class strictly complies with standard JavaBeans Naming Conventions (`getFoo()`, `setFoo()`).

3. XML, SAX & Transformation Exceptions (javax.xml Package)

XML

org.xml.sax.SAXParseException

Encapsulates an XML parsing error or warning encountered while processing an XML document stream (e.g., unclosed tags or invalid syntax).

Resolution
Validate XML documents against an XML Schema Definition (XSD) or DTD to ensure well-formed structural syntax.
XML

org.xml.sax.SAXException

General SAX exception wrapping underlying XML parser failures.

XML

javax.xml.parsers.ParserConfigurationException

Indicates a configuration error in a DocumentBuilderFactory or SAXParserFactory instance.

XML

javax.xml.transform.TransformerException

Specifies an exceptional condition that occurred during an XSLT transformation process.

XML

javax.xml.transform.TransformerConfigurationException

Indicates a severe configuration fault while instantiating an XSLT Transformer object.

4. Desktop & GUI Exceptions (java.awt & javax.swing Packages)

DESKTOP

java.awt.HeadlessException

Thrown when code that depends on a keyboard, display, or mouse is called in an environment that does not support a display (e.g., headless Linux server/container).

Resolution
Set System property java.awt.headless=true and avoid invoking GUI components on headless cloud servers or containerized microservices.
DESKTOP

java.awt.AWTException

Signals that an Abstract Window Toolkit exception has occurred.

DESKTOP

java.awt.FontFormatException

Thrown by Font.createFont() when a font file specified contains bad or invalid font data.

DESKTOP

javax.swing.UndoableEditException

Indicates an UndoableEdit operation cannot be performed or undone.

Java Exceptions Catalog Part 4: Security, Cryptography, Database & Naming Exceptions

Java Exceptions Catalog - Part 4: Security, Cryptography, Database & Naming Exceptions

Java Exceptions Catalog - Part 4: Security, Database & Naming

Comprehensive guide to database errors (java.sql), security and cryptography exceptions (java.security & javax.crypto), and JNDI directory service faults (javax.naming).

1. Relational Database Exceptions (java.sql Package)

JAVA.SQL

java.sql.SQLException

Root exception providing information on database access errors, connection issues, or SQL query failures.

Resolution
Inspect error codes via getErrorCode() and SQL state codes via getSQLState() for driver-specific diagnosis.
JAVA.SQL

java.sql.SQLIntegrityConstraintViolationException

An SQL command violates a database constraint (e.g., duplicate primary key, unique index violation, or foreign key mismatch).

Resolution
Verify entity uniqueness before inserting, or implement upside/merge queries (`ON CONFLICT DO UPDATE`).
JAVA.SQL

java.sql.SQLTimeoutException

The query execution time exceeded the specified timeout limit set on a Statement or PreparedStatement.

Resolution
Optimize SQL query performance, create missing database table indexes, or increase statement timeout limits.
JAVA.SQL

java.sql.SQLSyntaxErrorException

The SQL string sent to the database engine contains invalid syntax or unknown table/column identifiers.

JAVA.SQL

java.sql.BatchUpdateException

An error occurred during a batch update operation (retrievable update counts via getUpdateCounts()).

JAVA.SQL

java.sql.SQLDataException

Data evaluation error during SQL execution (e.g., numeric value out of range or string truncation on insert).

JAVA.SQL

java.sql.SQLFeatureNotSupportedException

The underlying JDBC driver or database engine does not support a specific requested feature.

JAVA.SQL

java.sql.SQLNonTransientConnectionException

A persistent connection failure occurred (e.g., invalid connection credentials or closed socket) that will not succeed upon retry without fixing the root cause.

JAVA.SQL

java.sql.SQLTransientException

A temporary database operation failure (e.g., deadlock or transaction rollback) that may succeed if retried.

2. Security & Cryptography (java.security & javax.crypto Packages)

SECURITY

java.security.NoSuchAlgorithmException

A requested cryptographic algorithm (e.g., `AES`, `SHA-256`, `RSA`) is not available in the current environment or security provider.

Resolution
Check algorithm name spelling or register an external Security Provider (e.g., BouncyCastle).
SECURITY

java.security.InvalidKeyException

Invalid key specified during initialization (e.g., wrong key size, uninitialized key, or key type mismatch for algorithm).

Resolution
Verify key bit-length compatibility and format (e.g., PKCS8 or X509 encoding).
CRYPTO

javax.crypto.BadPaddingException

Decryption padding check failed. Commonly indicates an incorrect secret key was used for decryption or ciphertext was corrupted.

Resolution
Ensure identical keys, initialization vectors (IVs), and cipher padding schemes (`AES/CBC/PKCS5Padding`) are used for both encryption and decryption.
CRYPTO

javax.crypto.IllegalBlockSizeException

The length of data provided to a block cipher does not match the cipher's block size requirement.

CRYPTO

javax.crypto.NoSuchPaddingException

A requested cipher padding mechanism is not supported in the execution environment.

SECURITY

java.security.KeyStoreException

Generic exception covering underlying failures while manipulating a Java `KeyStore` instance.

SECURITY

java.security.UnrecoverableKeyException

A key cannot be recovered from a KeyStore, usually due to an incorrect key password.

SECURITY

java.security.SignatureException

Failures encountered during cryptographic digital signature generation or verification operations.

SECURITY

java.security.cert.CertificateException

Base class for errors during parsing, validation, or verification of X.509 security certificates.

SECURITY

java.security.InvalidAlgorithmParameterException

Invalid or inappropriate initialization parameters (e.g., invalid Initialization Vector size) passed to a cipher.

3. Directory & Naming Services (javax.naming Package)

JNDI

javax.naming.NamingException

Base exception class for errors thrown by JNDI context lookups and LDAP directory operations.

JNDI

javax.naming.NameNotFoundException

Indicates that the specified binding or JNDI name cannot be found in the directory context.

Resolution
Verify JNDI resource mapping names in application server deployment descriptors (`web.xml`, `context.xml`).
JNDI

javax.naming.AuthenticationException

Thrown when credential authentication fails while opening a directory service context (e.g., LDAP connection).

JNDI

javax.naming.CommunicationException

Unable to communicate with the directory server or remote JNDI provider.

JNDI

javax.naming.ServiceUnavailableException

The target naming or directory service provider is unreachable or temporarily unavailable.

JNDI

javax.naming.InvalidNameException

The specified name string violates the naming syntax of the directory service provider.

Java Exceptions Catalog Part 3: Collections, Concurrency & Data Exceptions

Java Exceptions Catalog - Part 3: Collections, Concurrency & Data Exceptions

Java Exceptions Catalog - Part 3: Collections & Concurrency

Comprehensive guide to data structure faults (java.util), multi-threaded executor and synchronization exceptions (java.util.concurrent), and mathematical rounding issues (java.math).

1. Collections & Utility Exceptions (java.util Package)

JAVA.UTIL

java.util.ConcurrentModificationException

Modifying a collection structural state (adding or removing elements) while iterating over it via a standard loop.

Resolution
Use Iterator.remove(), Collection.removeIf(), or thread-safe collection structures like CopyOnWriteArrayList or ConcurrentHashMap.
JAVA.UTIL

java.util.NoSuchElementException

Requesting the next element from an Iterator, Enumeration, or Optional.get() when no further elements exist.

Resolution
Always verify presence using iterator.hasNext() or optional.isPresent() / optional.orElseThrow().
JAVA.UTIL

java.util.MissingResourceException

ResourceBundle cannot locate a requested property key or resource bundle file.

Resolution
Verify resource file names, package locations on the classpath, and property key spelling in .properties files.
JAVA.UTIL

java.util.InputMismatchException

Thrown by Scanner when a retrieved token does not match the pattern for the expected data type.

JAVA.UTIL

java.util.EmptyStackException

Invoking pop() or peek() on an empty java.util.Stack instance.

JAVA.UTIL

java.util.UnknownFormatConversionException

An unknown conversion specifier flag is passed to String.format() or System.out.printf().

JAVA.UTIL

java.util.FormatFlagsConversionMismatchException

An incompatible format flag and conversion specifier combination is passed to a formatter.

JAVA.UTIL

java.util.IllegalFormatPrecisionException

A negative precision value (other than -1) is supplied to a string format conversion.

JAVA.UTIL

java.util.IllegalFormatWidthException

A negative width value is supplied to a string format specifier.

JAVA.UTIL

java.util.MissingFormatArgumentException

The format string specifies a parameter index or conversion flag that lacks a matching argument.

JAVA.UTIL

java.util.DuplicateFormatFlagsException

Duplicate flags are provided inside a single format specifier argument.

JAVA.UTIL

java.util.IllegalFormatCodePointException

An invalid Unicode code point is passed to a character formatting conversion.

2. Multithreading & Concurrency (java.util.concurrent Package)

CONCURRENCY

java.util.concurrent.RejectedExecutionException

An ExecutorService rejects a task submission because its bounded work queue is saturated or the pool has been shut down.

Resolution
Adjust queue size, implement custom RejectedExecutionHandler (e.g., ThreadPoolExecutor.CallerRunsPolicy), or monitor thread pool capacity.
CONCURRENCY

java.util.concurrent.ExecutionException

Wrapper exception thrown when calling Future.get() on a task that aborted due to an internal uncaught exception.

Resolution
Inspect the root cause by invoking exception.getCause() to debug the underlying task execution error.
CONCURRENCY

java.util.concurrent.CancellationException

Attempting to retrieve the result of a value-producing task (via Future.get()) that was explicitly cancelled.

Resolution
Check task completion status using future.isCancelled() prior to invoking get().
CONCURRENCY

java.util.concurrent.TimeoutException

A blocking operation (e.g., Future.get(timeout, unit) or lock acquisition) timed out before completing.

Resolution
Increase timeout threshold duration, optimize asynchronous task execution time, or handle fallback behavior.
CONCURRENCY

java.util.concurrent.BrokenBarrierException

Thrown when a thread attempts to wait upon a CyclicBarrier that has entered a broken state due to interruption or timeout.

CONCURRENCY

java.util.concurrent.CompletionException

Unchecked wrapper exception thrown when a CompletableFuture task or stage completes exceptionally.

CONCURRENCY

java.util.concurrent.locks.AbstractQueuedSynchronizer

Internal synchronizer exceptions arising from lock acquisition timeouts or corrupted state condition queues.

3. Math & Precision Exceptions (java.math Package)

JAVA.MATH

java.lang.ArithmeticException (BigDecimal division)

Occurs when a BigDecimal division operation yields an inexact non-terminating decimal expansion without a specified rounding mode (e.g., 1 / 3).

Resolution
Explicitly pass a scale and RoundingMode (e.g., bigDecimal.divide(divisor, 2, RoundingMode.HALF_UP)).

Java Exceptions Catalog Part 2: Complete Guide to I/O, Filesystem & Network Errors

Java Exceptions Catalog - Part 2: I/O, Filesystem & Network Exceptions

Java Exceptions Catalog - Part 2: I/O, Filesystem & Network

Comprehensive reference guide to standard stream exceptions (java.io), modern file channels/buffers (java.nio), and network/SSL exceptions (java.net & javax.net.ssl).

1. Stream & Serialization Exceptions (java.io Package)

JAVA.IO

java.io.IOException

Base class for exceptions produced by failed or interrupted I/O operations across streams, files, and sockets.

JAVA.IO

java.io.FileNotFoundException

Attempting to access a file at a path that does not exist or cannot be opened due to permission restrictions.

Resolution
Verify file paths (relative vs. absolute) and check file existence with Files.exists(path) before opening input streams.
JAVA.IO

java.io.EOFException

Signals that an end of file or end of stream has been reached unexpectedly during an input operation.

Resolution
Ensure stream readers handle stream length bounds properly instead of expecting fixed byte counts.
JAVA.IO

java.io.NotSerializableException

Attempting to serialize an object instance that does not implement the java.io.Serializable marker interface.

Resolution
Implement Serializable on the target class or mark un-serializable fields as transient.
JAVA.IO

java.io.InvalidClassException

Serialization runtime detects a class mismatch, missing serialVersionUID, or restricted access modifiers during deserialization.

Resolution
Explicitly declare a fixed private static final long serialVersionUID across versions.
JAVA.IO

java.io.InterruptedIOException

Signals that an I/O operation has been interrupted by another thread.

JAVA.IO

java.io.StreamCorruptedException

Control information read from an object input stream violates internal consistency checks.

JAVA.IO

java.io.OptionalDataException

Object read operation failed because primitive data was encountered instead of an object in the stream.

JAVA.IO

java.io.WriteAbortedException

Reading an object stream interrupted because one of the inner objects threw an exception during writing.

JAVA.IO

java.io.SyncFailedException

Signaled when a FileDescriptor.sync() system call fails to flush buffers to underlying physical media.

JAVA.IO

java.io.CharConversionException

An error occurred during character encoding or decoding operations.

JAVA.IO

java.io.UTFDataFormatException

A malformed modified UTF-8 string was encountered in a data input stream.

JAVA.IO

java.io.UncheckedIOException

An unchecked wrapper exception around an IOException (commonly thrown during Java Stream API pipelines).

2. Filesystem, Channels & Buffers (java.nio Package)

JAVA.NIO

java.nio.file.FileSystemException

Base class for file system operation failures in the modern NIO.2 API.

JAVA.NIO

java.nio.file.NoSuchFileException

Thrown when an NIO file system operation fails because a target file or directory path does not exist.

Resolution
Use Files.exists(path) or Files.createDirectories(path) before executing operations.
JAVA.NIO

java.nio.file.AccessDeniedException

File operation fails due to insufficient file permissions or OS access restrictions.

Resolution
Check OS level read/write permissions or adjust POSIX file permissions using Files.setPosixFilePermissions().
JAVA.NIO

java.nio.file.FileAlreadyExistsException

Attempting to create a file or directory at a path that already exists on disk.

JAVA.NIO

java.nio.file.DirectoryNotEmptyException

Attempting to delete a directory that still contains files or subdirectories.

JAVA.NIO

java.nio.file.AtomicMoveNotSupportedException

Attempting an atomic move file operation across different mounted filesystems.

JAVA.NIO

java.nio.channels.ClosedChannelException

Attempting an I/O operation on an NIO Channel that has already been closed.

Resolution
Check channel state with channel.isOpen() prior to performing read or write calls.
JAVA.NIO

java.nio.channels.AsynchronousCloseException

Operation interrupted because another thread closed the underlying channel instance.

JAVA.NIO

java.nio.channels.ClosedByInterruptException

Channel closed automatically because the thread executing the I/O call was interrupted.

JAVA.NIO

java.nio.channels.OverlappingFileLockException

Attempting to acquire a file lock that overlaps an existing lock held by the same JVM instance.

JAVA.NIO

java.nio.channels.NonReadableChannelException

Attempting to read from an NIO channel that was opened without read access permissions.

JAVA.NIO

java.nio.channels.NonWritableChannelException

Attempting to write to an NIO channel that was opened without write access permissions.

JAVA.NIO

java.nio.BufferOverflowException

Writing elements into an NIO Buffer past its defined limit capacity.

JAVA.NIO

java.nio.BufferUnderflowException

Reading elements from an NIO Buffer when fewer elements remain than requested.

JAVA.NIO

java.nio.InvalidMarkException

Attempting to call buffer.reset() without previously defining a valid mark position.

JAVA.NIO

java.nio.ReadOnlyBufferException

Invoking mutation methods (like `put()`) on a read-only NIO Buffer.

3. Networking, Sockets & SSL (java.net & javax.net.ssl Package)

JAVA.NET

java.net.SocketException

Base class for underlying TCP/UDP socket creation or protocol transmission errors.

JAVA.NET

java.net.ConnectException

Connection refused by remote host on specified address/port (service down or port closed).

Resolution
Verify target server host and port. Ensure process is running and firewall rules allow traffic.
JAVA.NET

java.net.SocketTimeoutException

A timeout occurred on socket read or connect before receiving data from remote host.

Resolution
Increase read timeout values via socket.setSoTimeout(ms) or optimize remote server latency.
JAVA.NET

java.net.UnknownHostException

The IP address of a host could not be resolved by DNS or local network lookups.

Resolution
Check hostname string for typos, verify active internet connection, and validate DNS settings.
JAVA.NET

java.net.BindException

Attempting to bind a socket to a local address/port that is already in use by another process.

JAVA.NET

java.net.NoRouteToHostException

Remote host unreachable due to intermediate router issues or local network/firewall blocks.

JAVA.NET

java.net.PortUnreachableException

An ICMP Port Unreachable message was received on a connected UDP socket.

JAVA.NET

java.net.MalformedURLException

A URL string could not be parsed because no valid protocol was specified or the string format is corrupt.

JAVA.NET

java.net.URISyntaxException

Checked exception indicating that a string could not be parsed as a URI reference.

JAVA.NET

java.net.ProtocolException

An error occurred in the underlying protocol (e.g., HTTP protocol error).

JAVA.NET

java.net.HttpRetryException

An HTTP request cannot be retried automatically due to streaming mode restrictions.

SSL

javax.net.ssl.SSLException

Base class for errors encountered during SSL/TLS negotiation or secure communication.

SSL

javax.net.ssl.SSLHandshakeException

TLS handshake failed due to untrusted certificates, expired certificates, or cipher protocol mismatch.

Resolution
Import missing CA certificates into Java truststore (`cacerts`) using `keytool` or update TLS version configuration.
SSL

javax.net.ssl.SSLPeerUnverifiedException

Indicates that the remote peer's identity has not been verified during SSL session setup.

SSL

javax.net.ssl.SSLProtocolException

Indicates an error in the operation of the SSL protocol implementation.

Java Exceptions Catalog Part 1: Complete Guide to JVM Errors & Runtime Exceptions

Java Exceptions Catalog - Part 1: java.lang Errors & Runtime Exceptions

Java Exceptions Catalog - Part 1: Core java.lang Package

Comprehensive guide to all fatal JVM errors (java.lang.Error subclasses) and unchecked runtime exceptions (java.lang.RuntimeException subclasses).

1. JVM Fatal Errors (java.lang.Error Hierarchy)

FATAL

java.lang.OutOfMemoryError

The JVM cannot allocate an object because it is out of memory and no more memory could be made available by garbage collection.

Resolution
Increase heap allocation using -Xmx, fix static collection leaks, or analyze heap dumps via Eclipse MAT / JProfiler.
FATAL

java.lang.StackOverflowError

A thread call stack has overflowed due to excessive or infinite recursion.

Resolution
Ensure proper base termination conditions in recursive methods or refactor logic into iterative loops.
FATAL

java.lang.NoClassDefFoundError

The JVM or ClassLoader instance tries to load in the definition of a class and no definition of the class could be found.

Resolution
Ensure all required dependencies are packaged into the final JAR/WAR artifact and present on the execution classpath.
FATAL

java.lang.UnsatisfiedLinkError

The JVM cannot locate an appropriate native language library file (e.g., .so, .dll, .dylib) bound via JNI.

Resolution
Verify native library paths set via -Djava.library.path system properties.
FATAL

java.lang.ExceptionInInitializerError

An unhandled exception occurred during the evaluation of a static initializer block or static variable assignment.

Resolution
Check all static { ... } blocks for potential null pointers, array overflows, or uncaught exceptions.
FATAL

java.lang.NoSuchMethodError

An application attempts to call a method that does not exist in the loaded class version at runtime (JAR version mismatch).

FATAL

java.lang.NoSuchFieldError

An application attempts to access a field variable that no longer exists in the target class definition.

FATAL

java.lang.AbstractMethodError

Invoking an abstract method that was not implemented by the loaded concrete subclass at runtime.

FATAL

java.lang.UnsupportedClassVersionError

Attempting to run a class file compiled with a newer JDK release on an older JRE runtime.

FATAL

java.lang.VerifyError

Bytecode verifier detects a class file containing corrupt or malformed bytecode instructions.

FATAL

java.lang.ClassFormatError

The JVM attempts to read a class file and determines that the file is corrupted or untruncated.

FATAL

java.lang.ClassCircularityError

A circular dependency loop is detected among classes during initialization (e.g., Class A extends B, B extends A).

FATAL

java.lang.AssertionError

An assert statement failed during execution when JVM assertions are enabled (`-ea`).

FATAL

java.lang.ThreadDeath

Thrown automatically when a thread is stopped using the deprecated Thread.stop() method.

FATAL

java.lang.InternalError

An unexpected native internal fault occurred within the underlying JVM implementation.

FATAL

java.lang.UnknownError

An unknown but serious error occurred inside the virtual machine infrastructure.

FATAL

java.lang.BootstrapMethodError

An invokedynamic instruction or bootstrap method fails to locate or execute its target method handle.

2. Unchecked Core Runtime Exceptions (java.lang.RuntimeException Hierarchy)

RUNTIME

java.lang.NullPointerException

Attempting to invoke a method, access a field, or measure length on a null reference.

Resolution
Use null guards (if (obj != null)), Optional<T> wrappers, or Objects.requireNonNull() checks.
RUNTIME

java.lang.ArrayIndexOutOfBoundsException

Accessing an array index that is negative or greater than/equal to the array size.

Resolution
Check array index logic to ensure index < array.length before accessing elements.
RUNTIME

java.lang.StringIndexOutOfBoundsException

Accessing character indices on a String object that are negative or exceed string length.

RUNTIME

java.lang.ClassCastException

Casting an object to a subclass type of which it is not an instance.

Resolution
Use Java pattern matching for instanceof checks prior to casting operations.
RUNTIME

java.lang.NumberFormatException

Attempting to convert an invalid String into a numeric primitive (e.g., Integer.parseInt("abc")).

Resolution
Sanitize strings with regex or catch NumberFormatException explicitly during string parsing.
RUNTIME

java.lang.IllegalArgumentException

Passing an illegal or inappropriate argument value to a method invocation.

RUNTIME

java.lang.IllegalStateException

Invoking a method when the application state is invalid for that operation.

RUNTIME

java.lang.ArithmeticException

An exceptional arithmetic condition occurred (e.g., integer division by zero: 10 / 0).

RUNTIME

java.lang.ArrayStoreException

Attempting to store an incompatible object type inside an array of objects (e.g., putting Integer into String[]).

RUNTIME

java.lang.NegativeArraySizeException

Attempting to instantiate an array with a negative size dimension (e.g., new int[-5]).

RUNTIME

java.lang.UnsupportedOperationException

Calling an unsupported method on an object (e.g., calling .add() on an unmodifiable list).

RUNTIME

java.lang.SecurityException

Thrown by SecurityManager when an unauthorized operation (e.g., restricted file read) is attempted.

RUNTIME

java.lang.TypeNotPresentException

Application attempts to access a type using a String name, but the definition cannot be found.

RUNTIME

java.lang.EnumConstantNotPresentException

An application attempts to access an enum constant by name, but the enum type contains no constant with that name.

RUNTIME

java.lang.IllegalMonitorStateException

Calling wait(), notify(), or notifyAll() without holding the object's monitor lock.

RUNTIME

java.lang.IllegalThreadStateException

Attempting to start a thread that has already been started or terminated.