
org.ow2.bonita.env.EnvironmentNotFoundException Maven / Gradle / Ivy
/**
* Copyright (C) 2007 Bull S. A. S.
* Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
package org.ow2.bonita.env;
import org.ow2.bonita.util.BonitaConstants;
import org.ow2.bonita.util.BonitaRuntimeException;
import org.ow2.bonita.util.Misc;
/**
* @author Pierre Vigneras
* @date Feb 1, 2008
*/
public class EnvironmentNotFoundException extends BonitaRuntimeException {
/**
*
*/
private static final long serialVersionUID = -7051240240816246131L;
private String environmentSpecified;
public EnvironmentNotFoundException(final String environmentSpecified, final Throwable cause) {
super(getMessage(environmentSpecified), cause);
this.environmentSpecified = environmentSpecified;
}
public EnvironmentNotFoundException(final String environmentSpecified) {
super(getMessage(environmentSpecified));
this.environmentSpecified = environmentSpecified;
}
private static String getMessage(final String environmentSpecified) {
return "The environment: " + environmentSpecified
+ " cannot be found neither as a file nor as a Java resource using the following CLASSPATH:"
+ Misc.LINE_SEPARATOR + System.getProperty("java.class.path") + Misc.LINE_SEPARATOR
+ "and the following classloader: " + Misc.LINE_SEPARATOR + Thread.currentThread().getContextClassLoader()
+ Misc.LINE_SEPARATOR
+ "Environment can be specified through the property: " + BonitaConstants.ENVIRONMENT_PROPERTY
+ " Default is: " + GlobalEnvironmentFactory.DEFAULT_ENVIRONMENT;
}
public String getEnvironmentSpecified() {
return this.environmentSpecified;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy