Deutsch | English

How-To: Deploy ECMSDK on Tomcat

Although there are ways to run ECMSDK in a standalone JVM, when you need to use the WebDAV protocol to access documents in the ECMSDK repository you can’t avoid deploying it into at least a web container.

WebLogic Server or GlassFish Server are one choice, but even Tomcat can be used to host the ECMSDK Node that provides the ECMSDK protocol servers along with other processes.

When you need to set up a data source on Tomcat the official documentation gives an example like this:

<Resource name="jdbc/OracleDS" auth="Container"

type="javax.sql.DataSource"

driverClassName="oracle.jdbc.OracleDriver"

url="jdbc:oracle:thin:@myhost.inxire.com:1521:orcl"

username="ecmsdk" password="****" maxActive="20" maxIdle="10"

maxWait="-1"/>

Unfortunately, when using this data source definition you will see the following exception and the Node won’t come up.

java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingCallableStatement cannot be cast to oracle.jdbc.OracleCallableStatement

Whereas in other container configurations (such as in WLS and GlassFish) we can specifically disable the JDBC data type wrapping, this isn’t the case in Tomcat. In Tomcat we need to change the definition of the data source to this, to get the Node started and the defaults overwritten:

<Resource name="jdbc/OracleDS" auth="Container"

type="oracle.jdbc.pool.OracleDataSource"

factory="oracle.jdbc.pool.OracleDataSourceFactory"

connectionCachingEnabled="true"

user="ecmsdk" password="****"

driverClassName="oracle.jdbc.OracleDriver"

url="jdbc:oracle:thin:@myhost.inxire.com:1521:orcl"

removeAbandoned="true"

removeAbandonedTimeout="30"

maxActive="20"

maxIdle="10" maxwait="-1"/>

In addition to the above, you need to change the data source name attribute in the web.xml of the ecmsdk.ear file, as Tomcat places all configured entries and resources in the java:comp/env portion of the JNDI namespace which is different from what most other containers are doing.The modified data source name in the ECMSDK web.xml for Tomcat should look like this:

<context-param>

<description>The name of the DataSource for the CMSDK repository</description>

<param-name>IFS.NODE.DataSourceName</param-name>

<param-value>java:/comp/env/jdbc/OracleDS</param-value>

</context-param>