public static EntityManagerSetupException sessionLoadedFromSessionsXMLMustBeServerSession(String sessionName,String sessionsXML, Object session) { Object[] args = { sessionName,sessionsXML,session.getClass() }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, SESSION_LOADED_FROM_SESSIONSXML_MUST_BE_SERVER_SESSION, args)); setupException.setErrorCode(SESSION_LOADED_FROM_SESSIONSXML_MUST_BE_SERVER_SESSION); return setupException; }
public static EntityManagerSetupException methodInvocationFailed(java.lang.reflect.Method aMethod, Object anObject, Exception ex) { Object[] args = {aMethod, anObject, anObject.getClass() }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, METHOD_INVOCATION_FAILED, args),ex); setupException.setErrorCode(METHOD_INVOCATION_FAILED); return setupException; }
public static EntityManagerSetupException cannotAccessMethodOnObject(java.lang.reflect.Method aMethod, Object anObject) { Object[] args = {aMethod, anObject, anObject.getClass() }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, CANNOT_ACCESS_METHOD_ON_OBJECT, args)); setupException.setErrorCode(CANNOT_ACCESS_METHOD_ON_OBJECT); return setupException; }
public static EntityManagerSetupException missingProperty(String property) { Object[] args = { property }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, MISSING_PROPERTY, args)); setupException.setErrorCode(MISSING_PROPERTY); return setupException; }
public static EntityManagerSetupException failedToInstantiateProperty(String className, String property, Exception exception) { Object[] args = { className, property }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, FAILED_TO_INSTANTIATE_PROPERTY, args), exception); setupException.setErrorCode(FAILED_TO_INSTANTIATE_PROPERTY); return setupException; }
public static EntityManagerSetupException classNotFoundWhileProcessingAnnotations(String className, Exception exception) { Object[] args = { className }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, CLASS_NOT_FOUND_WHILE_PROCESSING_ANNOTATIONS, args), exception); setupException.setErrorCode(CLASS_NOT_FOUND_WHILE_PROCESSING_ANNOTATIONS); return setupException; }
public static EntityManagerSetupException wrongPropertyValueType(String value, String expectedType, String propertyName) { Object[] args = { value, expectedType, propertyName }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, WRONG_PROPERTY_VALUE_TYPE, args)); setupException.setErrorCode(WRONG_PROPERTY_VALUE_TYPE); return setupException; }
/** * INTERNAL: * Our OSGI persistence provider does not support a JavaEE-type deployment * @return */ public static EntityManagerSetupException createContainerEntityManagerFactoryNotSupportedInOSGi() { EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(// EntityManagerSetupException.class, CREATE_CONTAINER_EMF_NOT_SUPPORTED_IN_OSGI, new Object[] {})); setupException.setErrorCode(CREATE_CONTAINER_EMF_NOT_SUPPORTED_IN_OSGI); return setupException; }
public static EntityManagerSetupException sessionXMLValidationException(String sessionName, String xmlFileName, ValidationException exception) { Object[] args = { sessionName, xmlFileName }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, SESSIONS_XML_VALIDATION_EXCEPTION, args), exception); setupException.setErrorCode(SESSIONS_XML_VALIDATION_EXCEPTION); return setupException; }
public static EntityManagerSetupException cannotPredeploy(String persistenceUnitName, String state, Exception exception) { Object[] args = { persistenceUnitName, state }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, CANNOT_PREDEPLOY, args), exception); setupException.setErrorCode(CANNOT_PREDEPLOY); return setupException; }
public static EntityManagerSetupException attemptedRedeployWithoutClose(String sessionName) { Object[] args = { sessionName }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, ATTEMPTED_REDEPLOY_WITHOUT_CLOSE, args)); setupException.setErrorCode(ATTEMPTED_REDEPLOY_WITHOUT_CLOSE); return setupException; }
public static EntityManagerSetupException classNotFoundWhileProcessingAnnotations(String className, Exception exception) { Object[] args = { className }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, CLASS_NOT_FOUND_WHILE_PROCESSING_ANNOTATIONS, args), exception); setupException.setErrorCode(CLASS_NOT_FOUND_WHILE_PROCESSING_ANNOTATIONS); return setupException; }
public static EntityManagerSetupException deployFailed(String persistenceUnitName, RuntimeException exception) { Object[] args = { persistenceUnitName }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, DEPLOY_FAILED, args), exception); setupException.setErrorCode(DEPLOY_FAILED); return setupException; }
public static EntityManagerSetupException sessionNameNeedBeSpecified(String PUName, String sessionsXML) { Object[] args = { PUName,sessionsXML }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, ATTEMPTED_LOAD_SESSION_WITHOUT_NAME_PROVIDED, args)); setupException.setErrorCode(ATTEMPTED_LOAD_SESSION_WITHOUT_NAME_PROVIDED); return setupException; }
public static EntityManagerSetupException classNotFoundForProperty(String className, String propertyName, Exception exception) { Object[] args = { className, propertyName }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, CLASS_NOT_FOUND_FOR_PROPERTY, args), exception); setupException.setErrorCode(CLASS_NOT_FOUND_FOR_PROPERTY); return setupException; }
public static EntityManagerSetupException failedToInstantiateProperty(String className, String property, Exception exception) { Object[] args = { className, property }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, FAILED_TO_INSTANTIATE_PROPERTY, args), exception); setupException.setErrorCode(FAILED_TO_INSTANTIATE_PROPERTY); return setupException; }
public static EntityManagerSetupException cannotDeployWithoutPredeploy(String persistenceUnitName, String state, Exception exception) { Object[] args = { persistenceUnitName, state }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, CANNOT_DEPLOY_WITHOUT_PREDEPLOY, args), exception); setupException.setErrorCode(CANNOT_DEPLOY_WITHOUT_PREDEPLOY); return setupException; }
public static EntityManagerSetupException puNotExist(String puName) { Object[] args = { puName}; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, PU_NOT_EXIST, args)); setupException.setErrorCode(PU_NOT_EXIST); return setupException; }
public static EntityManagerSetupException classNotFoundForProperty(String className, String propertyName, Exception exception) { Object[] args = { className, propertyName }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, CLASS_NOT_FOUND_FOR_PROPERTY, args), exception); setupException.setErrorCode(CLASS_NOT_FOUND_FOR_PROPERTY); return setupException; }
public static EntityManagerSetupException wrongWeavingPropertyValue() { Object[] args = { }; EntityManagerSetupException setupException = new EntityManagerSetupException(ExceptionMessageGenerator.buildMessage(EntityManagerSetupException.class, WRONG_WEAVING_PROPERTY_VALUE, args)); setupException.setErrorCode(WRONG_WEAVING_PROPERTY_VALUE); return setupException; }