I'm having difficulty specifying the correct url to the hsqldb dictionary file when packaging ctakes-web-client or ctakes-temporal-demo as a war file.
I've downloaded healthnlp/examples at https://github.com/healthnlp/examples, and have successfully run these examples in the Eclipse Maven Jetty environment. Thanks. The location/url for the hsqldb dictionary file is defined as "src/main/resources/org/apache/ctakes/dictionary/lookup/fast/sno_rx_16ab/sno_rx_16ab" in src/main/resources/org/apache/ctakes/dictionary/lookup/fast/sno_rx_16ab.xml and cTakesHsql.xml. A snipet from sno_rx_16ab.xml is show below: <dictionary> <name>sno_rx_16abTerms</name> <implementationName>org.apache.ctakes.dictionary.lookup2.dictionary.JdbcRareWordDictionary</implementationName> <properties> <!-- urls for hsqldb memory connections must be file types in hsql 1.8. These file urls must be either absolute path or relative to current working directory. They cannot be based upon the classpath. Though JdbcConnectionFactory will attempt to "find" a db based upon the parent dir of the url for the sake of ide ease-of-use, the user should be aware of these hsql limitations. --> <property key="jdbcDriver" value="org.hsqldb.jdbcDriver"/> <property key="jdbcUrl" value="jdbc:hsqldb:file:src/main/resources/org/apache/ctakes/dictionary/lookup/fast/sno_rx_16ab/sno_rx_16ab"/> <property key="jdbcUser" value="sa"/> <property key="jdbcPass" value=""/> <property key="rareWordTable" value="cui_terms"/> <property key="umlsUrl" value=" https://uts-ws.nlm.nih.gov/restful/isValidUMLSUser"/> <property key="umlsVendor" value="NLM-6515182895"/> <property key="umlsUser" value="CHANGE_ME"/> <property key="umlsPass" value="CHANGE_ME"/> </properties> </dictionary> Here's my understanding so far: Maven's src/main/resources directory is a build time path, not a runtime path. This allows the hsqldb file to be discovered when running within the Eclipse IDE environment. When building a war file, everything in src/main/resources is copied to the root of the /WEB-INF/classes directory in the war. Knowing this, I've tried modifying the the jdbcURL parameter, but have been unsuccessul. Here's what I've tried: // works within Eclipse, not within war file "jdbc:hsqldb:file:org/apache/ctakes/dictionary/lookup/fast/sno_rx_16ab/sno_rx_16ab"/> // works within Eclipse, not within war file "jdbc:hsqldb:file:/org/apache/ctakes/dictionary/lookup/fast/sno_rx_16ab/sno_rx_16ab"/> // works within Eclipse, not within war file "jdbc:hsqldb:res:org/apache/ctakes/dictionary/lookup/fast/sno_rx_16ab/sno_rx_16ab"/> // works within Eclipse, not within war file "jdbc:hsqldb:res:/org/apache/ctakes/dictionary/lookup/fast/sno_rx_16ab/sno_rx_16ab"/> If the JDBC URL is a relative path, at runtime this path is relative to the current working directory - and it's unlikely to exist at runtime anyway, so I've also tried using an absolute path. I've also tried copying the resource files to other locations within an exploded war file, etc. Any insight into how others have solved this problem would be greatly appreciated. Thank you, Jay Urbain