[rules-users] How to store the rules data into RDBMS, like mysql, oracle

Sinboy Zhang iamsinboy at gmail.com
Tue Dec 1 23:38:51 EST 2009


Thanks a lot.
After replace all of ${wsp.name} with default in repository.xml,guvnor run
well.But import examples, import jar model,save new rule etc ,will catch the
exceptions

---------------------------------------------
repository.xml:

<?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">
<!-- Example Repository Configuration File -->
<Repository>
    <!--
        virtual file system where the repository stores global state
        (e.g. registered namespaces, custom node types, etc.)
    -->
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        <param name="path" value="${rep.home}/repository"/>
    </FileSystem>
    <!--
        security configuration
    -->
    <Security appName="Jackrabbit">
        <!--
            access manager:
            class: FQN of class implementing the AccessManager interface
        -->
        <AccessManager
class="org.apache.jackrabbit.core.security.SimpleAccessManager">
            <!-- <param name="config" value="${rep.home}/access.xml"/> -->
        </AccessManager>
        <LoginModule
class="org.apache.jackrabbit.core.security.SimpleLoginModule">
           <!-- anonymous user name ('anonymous' is the default value) -->
           <!-- <param name="anonymousId" value="anonymous"/> -->
           <!--
              default user name to be used instead of the anonymous user
              when no login credentials are provided (unset by default)
           -->
           <!-- <param name="defaultUserId" value="superuser"/> -->
        </LoginModule>
    </Security>
    <!--
        location of workspaces root directory and name of default workspace
    -->
    <Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default"/>
    <!--
        workspace configuration template:
        used to create the initial workspace if there's no workspace yet
    -->
    <Workspace name="default">
        <!--
            virtual file system of the workspace:
            class: FQN of class implementing the FileSystem interface
        -->
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>
        <!--
            persistence manager of the workspace:
            class: FQN of class implementing the PersistenceManager
interface
        -->
    <PersistenceManager
class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
       <param name="driver" value="com.mysql.jdbc.Driver"/>
       <param name="url" value="jdbc:mysql://localhost:3306/guvnor_db"/>
       <param name="user" value="root" />
       <param name="password" value="a123456" />
       <param name="schema" value="mysql"/>
       <param name="schemaObjectPrefix" value="default_"/>
       <param name="externalBLOBs" value="false"/>
   </PersistenceManager>
        <!--
            Search index and the file system it uses.
            class: FQN of class implementing the QueryHandler interface
        -->
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
            <param name="textFilterClasses"
value="org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
            <param name="extractorPoolSize" value="2"/>
            <param name="supportHighlighting" value="true"/>
        </SearchIndex>
    </Workspace>
    <!--
        Configures the versioning
    -->
    <Versioning rootPath="${rep.home}/version">
        <!--
            Configures the filesystem to use for versioning for the
respective
            persistence manager
        -->
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/version" />
        </FileSystem>
        <!--
            Configures the persistence manager to be used for persisting
version state.
            Please note that the current versioning implementation is based
on
            a 'normal' persistence manager, but this could change in future
            implementations.
        -->
    <PersistenceManager
class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
       <param name="driver" value="com.mysql.jdbc.Driver"/>
       <param name="url" value="jdbc:mysql://localhost:3306/guvnor_db"/>
       <param name="user" value="root" />
       <param name="password" value="a123456" />
       <param name="schema" value="mysql"/>
       <param name="schemaObjectPrefix" value="default_"/>
       <param name="externalBLOBs" value="false"/>
   </PersistenceManager>
    </Versioning>
    <!--
        Search index for content that is shared repository wide
        (/jcr:system tree, contains mainly versions)
    -->
    <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        <param name="path" value="${rep.home}/repository/index"/>
        <param name="textFilterClasses"
value="org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
        <param name="extractorPoolSize" value="2"/>
        <param name="supportHighlighting" value="true"/>
    </SearchIndex>
</Repository>


2009/12/1 Jervisliu <jliu at redhat.com>

> A quick Google search indicated that this is probably a JackRabbit
> issue, see [1]. Did not dig deeper to see if this issue has been fixed
> in JackRabbit. You may want to find it out by yourself. One workaround
> is to replace ${wsp.name <http://wsp.name>} with "default".
>
> [1].
>
> http://mail-archives.apache.org/mod_mbox/jackrabbit-dev/200601.mbox/%3C004701c61db2$244cb970$b6fdfe0a@gkaradimitr%3E
>
> Cheers,
> Jervis Liu
>
> Sinboy Zhang wrote:
> > Hi,all:
> >    Guvnor is a BRMS,it can manage the rules through Jackrabbit
> > Repository.The default,Guvnor work well with derby database.But i want
> > it work with my database,just like MySQL.
> > My step is :
> >   1.Run Guvnor with default,and generate the repository.xml and
> > repository dictionary at JBOSS_HOME\bin dictionary
> >   2.delete repository dictionary and edit repository.xml,only replace
> > the content in <PersistenceManage> label ,just like this:
> >     <PersistenceManager
> > class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
> >        <param name="driver" value="com.mysql.jdbc.Driver"/>
> >        <param name="url" value="jdbc:mysql://localhost:3306/guvnor_db"/>
> >        <param name="user" value="root" />
> >        <param name="password" value="a123456" />
> >        <param name="schema" value="mysql"/>
> >        <param name="schemaObjectPrefix" value="${wsp.name
> > <http://wsp.name>}_"/>
> >        <param name="externalBLOBs" value="false"/>
> >    </PersistenceManager>
> >   3.install Mysql database,and create the guvnor_db database
> > instance,and copy mysql driver to JBOSS_HOME\server\deploy\lib
> >   4.Restart the JBoss ,i get the exception:
> >      org.drools.repository.RulesRepositoryException:
> > javax.jcr.RepositoryException: Invalid repository configuration:
> > repository.xml: Replacement not found for ${wsp.name
> > <http://wsp.name>}.: Replacement not found for ${wsp.name
> > <http://wsp.name>}.
> >
> >   Why?Please help me,thanks!
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091202/a9397c30/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: guvnor_mysql_unable_checkin.JPG
Type: image/jpeg
Size: 143401 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20091202/a9397c30/attachment.jpe 


More information about the rules-users mailing list