Configure Apache Tomcat for Derby manually

IBM Worklight V5.0.5. automatically configures your databases. However, if you are using an older version of IBM Worklight, or if you are experiencing problems with the automatic configuration process for the Apache Tomcat Server, you must manually set up and configure your Apache Derby database and then the Apache Tomcat Server for Derby. Complete the Apache Derby database setup procedure before continuing.

  1. Add the Derby $DERBY_INSTALL/lib/derby.jar file to the Tomcat lib directory.

    1. For JDBC, modify the worklight.properties file as follows:
      wl.db.type=DERBY
      wl.db.url=path_to_db/WRKLGHT
      wl.reports.db.type=DERBY
      wl.reports.db.url=path_to_db/WLREPORT
      wl.db.username=worklight
      wl.db.password=worklight
      reports.exportRawData=true
      

    2. For JNDI, update the $TOMCAT_HOME/conf/web.xml file as follows:
      <web-app>
          ....
          ....
          	<resource-ref>
          		<res-ref-name>jdbc/WorklightDS
      </res-ref-name>
          		<res-type>javax.sql.DataSource
      </res-type>
          		<res-auth>Container</res-auth>
          	</resource-ref>
      <resource-ref>
          		<res-ref-name>
      jdbc/WorklightReportsDS
      </res-ref-name>
          		<res-type>javax.sql.DataSource
      </res-type>
          		<res-auth>Container</res-auth>
          	</resource-ref>
          </web-app>
      

  2. Update the $TOMCAT_HOME/conf/context.xml file as follows:
    <Resource auth="Container"
    	driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
    	name="jdbc/WorklightDS"
    	password="worklight"
    	username="worklight"
    	type="javax.sql.DataSource"
    	url="jdbc:derby:path_to_db/WRKLGHT"/>
    <Resource auth="Container"
    	driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
    	name="jdbc/WorklightReportsDS"
    	password="worklight"
    	username="worklight"
    	type="javax.sql.DataSource"
    	url="jdbc:derby:<path/to/db>/WLREPORT "/>
    

  3. In the worklight.properties file, update wl.db.jndi.name as follows: wl.db.jndi.name=java:comp/env/jdbc/WorklightDS wl.reports.db.jndi.name=java:comp/env/jdbc/WorklightReportsDS


Parent topic Troubleshooting