ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shi Jinghai (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OFBIZ-9484) Enable webapp's META-INF/context.xml works
Date Mon, 10 Jul 2017 02:29:00 GMT
Shi Jinghai created OFBIZ-9484:

             Summary: Enable webapp's META-INF/context.xml works
                 Key: OFBIZ-9484
                 URL: https://issues.apache.org/jira/browse/OFBIZ-9484
             Project: OFBiz
          Issue Type: Improvement
          Components: framework
    Affects Versions: 16.11.02
            Reporter: Shi Jinghai
            Priority: Trivial

Besides the EL error, another problem when deploying Drools-Workbench in OFBiz I met is the
webapp's META-INF/context.xml not loaded.

Add the following code in framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java
and drools-wb works fine in OFBiz:

        context.addLifecycleListener(new ContextConfig());

        // adding webapp's META-INF/context.xml begin
        String contextXmlFilePath = new StringBuilder().append("file:///").append(location).append("/").append(Constants.ApplicationContextXml).toString();
        URL contextXmlUrl = null;
        try {
            contextXmlUrl = FlexibleLocation.resolveLocation(contextXmlFilePath);
            contextXmlFilePath = new StringBuilder().append(location).append("/").append(Constants.ApplicationContextXml).toString();
            File contextXmlFile = FileUtil.getFile(contextXmlFilePath);
            if(contextXmlFile.exists() && contextXmlFile.isFile()) { 
                // Debug.logInfo(contextXmlFilePath + " found and will be loaded.", module);
        } catch (MalformedURLException e) {
            // Debug.logInfo(contextXmlFilePath+ " not found.", module);
        // add webapp's META-INF/context.xml end


This message was sent by Atlassian JIRA

View raw message