Search in sources :

Example 96 with ConfigurationException

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());
    }
}
Also used : ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) WSDLException(javax.wsdl.WSDLException) WSDLReader(javax.wsdl.xml.WSDLReader) URL(java.net.URL) IbisDoc(nl.nn.adapterframework.doc.IbisDoc)

Example 97 with ConfigurationException

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);
        }
    }
}
Also used : ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) ValidationFailedException(liquibase.exception.ValidationFailedException) JdbcConnection(liquibase.database.jvm.JdbcConnection) LiquibaseException(liquibase.exception.LiquibaseException) JdbcException(nl.nn.adapterframework.jdbc.JdbcException) AppConstants(nl.nn.adapterframework.util.AppConstants)

Example 98 with ConfigurationException

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;
    }
}
Also used : ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Date(java.util.Date)

Example 99 with ConfigurationException

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());
    }
}
Also used : ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) CredentialFactory(nl.nn.adapterframework.util.CredentialFactory)

Example 100 with ConfigurationException

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);
    }
}
Also used : TransformerConfigurationException(javax.xml.transform.TransformerConfigurationException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) URL(java.net.URL)

Aggregations

ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)187 IOException (java.io.IOException)52 PipeRunException (nl.nn.adapterframework.core.PipeRunException)25 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)24 Parameter (nl.nn.adapterframework.parameters.Parameter)20 ArrayList (java.util.ArrayList)19 URL (java.net.URL)17 ParameterList (nl.nn.adapterframework.parameters.ParameterList)16 SAXException (org.xml.sax.SAXException)14 TransformerException (javax.xml.transform.TransformerException)12 Test (org.junit.Test)12 CredentialFactory (nl.nn.adapterframework.util.CredentialFactory)11 HashMap (java.util.HashMap)10 File (java.io.File)9 StringTokenizer (java.util.StringTokenizer)8 Connection (java.sql.Connection)7 Map (java.util.Map)7 ListenerException (nl.nn.adapterframework.core.ListenerException)7 ParameterException (nl.nn.adapterframework.core.ParameterException)7 JdbcException (nl.nn.adapterframework.jdbc.JdbcException)7