On Thu, 06 Jan 2005 16:06:31 +0100, "Erik Bruchez" <[EMAIL PROTECTED]> said: > But Dan can maybe reply to the question of how to modify the > server.xml used by Studio.
Below are the steps necessary to get the database examples ( e.g. BizDoc, Employees ) to work in the Tomcat that is embedded in Studio 1.1.0. Basically they're the same as those for Tomcat 4.1 LE. The steps assume you haven't changed the Tomcat port number from the default. ( default is 8888 ). o Follow normal instructions for web.xml modification. o In your workspace create /.oxfContainers/Internal Tomcat/common/lib o In your workspace copy /yourproject/WEB-INF/lib/hsqldb-1_7_1.jar to /.oxfContainers/Internal Tomcat/common/lib/hsqldb-1_7_1.jar o In your workspace copy /yourproject/WEB-INF/lib/commons-pool-1.1.jar to /.oxfContainers/Internal Tomcat/common/lib/commons-pool-1.1.jar o Download dpcp from http://jakarta.apache.org/commons/dbcp/downloads.html and copy commons-dbcp-*.jar to /.oxfContainers/Internal Tomcat/common/lib/commons-dbcp-*.jar o If you haven't launched Tomcat from Studio yet do so now. ( This will cause Studio to add a context to server.xml ) o In your workspace open /.oxfContainers/Internal Tomcat/conf/server.xml and find the context element for your project. Add to it <Resource name="jdbc/db" auth="Container" type="javax.sql.DataSource"/> <ResourceParams name="jdbc/db"> <parameter> <name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> </parameter> <parameter> <name>driverClassName</name> <value>org.hsqldb.jdbcDriver</value> </parameter> <parameter> <name>url</name> <value>jdbc:hsqldb:http://localhost:8888/your projects's context/db</value> </parameter> <parameter> <name>username</name> <value>sa</value> </parameter> <parameter> <name>password</name> <value/> </parameter> </ResourceParams> Also I have attached web.xml and server.xml that I was just using. In my case my project's name was 'x' and my projects's context was also 'x'. Note that since docBase in server.xml is a fully qualified path you won't be able to use my server.xml as is. -- Regards, Dan S
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <!-- Initialize resource manager --> <context-param> <param-name>oxf.resources.factory</param-name> <param-value>org.orbeon.oxf.resources.PriorityResourceManagerFactory</param-value> </context-param> <!-- Uncomment this for the Web app. resource manager --> <context-param> <param-name>oxf.resources.webapp.rootdir</param-name> <param-value>/WEB-INF/resources</param-value> </context-param> <context-param> <param-name>oxf.resources.priority.1</param-name> <param-value>org.orbeon.oxf.resources.WebAppResourceManagerFactory</param-value> </context-param> <!-- End Web app. resource manager --> <!-- Uncomment this for the flat file resource manager --> <!-- <context-param> <param-name>oxf.resources.flatfile.rootdir</param-name> <param-value>C:/path/to/my/resources</param-value> </context-param> <context-param> <param-name>oxf.resources.priority.1</param-name> <param-value>org.orbeon.oxf.resources.FlatFileResourceManagerFactory</param-value> </context-param>--> <!-- End flat file resource manager --> <context-param> <param-name>oxf.resources.priority.2</param-name> <param-value>org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory</param-value> </context-param> <!-- OXF Class Loader --> <context-param> <param-name>oxf.classloader.enable</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>oxf.classloader.ignore-packages</param-name> <param-value>java. javax. org.apache.log4j. org.xml. org.w3c.</param-value> </context-param> <!-- Set location of properties.xml (read by resource manager) --> <context-param> <param-name>oxf.properties</param-name> <param-value>oxf:/config/properties.xml</param-value> </context-param> <!-- Set main processor --> <context-param> <param-name>oxf.main-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}page-flow</param-value> </context-param> <context-param> <param-name>oxf.main-processor.input.controller</param-name> <param-value>oxf:/page-flow.xml</param-value> </context-param> <!-- Set XML Server configuration file --> <context-param> <param-name>oxf.xml-server.config</param-name> <param-value>oxf:/config/xml-server.xml</param-value> </context-param> <!-- Set context listener processors --> <!-- Uncomment this for the context listener processors --> <!-- <context-param> <param-name>oxf.context-initialized-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.context-initialized-processor.input.config</param-name> <param-value>oxf:/context/context-initialized.xpl</param-value> </context-param> <context-param> <param-name>oxf.context-destroyed-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.context-destroyed-processor.input.config</param-name> <param-value>oxf:/context/context-destroyed.xpl</param-value> </context-param>--> <!-- End context listener processors --> <!-- Set session listener processors --> <!-- Uncomment this for the session listener processors --> <!-- <context-param> <param-name>oxf.session-created-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.session-created-processor.input.config</param-name> <param-value>oxf:/context/session-created.xpl</param-value> </context-param> <context-param> <param-name>oxf.session-destroyed-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.session-destroyed-processor.input.config</param-name> <param-value>oxf:/context/session-destroyed.xpl</param-value> </context-param>--> <!-- End session listener processors --> <!-- Set Presentation Server listeners --> <!-- Uncomment this for the listeners --> <!-- <listener> <listener-class>org.orbeon.oxf.webapp.OXFServletContextListener</listener-class> </listener> <listener> <listener-class>org.orbeon.oxf.webapp.OXFSessionListener</listener-class> </listener>--> <!-- End listeners --> <!-- Uncomment this for the XML Server --> <!-- <listener> <listener-class>org.orbeon.oxf.xmlserver.ContextListener</listener-class> </listener>--> <!-- End XML Server --> <servlet> <servlet-name>oxf</servlet-name> <servlet-class>org.orbeon.oxf.servlet.OXFServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>DisplayChart</servlet-name> <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet> <servlet-name>struts</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>config/examples/struts/module</param-name> <param-value>/WEB-INF/struts-module.xml</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> <!-- Uncomment this for the SQL examples --> <servlet> <servlet-name>hsqldb</servlet-name> <servlet-class>org.hsqldb.Servlet</servlet-class> <init-param> <param-name>hsqldb.server.database</param-name> <param-value>oxf</param-value> </init-param> <load-on-startup>4</load-on-startup> </servlet> <!-- End SQL examples --> <servlet-mapping> <servlet-name>oxf</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>struts</servlet-name> <url-pattern>/struts/*</url-pattern> </servlet-mapping> <!-- Uncomment this for the SQL examples --> <servlet-mapping> <servlet-name>hsqldb</servlet-name> <url-pattern>/db</url-pattern> </servlet-mapping> <!-- End SQL examples --> <servlet-mapping> <servlet-name>DisplayChart</servlet-name> <url-pattern>/chartDisplay</url-pattern> </servlet-mapping> <!-- Uncomment this for the SQL examples --> <resource-ref> <description>DataSource</description> <res-ref-name>jdbc/db</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> <!-- End SQL examples --> <!-- Uncomment this for the authentication example --> <!-- <security-constraint> <web-resource-collection> <web-resource-name>Administration</web-resource-name> <url-pattern>/examples-standalone/authentication</url-pattern> </web-resource-collection> <auth-constraint> <role-name>administrator</role-name> </auth-constraint> </security-constraint> <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/examples-standalone/authentication/login</form-login-page> <form-error-page>/examples-standalone/authentication/login-error</form-error-page> </form-login-config> </login-config> <security-role> <role-name>administrator</role-name> </security-role>--> <!-- End authentication example --> </web-app>
