Home
english
Home
.NET Server
Java Server
.NET Client
AJAX Client
AJAX Browser
Map Drive
Pricing
Contacts
info@ithit.com



Java WebDAV Server Example for Tomcat / GlassFish with Oracle Backend

IT Hit WebDAV Server Library for Java is shipped with a sample server implementation that can run on Apache Tomcat or Sun GlassFish.

OracleStorage Example

The sample provides Class 2 WebDAV server implementation that can be hosted in Apache Tomcat or Sun GlassFish. The data is stored in Oracle database.

Requirements

  • Oracle Database 10g Express, Standard or Enterprise Edition
  • Apache Tomcat 6.0 or Sun GlassFish v3

Running the sample

  1. Create the database. The Oracle database script is located in \samples\oraclestorage\db\OracleStorage.sql file. This script creates tables and populates them with data so your WebDAV server initially has several folders. To run the script login to Oracle administration web interface, go to SQL->SQL Scripts->Create, paste content of OracleStorage.sql to script field, specify script name and click Run.

    It is also recommended to increase the datafile. After creating the database run the following command:

    alter database datafile ' C:\oraclexe\oradata\XE\SYSTEM.DBF' resize 4g;

     This is especially required if you would like to test WebDAV server running Oracle XE with IT Hit AJAX File Browser.

  2. Set license. Download your license file here. To set the license edit license section in \oraclestorage\WEB-INF\web.xml and specify path to license.xml file. The IT Hit Java WebDAV Server Library is fully functional and does not have any limitations. However the trial period is limited to 1 month. After the trial period expires the Java WebDAV Server will stop working.
  3. Configure application server. Here we will configure WebDAV server to run on website root (http://server.com/). While you can configure WebDAV server to run on site non-root (for instance on http://server.com/webdavroot/) we do not recommend that. Some WebDAV clients such as Microsoft Web Folders on Vista will fail to connect to non-root server. Web Folders submit configuration requests to server root and if it does not get the response it will not be able to connect.
    1. In case of Tomcat:
      Copy \oraclestorage folder to Apache Software Foundation\Tomcat x.x\webapps folder. Add the following lines under the <Host> tag in Apache Software Foundation\Tomcat x.x\conf\server.xml:

      <Context path="" debug="0" docBase="oraclestorage">
       <Resource name="jdbc/Oracle" auth="Container"
              type="javax.sql.DataSource" username="system" password="pwd"
              driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:XE"
              maxActive="8" maxIdle="4" factory="org.apache.commons.dbcp.BasicDataSourceFactory"/>
      </Context>

      Specify Oracle database login credentials in Context tag.
      Finally restart the Tomcat for configuration changes to take effect.

      To see if your server is running type the root url of your WebDAV site in a browser and you will see the list of folders. Now connect to server with any WebDAV client.

      If you experience any problems examine the log created by tomcat: C:\Program Files\Apache Software Foundation\Tomcat x.x\logs\localhost.xxxx-xx-xx.log.

    2. In case of Glassfish:
      1. Create oracle connection pool.

        Copy \oraclestorage\WEB-INF\lib\ojdbc6.jar to  <GLASSFISH_HOME>/domains/domain1/lib/ext folder. Note that "domain1" is a default Glassfish domain. The  domain may be different for specific deployments.

        Restart GlassFish.

        Open administrative console of the Glassfish server.

        From the main tree (Common Tasks) expand Resources and go to JDBC > Connection Pools. Create a Connection pool:

                  - JNDI name = Oracle

                  - resource_type = javax.sql.ConnectionPoolDataSource

                  - Database Vendor = Oracle                                                  

        Click Next.

        Specify following additional properties (replace following values with your specific):

                  - url = jdbc:oracle:thin:@localhost:1521:XE

                  - user = system

                  - password = password

                  - xa-driver-does-not-support-non-tx-operations = true

        Test connection with Ping button.

      2. Create DataSource.

        From the main tree (Common Tasks) expand Resources and go to JDBC > JDBC Resources.

        Press New and provide the following information:

                  - JNDI Name: jdbc/Oracle (must be called exactly like this).

                  - Pool Name: The pool name created in the previous section.

        Press OK, jdbc-resource will be created.

      3. Deploy oraclestorage application.

        From the main tree (Common Tasks) goto Applications.

        Press Deploy and specify following properties:

                  - Local Packaged File or Directory That Is Accessible from the Enterprise Server = <path to oraclestorage directory>

                  - Type = Web Application

                  - Context Root = /

                             Note: sample can be deployed to non root context but some clients work only with servers deployed to root context.

                  - Application Name = oraclestorage

      4. Launch sample.

        From the main tree (Common Tasks) goto Applications.

        Press Launch on oraclestorage application.

        If everything was set up propertly you should see sample page with list of sample files and folders. Now connect to server with any WebDAV client.

        If anything goes wrong please consult log usually located at <GLASSFISH_INSTANCE_ROOT>/logs/server.log.


What WebDAV software would you like to have?

Selected Customers:
Country: Norway
DnB NOR Group
Country: Finland
Bank of Finland
Country: United Kingdom
Bechtle Direct
Country: Sweden
BT Industries
Country: USA
California Chamber of Commerce
Country: Denmark
Danfoss Group
Country: Denmark
DFDS
Country: USA
Fluke Networks
Country: USA
HNI Corporation
Country: USA
IHS Inc
Country: USA
LandAmerica Financial Group
Country: Canada
Laurentian University
Country: USA
Microsoft
Country: Israel
RADVISION
Country: Ukraine
Raiffeisen Bank
Country: Netherlands
Sanoma Uitgevers
Country: USA
Siemens
Country: Australia
WorkCover NSW
Country: Ukraine
OTP Bank
Country: USA
Intel Corporation
Country: Austria
Austrian Federal Railways
Home .NET Server Java Server .NET Client AJAX Client AJAX Browser Map Drive Pricing Contacts

Updated: Friday, February 05, 2010