Tomcat configuration

Since Server 4.0 Tomcat/TomEE is used.

  • Get TomEE Plus (!) 7.0.3 from http://tomee.apache.org/download-ng.html and extract it somewhere on your machine
  • Go to Preferences ⇒ Server ⇒ Runtime Environments and Add... a new one
    • Select "Apache Tomcat v8.5" as type
    • Name the environment to "Apache TomEE 7.0"
    • Browse and select the extracted TomEE installation directory
    • Finish
  • Open the Java EE perspective and go to the Servers view
  • Create a new Server via the context menu
    • Select "Tomcat v8.5 Server" as server type
    • Assign an appropriate server name, e.g. "Apache TomEE 7.0 at localhost"
    • Select the server runtime environment created above
    • Finish

Logging configuration

Tomcat comes with a default logging configuration, but produces quite unreadable output. Therefore

  1. Copy <TomEE installation directory>/conf/logging.properties into Servers/TomEE .../logging.properties in your workspace
  2. Modify Servers/TomEE .../logging.properties and add the line below:
      java.util.logging.ConsoleHandler.level = FINE
      java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
    + java.util.logging.SimpleFormatter.format=[%1$tc] %4$s %2$s: %5$s %6$s%n
    
  3. Double click on the entry in the Servers view and Open launch configuration. Add the following two lines (adjust the path in the first line):
    -Djava.util.logging.config.file="${resource_loc:/Servers/TomEE XXX/logging.properties}"
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    -Dcatalina.logs="${resource_loc:/Servers/TomEE XXX}/logs"
    

Context configuration

The only necessary context parameter is the location of the server repository. In production this is supplied by a context.xml file in the TomEE/Tomcat configuration directory. Unfortunately this doesn't work when started from Eclipse, there the server repository is set via a system property in this case:

  • Double click on the entry in the Servers view and Open launch configuration. Add the following linee (adjust the path):
    -Dcom.knime.server.repository=...
    

EJB configuration

In order to use EJBs, a special web application has to be deployed:

  • Open the Server configuration (double-click on the server in the Servers view) and go to the Modules tab.
  • Add an external web module and select <workspace>/git/<knime-server>/com.knime.enterprise.war/src/main/tomee as the document base and /tomee as the path.

LDAP Authentication

Tomcat uses a local user database by default (in Servers/TomEE .../tomcat-users.xml). If you want to connect to our testing LDAP, make the following modifications to Servers/TomEE .../server.xml:

  • Look for the element /Server/Service/Engine/Realm
  • Replace it with
    <realm classname="org.apache.catalina.realm.CombinedRealm">
      <realm classname="org.apache.catalina.realm.UserDatabaseRealm" resourcename="UserDatabase">
      <realm classname="org.apache.catalina.realm.JNDIRealm" connectionurl="ldap://testing.knime.org:389" rolebase="ou=groups,dc=knime,dc=org" rolename="cn" rolesearch="(member={0})" userpattern="cn={0},ou=people,dc=knime,dc=org">
    </realm>
    </realm></realm>
    

Mail resource configuration

Mail resources can either be configured in the web applications context (which is difficult when used within Eclipse) or in a special TomEE configuration file. By default mail is sent to localhost. If you need a different configuration, do the following:

  • Look for the element /Server/Service/Engine/Realm
  • Replace it with
    <realm classname="org.apache.catalina.realm.CombinedRealm">
      <realm classname="org.apache.catalina.realm.UserDatabaseRealm" resourcename="UserDatabase">
      <realm classname="org.apache.catalina.realm.JNDIRealm" connectionurl="ldap://testing.knime.org:389" rolebase="ou=groups,dc=knime,dc=org" rolename="cn" rolesearch="(member={0})" userpattern="cn={0},ou=people,dc=knime,dc=org">
    </realm>
    </realm></realm>
    
  1. Create a file tomee.xml in the Servers/TomEE ... project (next to the server.xml file) with the following contents:
    <?xml version="1.0" encoding="UTF-8"?>
    <tomee>
      <resource id="mail/knime" type="javax.mail.Session">
        mail.smtp.host=localhost
        mail.smtp.port=25
        mail.transport.protocol=smtp
      </resource>
    </tomee>
    
  2. Adapt the configuration values if necessary.
LinkedInTwitterShare