Package javax.enterprise.context
Class ContextNotActiveException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- javax.enterprise.context.ContextException
-
- javax.enterprise.context.ContextNotActiveException
-
- All Implemented Interfaces:
java.io.Serializable
public class ContextNotActiveException extends ContextException
This Exception is thrown ifContext.get(javax.enterprise.context.spi.Contextual)
orContext.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.
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ContextNotActiveException()
ContextNotActiveException(java.lang.String message)
Creates a new exception with message.ContextNotActiveException(java.lang.String message, java.lang.Throwable cause)
Creates a new exception with the given message and throwable cause.ContextNotActiveException(java.lang.Throwable cause)
Create a new exception with the root cause.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ContextNotActiveException
public ContextNotActiveException()
-
ContextNotActiveException
public ContextNotActiveException(java.lang.String message)
Creates a new exception with message.- Parameters:
message
- message
-
ContextNotActiveException
public ContextNotActiveException(java.lang.Throwable cause)
Create a new exception with the root cause.- Parameters:
cause
- cause of the exception
-
ContextNotActiveException
public ContextNotActiveException(java.lang.String message, java.lang.Throwable cause)
Creates a new exception with the given message and throwable cause.- Parameters:
message
- exception messagecause
- root cause of the exception
-
-