Thank you again Jere for your answer. It helps me a lot to improve my
understanding.
Following your answer I've conducted several tests.
Here are the value I've tried for the workspace name attribute:
- A constant: it works, but I've read elsewhere that it will cause
trouble when using multiple workspaces & repositories since they will
use the DB table.
- ${wsp.name}: leads to the mentioned error (name too long), the name
is
UNNAMED_x0020__x002d__x0020_COM_x002e_FYLAB_x002e_ELIOT_x003a_ELIOT_x002d_DOCS_x002d_SOCLE_x003a_JAR_x003a_2_x002e_2_x002e_0_x002d_SNAPSHOT_BUNDLE
which is the name of the JAR file in which my JackRabbit module is embedded
- ${rep.home}: works (I didn't check the value of this attribute, but
since my repository is well created in repositories/<repository_name>, I
guess it's value is this path)
- ${wsp.home}: works as well (and I guess it matches the path of the
workspace directory)
So... I've no idea how the variable ${wsp.name} is evaluated, but the
problem seems to come from the fact that somehow it uses the container
JAR file name.
I think that I will use the variable ${wsp.home} since it works and is
supposed to be unique for each workspace.
I am still interested to understand how to control the ${wsp.name}. So
if someone has an idea about that, please let me know.
John
Jere McDevitt a écrit :
Please note I'm just learning this stuff myself, so if others have better
information please correct me.
>From what I understand from the documentation, there needs to be provided a
default setting for the repository home ${rep.home}, which can come from
system properties, jndi configuration or some other component
configuration. That setting is then used as a base for other properties.
The documentation specifies this can be provided as system properties, but
I'm not sure what the default value ends up being if you don't provide it.
The system properties are
org.apache.jackrabbit.repository.conf
org.apache.jackrabbit.repository.home
The first points to a repository.xml file, the second becomes the value of
the ${rep.home} parameter used by the repository.xml file. Then,
${wsp.home} is defined as ${rep.home}/workspaces.
The <workspace> section of the repository.xml file allows for setting the
name of the workspace. The default configuration file (
http://jackrabbit.apache.org/jackrabbit-configuration.data/repository.xml)
shows the settings as
<Workspace name="${wsp.name}">
If I'm reading the source code correctly, then the default value for this
will be set as the "File(home).getName()" where home is the ${wsp.home}
setting, so in the default case, the ${wsp.name} variable becomes
${rep.home}/workspaces.
Look at what you have set for the ${rep.home} variable to see if that is
where these values are coming from or try setting the name attribute in the
<Workspace> tag to a fixed value and see what happens.
On Wed, Jan 6, 2010 at 8:58 AM, John Tranier <[email protected]> wrote:
Thank you very much for you answer Jere.
Indeed, my deployed repository settings file contains the following entry:
<PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
<param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
<param name="schemaObjectPrefix" value="Unnamed -
com.fylab.eliot:eliot-docs-socle:jar:2.2.0-SNAPSHOT_"/>
</PersistenceManager>
The repository setting file I'm using to create the repository contains:
<PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
<param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
<param name="schemaObjectPrefix" value="${wsp.name
}_"/>
</PersistenceManager>
So it happens that the 'wsp.name' is mapped to 'Unnamed -
com.fylab.eliot:eliot-docs-socle:jar:2.2.0-SNAPSHOT_'
The 2nd part of that name is the JAR file that contains my JackRabbit
module.
As a temporary solution I can replace this pattern by a constant like:
<param name="schemaObjectPrefix" value="defaultWorkspace"/>
But what should I do to get the name of the workspace without the JAR file
qualification?
John
Jere McDevitt a écrit :
I saw something similar when first converting over to using Postgres.
Table
names which get created based on prefix settings are URL encoded, so if
you
have content with characters like . (002e) - (002d) and : (003a) you get
table names like that. It appears somewhere in your configuration file
you
are using a what looks like might be a classpath entry in a config setting
that defines a table name. Can you post the repository settings file you
are using? Looking at the name it looks like you have:
UNNAMED _- _ COM.FYLAB.ELIOT:ELIOT-DOCS-SOCLE:JAR:2.2.0-SNAPSHOT_BUNDLE
in a setting somewhere.
On Wed, Jan 6, 2010 at 4:44 AM, John Tranier <[email protected]>
wrote:
Hi all,
I am stuck with an issue that sounds related to character encoding, and I
would like to check if someone knows about it or has an idea of how I can
overcome it.
I have developed for my web application a JackRabbit module.
Everything works fine with my tests inside the module, but when I deploy
this module inside my application it fails to instantiate the persistence
manager.
Here is the relevant stack trace:
javax.jcr.RepositoryException: Cannot instantiate persistence manager
org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager:
Schema generation error: Issuing statement: create table
UNNAMED_x0020__x002d__x0020_COM_x002e_FYLAB_x002e_ELIOT_x003a_ELIOT_x002d_DOCS_x002d_SOCLE_x003a_JAR_x003a_2_x002e_2_x002e_0_x002d_SNAPSHOT_BUNDLE
(NODE_ID_HI bigint not null, NODE_ID_LO bigint not null, BUNDLE_DATA
blob(2G) not null, PRIMARY KEY (NODE_ID_HI, NODE_ID_LO)): Schema
generation
error: Issuing statement: create table
UNNAMED_x0020__x002d__x0020_COM_x002e_FYLAB_x002e_ELIOT_x003a_ELIOT_x002d_DOCS_x002d_SOCLE_x003a_JAR_x003a_2_x002e_2_x002e_0_x002d_SNAPSHOT_BUNDLE
(NODE_ID_HI bigint not null, NODE_ID_LO bigint not null, BUNDLE_DATA
blob(2G) not null, PRIMARY KEY (NODE_ID_HI, NODE_ID_LO))
Caused by: java.sql.SQLException: The name
'UNNAMED_X0020__X002D__X0020_COM_X002E_FYLAB_X002E_ELIOT_X003A_ELIOT_X002D_DOCS_X002D_SOCLE_X003A_JAR_X003A_2_X002E_2_X002E_0_X002D_SNAPSHOT_BUNDLE'
is too long. The maximum length is '128'.
Thanks for support,
John