public class ContextNotActiveException extends ContextException
Context.get(javax.enterprise.context.spi.Contextual)
or
Context.get(javax.enterprise.context.spi.Contextual, javax.enterprise.context.spi.CreationalContext)
is called on a Context which is not 'active' in respect to the current thread.
This ultimately also happens if a CDI scoped Contextual Reference (the CDI proxy for a Contextual Instance)
of a CDI bean gets accessed in situations where it's Context is not available.
An example of such a case would be calling a method on a @SessionScoped CDI bean in a situation where
we do not have an active session like e.g. during an @Asynchronous EJB method.Constructor and Description |
---|
ContextNotActiveException() |
ContextNotActiveException(String message)
Creates a new exception with message.
|
ContextNotActiveException(String message,
Throwable cause)
Creates a new exception with the given message and throwable cause.
|
ContextNotActiveException(Throwable cause)
Create a new exception with the root cause.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ContextNotActiveException()
public ContextNotActiveException(String message)
message
- messagepublic ContextNotActiveException(Throwable cause)
cause
- cause of the exceptionCopyright © 2017. All rights reserved.