Hello List,
Since the beginning of this week, I've been trying to connect to Mysql from Slide.
I have been able to walk through using a filecontentstore. This was quite successful.
Now my task is to use mysql RDBMS as the contentstore.
So far, I have editted domain.xml file.
I am using a Java sample code posted sometime ago by one of the members of the List to
walk through slide and mysql as contentstore.
I am running
+Windows2000
+using Mysql version 4.0.12 (I have this properly setup)
+Slide 2.0 Tomcat 5.0.6 (as my DAV Server)
+J.D.K 1.4
I am currently having the following errors. I hope someone out there will give me
guidance as to what I need to do or probably what it is that I am doing wrong.
<><><><>Error<><><><><><>
12 Mar 2002 01:32:49 - org.apache.slide.common.Domain - INFO - Auto-Initializing Domain
12 Mar 2002 01:32:49 - org.apache.slide.common.Domain - INFO - Domain configuration :
{org.apache.slide.lock=true, org.apache.slide.versioncontrol=true,
org.apache.slide.debug=false, org.apache.slide.search=true,
org.apache.slide.security=true, org.apache.slide.domain=E:/tmp/Slide 2.0b1 Tomcat
5.0/slide/Domain.xml}
12 Mar 2002 01:32:49 - org.apache.slide.common.Domain - INFO - Initializing Domain
12 Mar 2002 01:32:49 - org.apache.slide.common.Domain - INFO - Domain configuration :
{org.apache.slide.lock=true, org.apache.slide.versioncontrol=true,
org.apache.slide.debug=false, org.apache.slide.search=true,
org.apache.slide.security=true, org.apache.slide.domain=E:/tmp/Slide 2.0b1 Tomcat
5.0/slide/Domain.xml}
12 Mar 2002 01:32:49 - org.apache.slide.common.Domain - INFO - Domain parameters:
{logger-level=6, versioncontrol-exclude=, auto-version=checkout-checkin,
historypath=/history, checkin-fork=forbidden, workingresourcepath=/workingresource,
workspacepath=/workspace, default=slide, auto-version-control=false,
logger=org.apache.slide.util.logger.SimpleLogger, checkout-fork=forbidden}
12 Mar 2002 01:32:50 - org.apache.slide.common.Domain - INFO - Initializing namespace
: jdbc_store
12 Mar 2002 01:32:50 - org.apache.slide.common.Domain - WARNING - Loading of
create_store_listener class failed: org.apache.slide.webdav.util.UriHandler
12 Mar 2002 01:32:50 - org.apache.slide.common.Namespace - INFO - Loading namespace
jdbc_store parameters
12 Mar 2002 01:32:50 - org.apache.slide.common.Namespace - INFO - Loading namespace
definition
12 Mar 2002 01:32:50 - org.apache.slide.common.Namespace - INFO - Node store:
org.apache.slide.store.impl.rdbms.JDBCStore
java.lang.NoClassDefFoundError: org/apache/commons/dbcp/ConnectionFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at org.apache.slide.common.Namespace.loadChildStore(Namespace.java:1085)
at org.apache.slide.common.Namespace.loadStoreDefinition(Namespace.java:932)12 Mar
2002 01:32:50 - org.apache.slide.common.Domain - ERROR -
java.lang.NoClassDefFoundError: org/apache/commons/dbcp/ConnectionFactory
at org.apache.slide.common.Namespace.loadDefinition(Namespace.java:707)
at org.apache.slide.common.Domain.initNamespace(Domain.java:809)
at org.apache.slide.common.Domain.init(Domain.java:433)
at org.apache.slide.common.Domain.selfInit(Domain.java:747)
at org.apache.slide.common.Domain.accessNamespace(Domain.java:235)
at com.onespace.webdav.Smysqlstore.setUp(Smysqlstore.java:54)
at com.onespace.webdav.Smysqlstore.main(Smysqlstore.java:147)
org.apache.slide.common.DomainInitializationFailedError: Domain initialization error
at org.apache.slide.common.Domain.init(Domain.java:438)
at org.apache.slide.common.Domain.selfInit(Domain.java:747)
at org.apache.slide.common.Domain.accessNamespace(Domain.java:235)
at com.onespace.webdav.Smysqlstore.setUp(Smysqlstore.java:54)12 Mar 2002 01:32:50 -
org.apache.slide.common.Domain - ERROR - Domain initialization error
at com.onespace.webdav.Smysqlstore.main(Smysqlstore.java:147)
Exception in thread "main"
========================================================================================================================
<><><><>Domain.xml<><><><>><>
<?xml version="1.0"?>
<slide default="slide">
<!--namespace name="slide"-->
<namespace name="jdbc_store">
<definition>
<store name="jdbc">
<nodestore classname="org.apache.slide.store.impl.rdbms.JDBCStore">
<parameter name="driver">com.mysql.jdbc.Driver</parameter>
<parameter
name="url">jdbc:mysql://localhost:3306/slidedb?useUnicode=true&characterEncoding=UTF-8</parameter>
<parameter name="user">root</parameter>
<parameter name="password">root</parameter>
<parameter
name="adapter">org.apache.slide.store.impl.rdbms.MySqlRDBMSAdapter</parameter>
</nodestore>
<securitystore>
<reference store="nodestore" />
</securitystore>
<lockstore>
<reference store="nodestore" />
</lockstore>
<revisiondescriptorsstore>
<reference store="nodestore" />
</revisiondescriptorsstore>
<revisiondescriptorstore>
<reference store="nodestore" />
</revisiondescriptorstore>
<contentstore>
<reference store="nodestore" />
</contentstore>
</store>
<scope match="/" store="jdbc" />
<logger classname="org.apache.slide.util.logger.SimpleLogger"
logger-level="6" />
</definition>
<configuration>
<!-- Actions mapping -->
<read-object>/actions/read</read-object>
<create-object>/actions/write</create-object>
<remove-object>/actions/write</remove-object>
<grant-permission>/actions/write-acl</grant-permission>
<revoke-permission>/actions/write-acl</revoke-permission>
<read-permissions>/actions/read-acl</read-permissions>
<read-own-permissions>/actions/read-current-user-privilege-set</read-own-permissions>
<lock-object>/actions/write</lock-object>
<kill-lock>/actions/unlock</kill-lock>
<read-locks>/actions/read</read-locks>
<read-revision-metadata>/actions/read</read-revision-metadata>
<create-revision-metadata>/actions/write-properties</create-revision-metadata>
<modify-revision-metadata>/actions/write-properties</modify-revision-metadata>
<remove-revision-metadata>/actions/write-properties</remove-revision-metadata>
<read-revision-content>/actions/read</read-revision-content>
<create-revision-content>/actions/write-content</create-revision-content>
<modify-revision-content>/actions/write-content</modify-revision-content>
<remove-revision-content>/actions/write-content</remove-revision-content>
<bind-member>/actions/bind</bind-member>
<unbind-member>/actions/unbind</unbind-member>
<!-- Paths configuration -->
<userspath>/users</userspath>
<rolespath>/roles</rolespath>
<actionspath>/actions</actionspath>
<filespath>/files</filespath>
<parameter name="dav">true</parameter>
<parameter name="standalone">true</parameter>
<parameter name="acl_inheritance_type">path</parameter>
<!-- Nested roles: 0 means no nesting (default), 1 means one sublevel,
etc. -->
<parameter name="nested_roles_maxdepth">0</parameter>
</configuration>
<data>
<objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
<!-- Subject can be:
any user "all"
authenticated user "authenticated"
unauthenticated user "unauthenticated"
self "self"
owner of resource "owner"
a user "/users/john"
a role "/roles/admin"
-->
<permission action="all" subject="/roles/root" inheritable="true"/>
<permission action="/actions/read-acl" subject="all"
inheritable="true" negative="true"/>
<permission action="/actions/write-acl" subject="all"
inheritable="true" negative="true"/>
<permission action="/actions/unlock" subject="all" inheritable="true"
negative="true"/>
<permission action="/actions/read" subject="all" inheritable="true"/>
<!-- /users -->
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/users">
<permission action="all" subject="self" inheritable="true"/>
<permission action="all" subject="unauthenticated"
inheritable="true" negative="true"/>
<!-- /users/root represents the administrator -->
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/users/root">
<revision>
<property namespace="http://jakarta.apache.org/slide/"
name="password"/>
</revision>
</objectnode>
<!-- /users/john and /users/john2 represent authenticated users -->
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/users/john">
<revision>
<property namespace="http://jakarta.apache.org/slide/"
name="password"/>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/users/john2">
<revision>
<property namespace="http://jakarta.apache.org/slide/"
name="password"/>
</revision>
</objectnode>
<!-- /users/guest represents an authenticated or unauthenticated
guest user -->
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/users/guest">
<revision>
<property namespace="http://jakarta.apache.org/slide/"
name="password"/>
</revision>
</objectnode>
</objectnode>
<!-- /roles -->
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/roles">
<permission action="all" subject="self" inheritable="true"/>
<permission action="all" subject="unauthenticated"
inheritable="true" negative="true"/>
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/roles/root">
<revision>
<property name="group-member-set"><![CDATA[<D:href
xmlns:D='DAV:'>/users/root</D:href>]]></property>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/roles/user">
<revision>
<property name="group-member-set"><![CDATA[<D:href
xmlns:D='DAV:'>/users/john</D:href><D:href xmlns:D='DAV:'>/users/john2</D:href><D:href
xmlns:D='DAV:'>/users/root</D:href>]]></property>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/roles/guest">
<revision>
<property name="group-member-set"><![CDATA[<D:href
xmlns:D='DAV:'>/users/guest</D:href>]]></property>
</revision>
</objectnode>
</objectnode>
<!-- action -->
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions">
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/read">
<revision>
<property name="privilege-member-set"><![CDATA[<D:href
xmlns:D='DAV:'>/actions/read-acl</D:href> <D:href
xmlns:D='DAV:'>/actions/read-current-user-privilege-set</D:href>]]></property>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/read-acl">
<revision>
<property name="privilege-member-set"/>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/read-current-user-privilege-set">
<revision>
<property name="privilege-member-set"/>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/write">
<revision>
<property name="privilege-member-set"><![CDATA[<D:href
xmlns:D='DAV:'>/actions/write-acl</D:href> <D:href
xmlns:D='DAV:'>/actions/write-properties</D:href> <D:href
xmlns:D='DAV:'>/actions/write-content</D:href>]]></property>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/write-acl">
<revision>
<property name="privilege-member-set"/>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/write-properties">
<revision>
<property name="privilege-member-set"/>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/write-content">
<revision>
<property name="privilege-member-set"><![CDATA[<D:href
xmlns:D='DAV:'>/actions/bind</D:href> <D:href
xmlns:D='DAV:'>/actions/unbind</D:href>]]></property>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/bind">
<revision>
<property name="privilege-member-set"/>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/unbind">
<revision>
<property name="privilege-member-set"/>
</revision>
</objectnode>
<objectnode classname="org.apache.slide.structure.ActionNode"
uri="/actions/unlock">
<revision>
<property name="privilege-member-set"/>
</revision>
</objectnode>
</objectnode>
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/files">
<permission action="all" subject="unauthenticated"
inheritable="true"/>
<permission action="/actions/write" subject="/roles/user"
inheritable="true"/>
<permission action="/actions/read-acl" subject="owner"
inheritable="true"/>
</objectnode>
<!-- DeltaV: default history and workspace paths -->
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/history">
<permission action="all" subject="unauthenticated"
inheritable="true"/>
<permission action="/actions/write" subject="/roles/user"
inheritable="true"/>
<permission action="/actions/read-acl" subject="owner"
inheritable="true"/>
</objectnode>
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/workspace">
<permission action="all" subject="unauthenticated"
inheritable="true"/>
<permission action="/actions/write" subject="/roles/user"
inheritable="true"/>
<permission action="/actions/read-acl" subject="owner"
inheritable="true"/>
</objectnode>
<objectnode classname="org.apache.slide.structure.SubjectNode"
uri="/workingresource">
<permission action="all" subject="unauthenticated"
inheritable="true"/>
<permission action="/actions/write" subject="/roles/user"
inheritable="true"/>
<permission action="/actions/read-acl" subject="owner"
inheritable="true"/>
</objectnode>
</objectnode>
</data>
</namespace>
<!--
DeltaV global parameters
========================
* historypath (mandatory=no, default="/history"):
Specifies a Slide path which determines the location where this DeltaV
server stores history data.
* workspacepath (mandatory=no, default="/workspace"):
Specifies a Slide path which determines the location where this DeltaV
server allows workspaces to reside.
* workingresourcepath (mandatory=no, default="/workingresource"):
Specifies a Slide path which determines the location where this DeltaV
server stores working resources.
* auto-version (mandatory=no, default="checkout-checkin"):
Controls the DeltaV auto-version behaviour.
* auto-version-control (mandatory=no, default="false"):
Indicates if a resource just created by a PUT should be set under
version-control.
* versioncontrol-exclude (mandatory=no, default=""):
Specifies a Slide path which determines resources which are excluded from
version-control.
The default value "" makes no path being excluded.
* checkout-fork (mandatory=no, default="forbidden"):
Controls the DeltaV check-out behaviour when a version is already
checked-out or has a successor.
* checkin-fork (mandatory=no, default="forbidden"):
Controls the DeltaV check-out behaviour when a version has already a
successor.
* standardLivePropertiesClass (mandatory=no,
default="org.apache.slide.webdav.util.resourcekind.AbstractResourceKind"):
Determines the "agent" knowing about what the standard live properties are.
It should be a loadable class containing the following static methods:
- boolean isLiveProperty(String propName)
- boolean isProtectedProperty(String propName)
- boolean isComputedProperty(String propName)
- Set getAllLiveProperties()
- Set getAllProtectedProperties()
- Set getAllComputedProperties()
* uriRedirectorClass (mandatory=no,
default="org.apache.slide.webdav.util.DeltavUriRedirector"):
Determines the URI redirector class. The DeltaV URI redirector is in
charge of the following redirections:
- version URI to history URI, e.g. /history/2/1.4 to /history/2
- latest revision number for history resource to 0.0
- latest revision number for version resource to last URI token,
e.g. /history/2/1.4 to 1.4
It should be a loadable class containing the following static methods:
- String redirectUri(String uri)
- NodeRevisionNumber redirectLatestRevisionNumber(String uri)
-->
<parameter name="historypath">/history</parameter>
<parameter name="workspacepath">/workspace</parameter>
<parameter name="workingresourcepath">/workingresource</parameter>
<parameter name="auto-version">checkout-checkin</parameter>
<parameter name="auto-version-control">false</parameter>
<parameter name="versioncontrol-exclude"/>
<parameter name="checkout-fork">forbidden</parameter>
<parameter name="checkin-fork">forbidden</parameter>
</slide>
============================================================================
<><><><>JavaClass<><<>><><><>
package com.onespace.webdav;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Hashtable;
import java.util.Vector;
import org.apache.slide.authenticate.CredentialsToken;
import org.apache.slide.authenticate.SecurityToken;
import org.apache.slide.common.Domain;
import org.apache.slide.common.NamespaceAccessToken;
import org.apache.slide.common.SlideToken;
import org.apache.slide.common.SlideTokenImpl;
import org.apache.slide.content.Content;
import org.apache.slide.content.NodeRevisionContent;
import org.apache.slide.content.NodeRevisionDescriptor;
import org.apache.slide.content.NodeRevisionDescriptors;
import org.apache.slide.content.NodeRevisionNumber;
import org.apache.slide.lock.Lock;
import org.apache.slide.security.Security;
import org.apache.slide.structure.ObjectAlreadyExistsException;
import org.apache.slide.structure.Structure;
//import javax.transaction.UserTransaction;
import junit.framework.TestCase;
//import org.apache.slide.store.impl.rdbms.JDBCStore;
import slidestore.file.*;
public class Smysqlstore extends TestCase{
public Smysqlstore(String name) {
super(name);
}
private NamespaceAccessToken token;
private Structure structure;
private Security security;
private Lock lock;
private Content content;
private SlideToken slideToken;
protected void setUp() throws Exception {
super.setUp();
// Initialization
String namespace = "jdbc_store";
this.token =
Domain.accessNamespace(new SecurityToken(new String()),
namespace);
this.structure = token.getStructureHelper();
this.security = token.getSecurityHelper();
this.lock = token.getLockHelper();
this.content = token.getContentHelper();
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testAddContent() throws Exception {
CredentialsToken credentials = new CredentialsToken("root");
slideToken = new SlideTokenImpl(credentials);
// first addObject
String str1 = "test";
InputStream in1 =
(InputStream)(new ByteArrayInputStream(str1.getBytes()));
addObject(slideToken, in1, "/object1", true);
in1.close();
// second addObject
String str2 = "test test";
InputStream in2 =
(InputStream)(new ByteArrayInputStream(str2.getBytes()));
addObject(slideToken, in2, "/object1", true);
in2.close();
// third addObject
String str3 = "test test";
InputStream in3 =
(InputStream)(new ByteArrayInputStream(str3.getBytes()));
addObject(slideToken, in3, "/object1", true);
in3.close();
}
private void addObject(SlideToken slideToken, InputStream in,
String uri, boolean isVersioned)
throws Exception {
try {
// transaction begin
token.begin();
// Structure create
boolean exists = false;
try {
structure.create(slideToken,
new slideroles.basic.UserRoleImpl(), uri);
content.create(slideToken, uri, isVersioned);
} catch (ObjectAlreadyExistsException e) {
exists = true;
}
// Revision create
NodeRevisionDescriptors revisionDescriptors =
content.retrieve(slideToken, uri);
NodeRevisionDescriptor currentRevisionDescriptor =
new NodeRevisionDescriptor(
new NodeRevisionNumber("1.0"), "main",
new Vector(), new Hashtable());
// Contenet create
NodeRevisionContent currentRevisionContent = null;
if( in!=null ){
currentRevisionContent = new NodeRevisionContent();
currentRevisionContent.setContent(in);
}
// Store
if( exists && !revisionDescriptors.isVersioned() ){
try {
content.store(slideToken, uri,
currentRevisionDescriptor,
currentRevisionContent);
} catch (Exception ex){}
} else {
content.create(slideToken, uri,
currentRevisionDescriptor,
currentRevisionContent);
}
// transaction commit
token.commit();
} catch (Exception e) {
token.rollback();
throw e;
}
}
public static void main(String[] args) {
Smysqlstore smysqlstore = new
Smysqlstore("E:/Friends/Slide/Slide2.0b1Tomcat5.0.16/Slide2.0b1Tomcat5.0.16/bin");
try {
smysqlstore.setUp();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}
=============================================================================================================================
I thank you all
I expect some help from you today
COGI
---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster.