Class DeploymentException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.osgi.service.deploymentadmin.DeploymentException
-
- All Implemented Interfaces:
java.io.Serializable
public class DeploymentException extends java.lang.ExceptionChecked exception received when something fails during any deployment processes. ADeploymentExceptionalways contains an error code (one of the constants specified in this class), and may optionally contain the textual description of the error condition and a nested cause exception.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intCODE_BAD_HEADERSyntax error in any manifest header.static intCODE_BUNDLE_NAME_ERRORBundle symbolic name is not the same as defined by the deployment package manifest.static intCODE_BUNDLE_SHARING_VIOLATIONBundle with the same symbolic name already exists.static intCODE_CANCELLEDDeploymentAdmin.installDeploymentPackage(InputStream),DeploymentPackage.uninstall()andDeploymentPackage.uninstallForced()methods can throwDeploymentExceptionwith this error code if theDeploymentAdmin.cancel()method is called from another thread.static intCODE_COMMIT_ERRORException with this error code is thrown when one of the Resource Processors involved in the deployment session threw aResourceProcessorExceptionwith theCODE_PREPAREerror code.static intCODE_FOREIGN_CUSTOMIZERMatched resource processor service is a customizer from another deployment package.static intCODE_MISSING_BUNDLEA bundle in the deployment package is marked as DeploymentPackage-Missing but there is no such bundle in the target deployment package.static intCODE_MISSING_FIXPACK_TARGETFix pack version range doesn't fit to the version of the target deployment package or the target deployment package of the fix pack doesn't exist.static intCODE_MISSING_HEADERMissing mandatory manifest header.static intCODE_MISSING_RESOURCEA resource in the source deployment package is marked as DeploymentPackage-Missing but there is no such resource in the target deployment package.static intCODE_NOT_A_JARDeploymentAdmin.installDeploymentPackage(InputStream)methods can throwDeploymentExceptionwith this error code if the got InputStream is not a jar.static intCODE_ORDER_ERROROrder of files in the deployment package is bad.static intCODE_OTHER_ERROROther error condition.static intCODE_PROCESSOR_NOT_FOUNDThe Resource Processor service with the given PID (seeResource-Processormanifest header) is not found.static intCODE_RESOURCE_SHARING_VIOLATIONAn artifact of any resource already exists.static intCODE_SIGNING_ERRORBad deployment package signing.static intCODE_TIMEOUTWhen a client requests a new session with an install or uninstall operation, it must block that call until the earlier session is completed.
-
Constructor Summary
Constructors Constructor Description DeploymentException(int code)Create an instance of the exception.DeploymentException(int code, java.lang.String message)Create an instance of the exception.DeploymentException(int code, java.lang.String message, java.lang.Throwable cause)Create an instance of the exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ThrowablegetCause()Returns the cause of this exception ornullif no cause was set.intgetCode()java.lang.ThrowableinitCause(java.lang.Throwable cause)Initializes the cause of this exception to the specified value.
-
-
-
Field Detail
-
CODE_CANCELLED
public static final int CODE_CANCELLED
DeploymentAdmin.installDeploymentPackage(InputStream),DeploymentPackage.uninstall()andDeploymentPackage.uninstallForced()methods can throwDeploymentExceptionwith this error code if theDeploymentAdmin.cancel()method is called from another thread.- See Also:
- Constant Field Values
-
CODE_NOT_A_JAR
public static final int CODE_NOT_A_JAR
DeploymentAdmin.installDeploymentPackage(InputStream)methods can throwDeploymentExceptionwith this error code if the got InputStream is not a jar.- See Also:
- Constant Field Values
-
CODE_ORDER_ERROR
public static final int CODE_ORDER_ERROR
Order of files in the deployment package is bad. The right order is the following:- META-INF/MANIFEST.MF
- META-INF/*.SF, META-INF/*.DSA, META-INF/*.RS
- Localization files
- Bundles
- Resources
DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_MISSING_HEADER
public static final int CODE_MISSING_HEADER
Missing mandatory manifest header.DeploymentAdmin.installDeploymentPackage(InputStream)can throw exception with this error code.- See Also:
- Constant Field Values
-
CODE_BAD_HEADER
public static final int CODE_BAD_HEADER
Syntax error in any manifest header.DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_MISSING_FIXPACK_TARGET
public static final int CODE_MISSING_FIXPACK_TARGET
Fix pack version range doesn't fit to the version of the target deployment package or the target deployment package of the fix pack doesn't exist.DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_MISSING_BUNDLE
public static final int CODE_MISSING_BUNDLE
A bundle in the deployment package is marked as DeploymentPackage-Missing but there is no such bundle in the target deployment package.DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_MISSING_RESOURCE
public static final int CODE_MISSING_RESOURCE
A resource in the source deployment package is marked as DeploymentPackage-Missing but there is no such resource in the target deployment package.DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_SIGNING_ERROR
public static final int CODE_SIGNING_ERROR
Bad deployment package signing.DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_BUNDLE_NAME_ERROR
public static final int CODE_BUNDLE_NAME_ERROR
Bundle symbolic name is not the same as defined by the deployment package manifest.DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_FOREIGN_CUSTOMIZER
public static final int CODE_FOREIGN_CUSTOMIZER
Matched resource processor service is a customizer from another deployment package.DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_BUNDLE_SHARING_VIOLATION
public static final int CODE_BUNDLE_SHARING_VIOLATION
Bundle with the same symbolic name already exists.DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_RESOURCE_SHARING_VIOLATION
public static final int CODE_RESOURCE_SHARING_VIOLATION
An artifact of any resource already exists.This exception is thrown when the called resource processor throws a
ResourceProcessorExceptionwith theCODE_RESOURCE_SHARING_VIOLATIONerror code.DeploymentAdmin.installDeploymentPackage(InputStream)throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_COMMIT_ERROR
public static final int CODE_COMMIT_ERROR
Exception with this error code is thrown when one of the Resource Processors involved in the deployment session threw aResourceProcessorExceptionwith theCODE_PREPAREerror code.DeploymentAdmin.installDeploymentPackage(InputStream)andDeploymentPackage.uninstall()methods throw exception with this error code.- See Also:
- Constant Field Values
-
CODE_OTHER_ERROR
public static final int CODE_OTHER_ERROR
Other error condition.All Deployment Admin methods which throw
DeploymentExceptioncan throw an exception with this error code if the error condition cannot be categorized.- See Also:
- Constant Field Values
-
CODE_PROCESSOR_NOT_FOUND
public static final int CODE_PROCESSOR_NOT_FOUND
The Resource Processor service with the given PID (seeResource-Processormanifest header) is not found.DeploymentAdmin.installDeploymentPackage(InputStream),DeploymentPackage.uninstall()andDeploymentPackage.uninstallForced()throws exception with this error code.- See Also:
- Constant Field Values
-
CODE_TIMEOUT
public static final int CODE_TIMEOUT
When a client requests a new session with an install or uninstall operation, it must block that call until the earlier session is completed. The Deployment Admin service must throw a Deployment Exception with this error code when the session can not be created after an appropriate time out period.DeploymentAdmin.installDeploymentPackage(InputStream),DeploymentPackage.uninstall()andDeploymentPackage.uninstallForced()throws exception with this error code.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DeploymentException
public DeploymentException(int code, java.lang.String message, java.lang.Throwable cause)Create an instance of the exception.- Parameters:
code- The error code of the failure. Code should be one of the predefined integer values (CODE_X).message- Message associated with the exceptioncause- the originating exception
-
DeploymentException
public DeploymentException(int code, java.lang.String message)Create an instance of the exception. Cause exception is implicitly set to null.- Parameters:
code- The error code of the failure. Code should be one of the predefined integer values (CODE_X).message- Message associated with the exception
-
DeploymentException
public DeploymentException(int code)
Create an instance of the exception. Cause exception and message are implicitly set to null.- Parameters:
code- The error code of the failure. Code should be one of the predefined integer values (CODE_X).
-
-
Method Detail
-
getCause
public java.lang.Throwable getCause()
Returns the cause of this exception ornullif no cause was set.- Overrides:
getCausein classjava.lang.Throwable- Returns:
- The cause of this exception or
nullif no cause was set.
-
initCause
public java.lang.Throwable initCause(java.lang.Throwable cause)
Initializes the cause of this exception to the specified value.- Overrides:
initCausein classjava.lang.Throwable- Parameters:
cause- The cause of this exception.- Returns:
- This exception.
- Throws:
java.lang.IllegalArgumentException- If the specified cause is this exception.java.lang.IllegalStateException- If the cause of this exception has already been set.- Since:
- 1.1
-
getCode
public int getCode()
- Returns:
- Returns the code.
-
-