jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Bloomfield Ramagem" <daniel.rama...@gmail.com>
Subject New Workspace Initialization & Jackrabbit Resource Adapter
Date Mon, 05 Feb 2007 20:40:45 GMT
I'm trying to create a new workspace from within a servlet that has a
reference to the Jackrabbit Resource Adapter (RAR).  The new workspace
directory seems to get only partially initialized however--there is only the
workspace.xml file inside of the newly created workspace.

For example, before running my code I have the normal default workspace:

/jackrabbit-repo/workspaces/default/blobs
/jackrabbit-repo/workspaces/default/db
/jackrabbit-repo/workspaces/default/index
/jackrabbit-repo/workspaces/default/locks
/jackrabbit-repo/workspaces/default/workspace.xml

But after creation of a new "foo" workspace I only have the following for
this new workspace:

/jackrabbit-repo/workspaces/foo/workspace.xml

In the logs I also don't see the typical initialization messages I see for
"default":

INFO  [RepositoryImpl] initializing workspace 'default'...
INFO  [LocalFileSystem] LocalFileSystem initialized at path
C:\jackrabbit-repo\workspaces\default
INFO  [LocalFileSystem] LocalFileSystem initialized at path
C:\jackrabbit-repo\workspaces\default\blobs
INFO  [RepositoryImpl] workspace 'default' initialized
INFO  [SearchIndex] Index initialized: C:/jackrabbit-repo/repository/index
INFO  [SearchIndex] Index initialized:
C:\jackrabbit-repo\workspaces\default/index

Am I missing something?  I thought creation of a new workspace basically
involved casting a workspace into JackrabbitWorkspace and calling the
"createWorkspace" method.  Then, upon first login into the new workspace all
of the workspace structures would get created.

It's almost as if with the RAR it's delaying the initialization of the
workspace?  How do I "force" initialization of this new workspace?

This is my code:

Context ctx = new InitialContext();
Repository repository = (Repository) ctx.lookup("java:comp/env/jackrabbit");
Credentials credentials = new SimpleCredentials("username",
"password".toCharArray());
Session session = repository.login(credentials);
Workspace workspace = session.getWorkspace();
JackrabbitWorkspace jws = (JackrabbitWorkspace) workspace;
jws.createWorkspace(workspaceName);
// login to force the initalization of the workspace now rather than later
session = repository.login(credentials, workspaceName);
Node root = session.getRootNode();


Thanks,

Daniel.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message