use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class SchemaLocation method setWsdl.
@IbisDoc({ "the wsdl to read the xsd's from", " " })
public void setWsdl(String wsdl) throws ConfigurationException {
this.wsdl = wsdl;
WSDLReader reader = FACTORY.newWSDLReader();
reader.setFeature("javax.wsdl.verbose", false);
reader.setFeature("javax.wsdl.importDocuments", true);
ClassLoaderWSDLLocator wsdlLocator = new ClassLoaderWSDLLocator(this, wsdl);
URL url = wsdlLocator.getUrl();
if (wsdlLocator.getUrl() == null) {
throw new ConfigurationException("Could not find WSDL: " + wsdl);
}
try {
definition = reader.readWSDL(wsdlLocator);
} catch (WSDLException e) {
throw new ConfigurationException("WSDLException reading WSDL or import from url: " + url, e);
}
if (wsdlLocator.getIOException() != null) {
throw new ConfigurationException("IOException reading WSDL or import from url: " + url, wsdlLocator.getIOException());
}
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class Migrator method configure.
public synchronized void configure(String configurationName, ClassLoader classLoader, String changeLogFile) throws ConfigurationException {
if (configurationName == null)
throw new ConfigurationException("configurationName cannot be null");
AppConstants appConstants = AppConstants.getInstance(classLoader);
if (changeLogFile == null)
changeLogFile = appConstants.getString("liquibase.changeLogFile", "DatabaseChangelog.xml");
LiquibaseClassLoader cl = new LiquibaseClassLoader(classLoader);
if (cl.getResource(changeLogFile) == null) {
log.debug("unable to find database changelog file [" + changeLogFile + "] configuration [" + configurationName + "]");
} else {
String dataSource = appConstants.getString("jdbc.migrator.dataSource", "jdbc/" + appConstants.getResolvedProperty("instance.name.lc"));
setDatasourceName(dataSource);
try {
JdbcConnection connection = new JdbcConnection(getConnection());
instance = new LiquibaseImpl(ibisContext, cl, connection, configurationName, changeLogFile);
} catch (JdbcException e) {
throw new ConfigurationException("migrator error connecting to database [" + dataSource + "]", e);
} catch (ValidationFailedException e) {
throw new ConfigurationException("liquibase validation failed", e);
} catch (LiquibaseException e) {
throw new ConfigurationException("liquibase failed to initialize", e);
}
}
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class Trigger method configure.
public void configure() throws ConfigurationException {
if (eventCodes.size() == 0) {
log.warn(getLogPrefix() + "configure() trigger of Monitor [" + owner.getName() + "] should have at least one eventCode specified");
}
try {
Map adapterFilterMap = (getSourceFiltering() != SOURCE_FILTERING_NONE) ? adapterFilters : null;
getOwner().registerEventNotificationListener(this, eventCodes, adapterFilterMap, isFilterOnLowerLevelObjects(), isFilterExclusive());
} catch (MonitorException e) {
throw new ConfigurationException(e);
}
if (threshold > 0) {
if (eventDts == null) {
eventDts = new LinkedList<Date>();
}
} else {
eventDts = null;
}
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class LdapFindMemberPipe method configure.
public void configure() throws ConfigurationException {
super.configure();
if (getHost() == null) {
throw new ConfigurationException(getLogPrefix(null) + "host must be set");
}
cf = new CredentialFactory(getAuthAlias(), getUserName(), getPassword());
if (StringUtils.isNotEmpty(getNotFoundForwardName())) {
notFoundForward = findForward(getNotFoundForwardName());
}
if (StringUtils.isNotEmpty(getExceptionForwardName())) {
exceptionForward = findForward(getExceptionForwardName());
}
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class FixedResult method configure.
/**
* checks for correct configuration, and translates the fileName to
* a file, to check existence.
* If a fileName or fileNameSessionKey was specified, the contents of the file is put in the
* <code>returnString</code>, so that the <code>returnString</code>
* may always be returned.
* @throws ConfigurationException
*/
public void configure() throws ConfigurationException {
super.configure();
appConstants = AppConstants.getInstance(classLoader);
if (StringUtils.isNotEmpty(getFileName()) && !isLookupAtRuntime()) {
URL resource = null;
try {
resource = ClassUtils.getResourceURL(classLoader, getFileName());
} catch (Throwable e) {
throw new ConfigurationException(getLogPrefix(null) + "got exception searching for [" + getFileName() + "]", e);
}
if (resource == null) {
throw new ConfigurationException(getLogPrefix(null) + "cannot find resource [" + getFileName() + "]");
}
try {
returnString = Misc.resourceToString(resource, SystemUtils.LINE_SEPARATOR);
} catch (Throwable e) {
throw new ConfigurationException(getLogPrefix(null) + "got exception loading [" + getFileName() + "]", e);
}
}
if ((StringUtils.isEmpty(fileName)) && (StringUtils.isEmpty(fileNameSessionKey)) && returnString == null) {
// allow an empty returnString to be specified
throw new ConfigurationException(getLogPrefix(null) + "has neither fileName nor fileNameSessionKey nor returnString specified");
}
if (StringUtils.isNotEmpty(replaceFrom)) {
returnString = replace(returnString, replaceFrom, replaceTo);
}
}
Aggregations