Showing posts with label douglas. Show all posts
Showing posts with label douglas. Show all posts

Tuesday, September 21, 2010

Installing Oracle on Ubuntu

Most of the applications we write here at CTP depend on an Oracle database.
After putting some effort on configuring our development environment for a new project and figuring out the process wasn't as straightforward as I expected, I decided to share my finding in this walkthrough.
It describes the steps required to install Oracle on a Ubuntu Server.

Prerequisites


The instructions apply to Oracle 11g (version 11.2.0.1.0) on an Ubuntu 10.04.1 Server Edition 64-bit.
Download Ubuntu's installation ISO from http://www.ubuntu.com/server/get-ubuntu/download and Oracle's ZIPs from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html.
A Windows environment is used as client. You will need the following tools:


Server configuration



Installation


Install Ubuntu in your server. In this example a virtual machine with 32 Gb of disk and 2Gb of RAM is used.
During the installation process, select the "SSH server" to be installed. To do it after installation, run:

sudo apt-get install openssh-server openssh-client

X Forwarding


You should configure PuTTY to forward the graphical applications from the Ubuntu server (the 'server') to your Windows workstation (the 'client'),
as the Oracle 11g installation depends on it.
Open PuTTY and enter the IP address of your server, give a name to the session and save it. Configure the following options:

  • In "Connection > SSH > X11", check "Enable X11 forwarding" and for "X display location" enter "localhost:0"

  • Go to the "Session" menu and save your session again, to persist the configuration changes.



Start the X server in your client computer before connecting to the server through PuTTY. In the programs menu, open "Cygwin-X" and run "XWin Server".
It may start a graphical terminal (XTerm) but you should close it, to avoid confusion. All you need is to keep the server running, indicated by the fancy X icon in the system tray.
Now you can establish the SSH connection. To test if the X Forwarding is properly configured, run xeyes in the server (if not found, run sudo apt-get install x11-apps) and you should see the eyes in your desktop.

Swap configuration


The amount of swap space required by the Oracle DB depends on the available RAM:

Available RAMSwap required
Between 1 and 2 Gb1.5 x RAM
Between 2 and 16 Gb1 x RAM
More than 16 Gb16 Gb

To check the existing configured space, run

$ free
total used free shared buffers cached
Mem: 2057836 181680 1876156 0 12268 91092
-/+ buffers/cache: 78320 1979516
Swap: 1417208 0 1417208

In this walkthrough I'm going to add 2Gb to the existing swap space.

# Creates a swap file, may take a while to execute
$ sudo dd if=/dev/zero of=/mnt/2Gb.swap bs=1M count=2048
# Activating the swap file
sudo mkswap /mnt/2Gb.swap
sudo swapon /mnt/2Gb.swap

To have the swap file mounted automatically after a reboot, add the following line to the /etc/fstab file:

/mnt/2Gb.swap none swap sw 0 0

Updating and installing dependencies



$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential libaio1 libaio-dev libmotif3 libtool expat alien ksh pdksh unixODBC unixODBC-dev sysstat elfutils libelf-dev binutils lesstif2 lsb-cxx rpm lsb-rpm gawk unzip x11-utils ia32-libs

Installing libstdc++ 5


Ubuntu comes with libstdc++ version 6, but Oracle requires version 5. To fix it:

$ wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_amd64.deb
$ dpkg-deb -x libstdc++5_3.3.6-17ubuntu1_amd64.deb ia64-libs
$ sudo cp ia64-libs/usr/lib/libstdc++.so.5.0.7 /usr/lib64
$ cd /usr/lib64
$ sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5
$ ls -al libstdc++.*
lrwxrwxrwx 1 root root 18 2010-09-17 14:19 libstdc++.so.5 -> libstdc++.so.5.0.7
-rw-r--r-- 1 root root 829424 2010-09-17 14:18 libstdc++.so.5.0.7
lrwxrwxrwx 1 root root 19 2010-09-14 12:05 libstdc++.so.6 -> libstdc++.so.6.0.13
-rw-r--r-- 1 root root 1044112 2010-03-27 01:16 libstdc++.so.6.0.13

Links update


Update the symbolic link /bin/sh from /bin/dash to /bin/bash.

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2010-09-14 12:05 sh -> dash
$ cd /bin
$ sudo ln -sf bash /bin/sh
$ ls -l sh
lrwxrwxrwx 1 root root 4 2010-09-14 14:19 sh -> bash

Some links need to be created as well:

ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/rpm /bin/rpm
ln -s /usr/bin/basename /bin/basename

System users & groups


Change to root and create the following users and groups

ctp@oracle11g:~$ sudo -s
root@oracle11g:~# addgroup oinstall
Adding group `oinstall' (GID 1001) ...
Done.
root@oracle11g:~# addgroup dba
Adding group `dba' (GID 1002) ...
Done.
root@oracle11g:~# addgroup nobody
Adding group `nobody' (GID 1003) ...
Done.
root@oracle11g:~# usermod -g nobody nobody
root@oracle11g:~# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
root@oracle11g:~# passwd -l oracle
passwd: password expiry information changed.
root@oracle11g:~# mkdir /home/oracle
root@oracle11g:~# chown -R oracle:dba /home/oracle

Creating ORACLE_HOME



root@oracle11g:~# mkdir -p /u01/app/oracle
root@oracle11g:~# chown -R oracle:dba /u01

System parameters


Some Linux kernel parameters need to be modified, as specified in Oracle's installation guide. To do that, add the parameters below to the file /etc/sysctl.conf:

fs.file-max = 65535
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65535
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

The oracle user needs to have some shell limits increased by adding the parameters below to the file /etc/security/limits.conf:

oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535

Add the parameters below to the file /etc/pam.d/login:

session required /lib/security/pam_limits.so
session required pam_limits.so

Reboot the system to reload the configuration.

Oracle installation


From the directory you extracted the Oracle zip files, run database/runInstaller as the user oracle created above (see Unix Tips if you need help). You can ignore the DISPLAY warning, if any. If you receive an error regarding the X forwarding permission, use this remote X forwarding trick.

Installation options


The suggested installation options:

  • Create and configure a database

  • Server class

  • Single instance database installation

  • Advanced install

  • Enterprise Edition

  • General purpose/Transaction processing

  • Memory, Character sets, Security and Sample Schemas - as default


Run the fixup script following the instructions and then ignore the package dependencies.

To check if everything is ok, open the following address in your browser:

https://<server>:1158/em


Startup script


First, edit the file /etc/oratab or create one if you don't have it already. Make sure that the last parameter is "Y", meaning you want the database to be started during boot.

oracle:/u01/app/oracle/product/11.2.0/dbhome_1:Y

Now create the startup script /etc/init.d/oracledb.

cd /etc/init.d
sudo touch oracledb
sudo chmod a+x oracledb

Add the following content to the startup script

#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Enterprise Manager

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_OWNR=oracle
export ORACLE_SID=oracle
export PATH=$PATH:$ORACLE_HOME/bin

if [ ! -f $ORACLE_HOME/bin/emctl -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi

case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
sudo -u $ORACLE_OWNR -E $ORACLE_HOME/bin/lsnrctl start
sudo -u $ORACLE_OWNR -E $ORACLE_HOME/bin/dbstart $ORACLE_HOME
sudo -u $ORACLE_OWNR -E touch /var/lock/oracle
# Oracle enterprise manager startup
sudo -u $ORACLE_OWNR -E $ORACLE_HOME/bin/emctl start dbconsole
echo "OK"
;;
stop)

echo -n "Shutdown Oracle: "
# Oracle enterprise manager shutdown
sudo -u $ORACLE_OWNR -E $ORACLE_HOME/bin/emctl stop dbconsole
# Oracle listener and instance shutdown
sudo -u $ORACLE_OWNR -E $ORACLE_HOME/bin/lsnrctl stop
sudo -u $ORACLE_OWNR -E $ORACLE_HOME/bin/dbshut $ORACLE_HOME
sudo -u $ORACLE_OWNR -E rm -f /var/lock/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac

exit 0


To execute the script automatically during server startup:

sudo update-rc.d oracledb defaults 99


General tips n' tricks



Unix tips


Open a shell as anoter user:

sudo -u <username> -s


Remote X session config



$ xauth list
oracle/unix:10 MIT-MAGIC-COOKIE-1 a18621a7bf2c102fc2b27758007b56a0
# Copy the line returned above
sudo -u oracle -s
export HOME=/home/oracle
# Paste the copied line after xauth add
xauth add oracle/unix:10 MIT-MAGIC-COOKIE-1 a18621a7bf2c102fc2b27758007b56a0


References


Tuesday, October 7, 2008

Java People Spotlight: Douglas Rodrigues

Our "People Spotlight" series continues with an official JUG Brazil member... "Braziiiiiiiiiiiiiiiiiiiiiiiil !!! ;-) ". Besides contributing his excellence to CTP's Java Community, Douglas makes sure that Brazil stays the number 2 in the list of the countries with most hits to this blog! ;-) ... and here are Douglas answers:

Java Community Role:
Developer [aka Java Code Spitter]
My Master Kung-Fu Skills
:
Write code that (almost) anyone can read and understand in the future.
I'd be excited to get my hands dirty on:
JBoss DNA and IntelliJ IDEA 8.

Q&A

Q: Hi Douglas, how would your message look like if you would have to tell it via Twitter what you are currently doing?
A: while (!weekend) { iTunes.open(); while (!night) { iTunes.play(); doCode(); iTunes.pause(); getCoffee(); } iTunes = null; } // One-liners rocks! \o/
Q': and where is the exception handling??!!! ;-)

Q: What was the greates piece of code you have ever written so far?
A: An image to HTML converter. It takes a 30kB image and produces a 5MB HTML file.

Q: What is the best quote you have ever heard about programming?
A: "The nice thing about standards is that there are so many of them to choose from", by Andrew S. Tanenbaum.

Q: What is the best quote you have heard from our managers?
A: Well, I hear "we're all in sales" at least once every month.

Q: What is the most cutting-edge technology or framework you actually used on projects?
A: Java Content Repository API (JCR).

Q: What is your favorite podcast?
A: I'm not a big fan of technology related podcasts, but I tried Java Posse and it's kinda funny.

Q: Which Java book can you recommend and for what reason?
A: Head First Design Patterns

Friday, September 26, 2008

Adding JCR support to your existing web application

In addition to the two recent technology posts (1, 2) that contained a product and technology overview about JCR, this post is guiding you through the practical steps in order to add JCR support to your web applications.

A new alternative to manage your application data is to store it in a content repository. The approach brings some advantages if compared to the most widespread persistence mechanism in use currently, the relational databases. The main advantage is the ability to have unstructured data. You can store your data first, and then define how it’s going to be organized and how the pieces of persistent information relate to each other. Besides the fact that not enforcing data integrity constraints, when they are not necessary, certainly helps in your application performance. This feature is especially useful when it’s necessary to enhance the data model. Relational databases are known for not having a very flexible structure. On the other hand, the JCR API was designed to target this need.
Suppose that you got a request to have a modification date added to some of your entities. In the relational model you’ll have to find out which tables should get the new field, and maybe provide an initial value for the column. Using JCR, you can simply have this modification date available only in the newly created entities. There is no need to concern about the existing data, because with JCR you can add and remove attributes on-the-fly. There is also no need to change any structure information, because it’s not required to declare any structure at all. If you would like to add a JCR repository to your existing web application, here is a walkthrough covering all the required steps.
The presented scenario assumes a Maven 2 web application, to be deployed in a Tomcat 5.5 server.
If you don’t have a web application to start with, or if you prefer to use a test project first, I suggest you to use Apache Maven to create a simple web project. To do so, run the following command in an empty directory:


mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes \
-DarchetypeArtifactId=maven-archetype-webapp \
-DgroupId=com.ctp.jcr.sample -DartifactId=webapp -Dversion=0.1 \
-Dpackage=com.ctp.jcr.sample.webapp


The “archetype:create” Maven goal will create an empty web project called “webapp”. Let’s import this project into Eclipse, so it will be easier to change it. Change to the project directory and run the following command to generate the Eclipse specific project configuration files:


mvn eclipse:eclipse -Dwtpversion=1.5


The project is ready to be imported by Eclipse (File > Import > Existing projects into workspace; no Maven for Eclipse plugin is required, just an environment variable needs to be configurated).
Another approach to create this project is to use a Maven plug-in for Eclipse called m2eclipse. After installing it, you can create a Maven project by opening the menu “File > New > Other…” and choosing “Maven Project”. In the “New Maven Project” wizard, click “Next”, Choose the “Internal” catalog and in the archetypes list, choose “maven-archetype-webapp”. Click “Next” and provide the group ID “com.ctp.jcr.sample” and the artifact ID “webapp”. To complete the project creation, click “Finish”.
The next step is to add the proper dependencies to the project’s POM. So change it to match the following dependencies:


<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-core</artifactId>
<version>1.4.5</version>
<scope></scope>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-rmi</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-server</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-webapp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>


After changing the POM file, run the “eclipse:eclipse” goal again, and refresh your Eclipse project. As the JCR API has a “provided” scope, the JAR file which can be found in your local Maven repository (~/.m2/repository/javax/jcr/jcr/1.0/jcr-1.0.jar) should be copied to the shared/lib Tomcat folder.
Using a context descriptor file (create the file webapp/src/main/webapp/META-INF/context.xml) a shared resource, the JCR repository, will be defined. This resource receives essentially two important parameters: “configFilePath”, which is the absolute path to the repository descriptor (the “repository.xml” file, to be explained in the next steps) and “repHomeDir”, the absolute path to the directory which will contain the repository data files.


<Context>
<Resource name="jcr/repository"
auth="Container"
type="javax.jcr.Repository"
factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
configFilePath="c:/TEMP/webapp/repository/repository.xml"
repHomeDir="c:/TEMP/webapp/repository" />
</Context>


This shared resource needs to be declared in the web.xml file:


<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Archetype Created Web Application</display-name>
<resource-ref>
<description>JCR Repository</description>
<res-ref-name>jcr/repository</res-ref-name>
<res-type>javax.jcr.Repository</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>


Don’t forget to create the repository descriptor file, in the same path as specified in the context descriptor. If you don’t have your own descriptor, or if you don’t want to concern about it right now, simply copy and paste this one:


<?xml version="1.0"?>
<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN"
"http://jackrabbit.apache.org/dtd/repository-1.4.dtd">
<Repository>
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${rep.home}/repository" />
</FileSystem>
<Security appName="Jackrabbit">
<AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager" />
<LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule" />
</Security>
<Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" />
<Workspace name="${wsp.name}">
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}" />
</FileSystem>
<PersistenceManager
class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" />
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index" />
</SearchIndex>
</Workspace>
<Versioning rootPath="${rep.home}/versions">
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${rep.home}/versions" />
</FileSystem>
<PersistenceManager
class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" />
</Versioning>
</Repository>


This simplified repository descriptor doesn’t depend on any kind of specific storage system. You can enhance it to store your data in a relational database, for example, but in our example it will store everything as XML files under the repository home directory.
Now let’s create a session factory class. This class will locate a repository instance and authenticate to it, to get a javax.jcr.Session instance. Create the directory ./webapp/src/main/java, and create the following class on it:


package com.ctp.jcr.sample.webapp;

import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class SessionFactory {

public static Session getSession() throws RepositoryException, NamingException {
InitialContext ctx = new InitialContext();
Context env = (Context) ctx.lookup("java:comp/env");
Repository repo = (Repository) env.lookup("jcr/repository");
return repo.login(new SimpleCredentials("admin", "".toCharArray()));
}

}


With this setup, the JCR repository can be accessed through your web application. The following JSP shows how to use the service factory to list the repository contents:


<%@page import="javax.jcr.Node"%>
<%@page import="javax.jcr.Session"%>
<%@page import="com.ctp.jcr.sample.webapp.SessionFactory"%>
<%@page import="javax.jcr.NodeIterator"%>
<html>
<body>
<%!
private void printContents(Node n, JspWriter out, String padding) throws Exception {
out.println(padding + n.getPath() + "(" + n.getPrimaryNodeType().getName() + ")");
NodeIterator it = n.getNodes();
while (it.hasNext()) {
printContents(it.nextNode(), out, padding + " ");
}
}
%>
<%
Session jcrSession = SessionFactory.getSession();
Node root = jcrSession.getRootNode();
%>
<pre>
<%
printContents(root, out, "");
%>
</pre>
</body>
</html>


This is the result displayed by the page. Observe that even for an empty repository, the infrastructure nodes are displayed as well.

Optional step: exposing the repository through WebDAV



To access your repository through WebDAV, it’s necessary to declare a servlet, through which the repository will be exposed. Add the following servlet declarations to your web.xml file:


<servlet>
<description> This servlet provides other servlets and jsps a common way to
access the repository. The repository can be accessed via JNDI, RMI or
Webdav. </description>
<servlet-name>Repository</servlet-name>
<servlet-class>org.apache.jackrabbit.j2ee.RepositoryAccessServlet</servlet-class>
<init-param>
<description> Property file that hold the same initialization properties
than the init-params below. If a parameter is specified in both places
the one in the bootstrap-config wins. </description>
<param-name>bootstrap-config</param-name>
<param-value>WEB-INF/repository/bootstrap.properties</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet>
<description> The webdav servlet that connects HTTP request to the
repository. </description>
<servlet-name>Webdav</servlet-name>
<servlet-class>org.apache.jackrabbit.j2ee.SimpleWebdavServlet</servlet-class>
<init-param>
<description> defines the prefix for spooling resources out of the
repository. </description>
<param-name>resource-path-prefix</param-name>
<param-value>/repository</param-value>
</init-param>
<init-param>
<description> Defines various dav-resource configuration parameters.
</description>
<param-name>resource-config</param-name>
<param-value>/WEB-INF/repository/config.xml</param-value>
</init-param>
<load-on-startup>4</load-on-startup>
</servlet>
<servlet>
<description> The webdav servlet that connects HTTP request to the
repository. </description>
<servlet-name>JCRWebdavServer</servlet-name>
<servlet-class>org.apache.jackrabbit.j2ee.JCRWebdavServerServlet</servlet-class>
<init-param>
<description> defines the prefix for spooling resources out of the
repository. </description>
<param-name>resource-path-prefix</param-name>
<param-value>/server</param-value>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet>
<servlet-name>RMI</servlet-name>
<servlet-class>org.apache.jackrabbit.servlet.remote.RemoteBindingServlet</servlet-class>
</servlet>
<servlet>
<description>Downloads binary data from repository</description>
<display-name>Repository Download Servlet</display-name>
<servlet-name>RepositoryDownloadServlet</servlet-name>
<servlet-class>br.com.hapkidocontato.site.presentation.RepositoryDownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Webdav</servlet-name>
<url-pattern>/repository/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>JCRWebdavServer</servlet-name>
<url-pattern>/server/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>RMI</servlet-name>
<url-pattern>/rmi</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>RepositoryDownloadServlet</servlet-name>
<url-pattern>/content/*</url-pattern>
</servlet-mapping>


Other two configurations file are referenced by those servlets. Create the directory webapp/src/main/webapp/WEB-INF/repository/ and create the file bootstrap.properties with the following values:


repository.name=java:comp/env/jcr/repository
jndi.enabled=true
jndi.name=jcr/repository


In the same directory, create the file config.xml:


<?xml version="1.0" encoding="UTF-8"?>
<config>
<iomanager>
<class name="org.apache.jackrabbit.server.io.IOManagerImpl" />
<iohandler>
<class name="org.apache.jackrabbit.server.io.VersionHandler" />
</iohandler>
<iohandler>
<class name="org.apache.jackrabbit.server.io.VersionHistoryHandler" />
</iohandler>
<iohandler>
<class name="org.apache.jackrabbit.server.io.ZipHandler" />
</iohandler>
<iohandler>
<class name="org.apache.jackrabbit.server.io.XmlHandler" />
</iohandler>
<iohandler>
<class name="org.apache.jackrabbit.server.io.DirListingExportHandler" />
</iohandler>
<iohandler>
<class name="org.apache.jackrabbit.server.io.DefaultHandler" />
</iohandler>
</iomanager>
<propertymanager>
<class name="org.apache.jackrabbit.server.io.PropertyManagerImpl" />
<propertyhandler>
<class name="org.apache.jackrabbit.server.io.VersionHandler" />
</propertyhandler>
<propertyhandler>
<class name="org.apache.jackrabbit.server.io.VersionHistoryHandler" />
</propertyhandler>
<propertyhandler>
<class name="org.apache.jackrabbit.server.io.ZipHandler" />
</propertyhandler>
<propertyhandler>
<class name="org.apache.jackrabbit.server.io.XmlHandler" />
</propertyhandler>
<propertyhandler>
<class name="org.apache.jackrabbit.server.io.DirListingExportHandler" />
</propertyhandler>
<propertyhandler>
<class name="org.apache.jackrabbit.server.io.DefaultHandler" />
</propertyhandler>
</propertymanager>
<noncollection>
<nodetypes>
<nodetype>nt:file</nodetype>
<nodetype>nt:resource</nodetype>
</nodetypes>
</noncollection>
<filter>
<class name="org.apache.jackrabbit.webdav.simple.DefaultItemFilter" />
<namespaces>
<prefix>rep</prefix>
<prefix>jcr</prefix>
</namespaces>
</filter>
</config>


And that’s all: the default workspace can be accessed through WebDAV in the following URL: http://localhost:8080/webapp/repository/default. On Windows, you can go to “My Network places” and “Add network place” to map the WebDAV location as a folder. When prompted by a username and password, just provide anything; the repository is configured to grant access to any user.
To find more about JCR, Jackrabbit and its related technologies, visit the dev.day.com weblog.

Thanks Douglas for this post! - [Tom & Balz]